Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New 'Hello World' page #934

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5137adb
Adding new 'hello world' templates - both skeleton and default variat…
rafaelcamaram Apr 9, 2021
6b4be20
Fixing typo related to 'hello world' message pointing index route path
rafaelcamaram Apr 9, 2021
5a4277b
Adding changeset
rafaelcamaram Apr 9, 2021
574cb02
Updating create-svelte lint command in order to consider template-ske…
rafaelcamaram Apr 9, 2021
c5df749
Removing unnecessary console.logs
rafaelcamaram Apr 9, 2021
ca0ccea
Moving Sun/Moon SVG code to asset SVG file
rafaelcamaram Apr 9, 2021
a0019e4
Moving Increase/Decrease Counter SVG codes to asset SVG files
rafaelcamaram Apr 9, 2021
a2722c4
Reverting changes related to Increase/Decrease Counter icons since it…
rafaelcamaram Apr 9, 2021
d692fdc
Improving some points related to add_css and add_typescript file methods
rafaelcamaram Apr 9, 2021
68080f6
Removing skeleton template
rafaelcamaram Apr 9, 2021
3e43b5e
Fixing PR comments made by benmccann
rafaelcamaram Apr 9, 2021
5f5523c
Removing svelte-kit-demo in favor of new hello world page
rafaelcamaram Apr 9, 2021
0c71f4f
Removing built-in support for CSS/LESS/SCSS modifications (it will be…
rafaelcamaram Apr 9, 2021
815475d
Adding is_skeleton_template to create-svelte CLI
rafaelcamaram Apr 10, 2021
30968db
Fixing merge conflicts with master
rafaelcamaram Apr 10, 2021
fb48e17
Fixing merge conflicts with master related to Counter.svelte
rafaelcamaram Apr 11, 2021
6221e23
New Hello World page. Fixing add_typescript typos, removing unnecessa…
rafaelcamaram Apr 12, 2021
bad4fbc
Applying prettier/lint
rafaelcamaram Apr 12, 2021
b775c3c
Updating Hellow World eslint package json command in order to stop co…
rafaelcamaram Apr 12, 2021
d90c015
Applying suggestions made by dummdidumm regarding CSS classname patte…
rafaelcamaram Apr 12, 2021
447f4f6
Merge branch 'master' of github.com:sveltejs/kit into camara/gh-90
rafaelcamaram Apr 12, 2021
78b8ece
Updating CLI message related to addon possibilities
rafaelcamaram Apr 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chilly-meals-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte': patch
---

Adding new 'hello world' templates - skeleton and default variants -. Applying it to the CLI as well
6 changes: 0 additions & 6 deletions examples/svelte-kit-demo/.gitignore

This file was deleted.

17 changes: 0 additions & 17 deletions examples/svelte-kit-demo/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions examples/svelte-kit-demo/package.json

This file was deleted.

12 changes: 0 additions & 12 deletions examples/svelte-kit-demo/src/app.html

This file was deleted.

Empty file.
41 changes: 0 additions & 41 deletions examples/svelte-kit-demo/src/lib/Nav.svelte

This file was deleted.

25 changes: 0 additions & 25 deletions examples/svelte-kit-demo/src/routes/$layout.svelte

This file was deleted.

15 changes: 0 additions & 15 deletions examples/svelte-kit-demo/src/routes/about/index.svelte

This file was deleted.

13 changes: 0 additions & 13 deletions examples/svelte-kit-demo/src/routes/blog/[slug].json.ts

This file was deleted.

25 changes: 0 additions & 25 deletions examples/svelte-kit-demo/src/routes/blog/[slug].svelte

This file was deleted.

14 changes: 0 additions & 14 deletions examples/svelte-kit-demo/src/routes/blog/_posts.ts

This file was deleted.

10 changes: 0 additions & 10 deletions examples/svelte-kit-demo/src/routes/blog/index.json.ts

This file was deleted.

45 changes: 0 additions & 45 deletions examples/svelte-kit-demo/src/routes/blog/index.svelte

This file was deleted.

23 changes: 0 additions & 23 deletions examples/svelte-kit-demo/src/routes/index.svelte

This file was deleted.

Binary file removed examples/svelte-kit-demo/static/favicon.ico
Binary file not shown.
4 changes: 0 additions & 4 deletions examples/svelte-kit-demo/static/logo.svg

This file was deleted.

3 changes: 0 additions & 3 deletions examples/svelte-kit-demo/static/robots.txt

This file was deleted.

9 changes: 0 additions & 9 deletions examples/svelte-kit-demo/svelte.config.cjs

This file was deleted.

10 changes: 0 additions & 10 deletions examples/svelte-kit-demo/wrangler.toml

This file was deleted.

39 changes: 22 additions & 17 deletions packages/create-svelte/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import path from 'path';
import prompts from 'prompts/lib/index';
import glob from 'tiny-glob/sync.js';
import gitignore_contents from '../template/.gitignore';
import add_css from './modifications/add_css';
import add_typescript from './modifications/add_typescript';
import add_skeleton_template from './modifications/add_skeleton_template';
// import versions from './versions';
import { version } from '../package.json';
import add_prettier from './modifications/add_prettier';
Expand Down Expand Up @@ -77,9 +77,14 @@ async function main() {
await prompt_modifications(target);

console.log(
'\nWant to add other parts to your code base? ' +
'Visit https://github.com/svelte-add/svelte-adders, a community project of commands ' +
'to add particular functionality to Svelte projects\n'
`\n✧ Want to add other parts to your code base or add support for ${bold(
cyan('CSS preprocessors')
)}?`
);
console.log(
`\nVisit ${bold(
cyan('https://github.com/svelte-add/svelte-adders')
)} and unleash the possibilities with a community project of commands to add particular functionalities to Svelte projects.\n`
rafaelcamaram marked this conversation as resolved.
Show resolved Hide resolved
);

console.log('\nNext steps:');
Expand All @@ -103,25 +108,25 @@ async function main() {
* @param {string} target
*/
async function prompt_modifications(target) {
const template_response = await prompts({
type: 'select',
name: 'value',
message: 'Which app Svelte template do you want to use?',
choices: [
{ title: 'Default App (Counter + Route)', value: 'default' },
{ title: 'Skeleton App', value: 'skeleton' }
]
});
const is_skeleton_template = template_response.value === 'skeleton';
await add_skeleton_template(target, is_skeleton_template);

const ts_response = await prompts({
type: 'confirm',
name: 'value',
message: 'Use TypeScript in components?',
initial: false
});
await add_typescript(target, ts_response.value);

const css_response = await prompts({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would have left that in it's really easy to setup, we don't even need to add much code modifications. Also, do we have any data how many people would choose what? I think people would opt for scss quite a bit just because many component libraries use it for their styling/theming.

Copy link
Contributor Author

@rafaelcamaram rafaelcamaram Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I see your point.. The only drawback I see is that we would need to maintain 3 different styling files (I believe that's why @benmccann suggested removing it) but i's not a big deal for me -- it'd be easy to revert.

@dummdidumm @benmccann How should I move forward with it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We chatted about this part for a bit and it sounds like @Rich-Harris and @pngwn also vote to take out the CSS stuff

type: 'select',
name: 'value',
message: 'What do you want to use for writing Styles in Svelte components?',
choices: [
{ title: 'CSS', value: 'css' },
{ title: 'Less', value: 'less' },
{ title: 'SCSS', value: 'scss' }
]
});
await add_css(target, css_response.value);
await add_typescript(target, ts_response.value, is_skeleton_template);

const eslint_response = await prompts({
type: 'confirm',
Expand Down
Loading