Skip to content

Conversation

@Vheissu
Copy link
Member

@Vheissu Vheissu commented Jan 24, 2026

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

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}`;
Copy link
Member

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

Copy link
Member

@3cp 3cp left a 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 = [
Copy link
Member

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`.
Copy link
Member

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.'},
Copy link
Member

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)'}
Copy link
Member

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() {
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants