From 273642751e0f18f46962f7a04355b6413fe24098 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 12 Apr 2021 18:27:12 -0400 Subject: [PATCH 01/10] remove add_css --- packages/create-svelte/cli/index.js | 13 ----- .../cli/modifications/add_css.js | 58 ------------------- .../template-additions/src/app.less | 4 -- .../template-additions/src/app.scss | 4 -- .../src/app.css | 0 5 files changed, 79 deletions(-) delete mode 100644 packages/create-svelte/cli/modifications/add_css.js delete mode 100644 packages/create-svelte/template-additions/src/app.less delete mode 100644 packages/create-svelte/template-additions/src/app.scss rename packages/create-svelte/{template-additions => template}/src/app.css (100%) diff --git a/packages/create-svelte/cli/index.js b/packages/create-svelte/cli/index.js index f17d7e881cac..ff246f58ffbb 100644 --- a/packages/create-svelte/cli/index.js +++ b/packages/create-svelte/cli/index.js @@ -7,7 +7,6 @@ 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 versions from './versions'; import { version } from '../package.json'; @@ -111,18 +110,6 @@ async function prompt_modifications(target) { }); await add_typescript(target, ts_response.value); - const css_response = await prompts({ - 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); - const eslint_response = await prompts({ type: 'confirm', name: 'value', diff --git a/packages/create-svelte/cli/modifications/add_css.js b/packages/create-svelte/cli/modifications/add_css.js deleted file mode 100644 index 0fabe673f275..000000000000 --- a/packages/create-svelte/cli/modifications/add_css.js +++ /dev/null @@ -1,58 +0,0 @@ -import { bold, green } from 'kleur/colors'; -import { - add_svelte_preprocess_to_config, - copy_from_template_additions, - update_component, - update_package_json_dev_deps -} from './utils'; - -/** - * Add chosen CSS language to the project. - * - * @param {string} cwd - * @param {'css' | 'scss' | 'less'} which - */ -export default async function add_css(cwd, which) { - if (which === 'css') { - copy_from_template_additions(cwd, ['src', 'app.css']); - console.log('You can add support for CSS preprocessors like SCSS/Less/PostCSS later.'); - } else if (which === 'less') { - update_package_json_dev_deps(cwd, { - less: '^3.0.0', - 'svelte-preprocess': '^4.0.0' - }); - copy_from_template_additions(cwd, ['src', 'app.less']); - update_component(cwd, 'src/routes/$layout.svelte', [['../app.css', '../app.less']]); - update_component(cwd, 'src/lib/Counter.svelte', [['