-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat(cli): updates and improvements #155
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
base: master
Are you sure you want to change the base?
Conversation
Adds automatic creation/merging of a project-level .npmrc when pnpm is selected, ensuring required settings are present. Introduces a helper to write default pnpm config and safely append it if missing or incomplete. Preserves existing content and supports in-project setups. Updates tests to verify .npmrc creation in the project root during setup. Removes default in-repo .npmrc in common.
Adds new lean presets and minimal app presets powered by Vite, updating existing presets to use Vite/Vitest instead of Webpack. Introduces Vite-based plugin support with a CSS-injection mechanism to embed CSS into JS for Shadow DOM builds. Extends CLI prompts and samples to reflect the new presets, adds blank/minimal/router scaffolds, and updates router-tailwind samples accordingly. Aligns tests, lint rules, and docs with the new tooling and bump Storybook integration to compatible versions.
|
|
||
| Object.values(bundle).forEach((chunk) => { | ||
| if (chunk.type === 'chunk' && chunk.isEntry) { | ||
| chunk.code = `${injection}${chunk.code}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wont this destroy sourcemap? Should we append it instead
3cp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thx for the hard work.
Only few minor touches for you to consider.
| const fs = require('fs'); | ||
| const path = require('path'); | ||
|
|
||
| const PNPM_NPMRC = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use?
const PNPM_NPMRC = `# for pnpm, use flat node_modules
shamefully-hoist=true
auto-install-peers=true
`;| It builds plugin into `dist/index.js` file. | ||
|
|
||
| // @if vite | ||
| When using Vite, the build outputs ESM to `dist/index.js`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note common/package.json has following lines need attention.
// TODO: turn on after moved plugin to vite steup
// "type": "module",
You would want to turn it on.
| message: 'Which bundler would you like to use?', | ||
| choices: [ | ||
| {if: 'app', value: 'vite', title: 'Vite', hint: 'Next Generation Frontend Tooling.'}, | ||
| {if: 'app || plugin', value: 'vite', title: 'Vite', hint: 'Next Generation Frontend Tooling.'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should just remove this if condition instead of broadening it.
| choices: [ | ||
| {title: 'No'}, | ||
| {if: '(app && (vite || webpack)) || (plugin && webpack)', value: 'storybook', title: 'Yes', hint: 'Add Storybook for component development and testing (requires Vite or Webpack)'} | ||
| {if: '(app || plugin) && (vite || webpack)', value: 'storybook', title: 'Yes', hint: 'Add Storybook for component development and testing (requires Vite or Webpack)'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sound like you only need if: 'vite || webpack'.
| // @endif | ||
| // @endif | ||
| // @if plugin | ||
| function cssInjectPlugin() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not this whole cssInjectPlugin be another export from our @aurelia/vite-plugin?
Adds new lean presets and minimal app presets powered by Vite, updating existing presets to use Vite/Vitest instead of Webpack. Introduces Vite-based plugin support with a CSS-injection mechanism to embed CSS into JS for Shadow DOM builds. Extends CLI prompts and samples to reflect the new presets, adds blank/minimal/router scaffolds, and updates router-tailwind samples accordingly. Aligns tests, lint rules, and docs with the new tooling and bump Storybook integration to compatible versions.
Closes #154 #153 #152