Chore/remove highlightjs (#2032)

This commit is contained in:
Nik
2023-09-13 03:18:52 +10:00
committed by GitHub
parent f7a4d23318
commit 435f2ff821
2 changed files with 22 additions and 15 deletions

View File

@@ -0,0 +1,6 @@
---
"create-skeleton-app": patch
---
Removed highlightjs
- highlightjs defaults to installing support for all languages and this makes the final bundle size massive. It is recommended to install this manually with the selected languages you need.

View File

@@ -129,7 +129,7 @@ async function parseArgs() {
/**
* @param {SkeletonOptions} opts
*/
export async function askForMissingParams(opts) {
async function askForMissingParams(opts) {
const { version } = JSON.parse(fs.readFileSync(dist('../package.json'), 'utf-8'));
intro(`Create Skeleton App ${gray(`(version ${version})`)}
@@ -249,14 +249,14 @@ Problems? Open an issue on ${cyan('https://github.com/skeletonlabs/skeleton/issu
});
opts.skeletontheme.pop('custom');
opts.skeletontheme.push({ custom: customName });
goodbye();
goodbye(customName);
}
// Additional packages to install - these can be influenced by the template selected
let packages = [
{ value: 'forms', label: 'Add Tailwind forms?', package: '@tailwindcss/forms', force: false },
{ value: 'typography', label: 'Add Tailwind typography?', package: '@tailwindcss/typography', force: false },
{ value: 'codeblocks', label: 'Add CodeBlock (installs highlight.js) ?', package: 'highlight.js', force: false },
// { value: 'codeblocks', label: 'Add CodeBlock (installs highlight.js)?', package: 'highlight.js', force: false },
{ value: 'popups', label: 'Add Popups (installs floating-ui)?', package: '@floating-ui/dom', force: false },
// { value: 'mdsvex', label: 'Add Markdown support (installs mdsvex)?', package: 'mdsvex', force: false },
];
@@ -284,7 +284,7 @@ Problems? Open an issue on ${cyan('https://github.com/skeletonlabs/skeleton/issu
options: optionalPackages,
required: false,
});
goodbye(packages);
goodbye(packageChoices);
if (Array.isArray(packageChoices)) {
packageChoices.forEach((value) => (opts[value] = true));
}
@@ -298,8 +298,9 @@ Problems? Open an issue on ${cyan('https://github.com/skeletonlabs/skeleton/issu
{ value: 'checkjs', label: 'Yes, using JavaScript with JSDoc comments' },
{ value: null, label: 'No' },
],
required: true,
});
goodbye(opts.type);
goodbye(opts.types);
}
// Setup dev oriented packages and settings
@@ -329,4 +330,4 @@ Problems? Open an issue on ${cyan('https://github.com/skeletonlabs/skeleton/issu
return opts;
}
main();
main().catch(console.error);