@aerogel/cli 0.0.0-next.444e75523f9ddc8b8de7cd36b333f476ef86a46c → 0.0.0-next.46a3020f90bb19fb98d8b9c75a7228de4fe76346

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/bin/gel +1 -1
  2. package/dist/aerogel-cli.d.ts +2 -2
  3. package/dist/aerogel-cli.js +833 -0
  4. package/dist/aerogel-cli.js.map +1 -0
  5. package/package.json +20 -33
  6. package/src/cli.ts +27 -9
  7. package/src/commands/Command.ts +4 -7
  8. package/src/commands/create.test.ts +6 -14
  9. package/src/commands/create.ts +11 -11
  10. package/src/commands/generate-component.test.ts +10 -16
  11. package/src/commands/generate-component.ts +30 -19
  12. package/src/commands/generate-model.test.ts +3 -11
  13. package/src/commands/generate-model.ts +11 -11
  14. package/src/commands/generate-overrides.ts +10 -10
  15. package/src/commands/generate-service.test.ts +4 -12
  16. package/src/commands/generate-service.ts +14 -14
  17. package/src/commands/info.ts +15 -0
  18. package/src/commands/install.test.ts +4 -26
  19. package/src/commands/install.ts +11 -12
  20. package/src/lib/App.ts +9 -6
  21. package/src/lib/Editor.ts +3 -4
  22. package/src/lib/File.mock.ts +7 -11
  23. package/src/lib/File.ts +3 -3
  24. package/src/lib/Log.mock.ts +4 -8
  25. package/src/lib/Log.test.ts +4 -4
  26. package/src/lib/Log.ts +7 -7
  27. package/src/lib/Shell.mock.ts +2 -2
  28. package/src/lib/Shell.ts +2 -2
  29. package/src/lib/Template.ts +19 -16
  30. package/src/lib/utils/app.ts +2 -2
  31. package/src/lib/utils/edit.ts +2 -2
  32. package/src/lib/utils/paths.ts +15 -7
  33. package/src/plugins/Plugin.ts +7 -26
  34. package/src/plugins/Solid.ts +15 -22
  35. package/src/plugins/Soukai.ts +4 -4
  36. package/src/testing/setup.ts +30 -31
  37. package/templates/app/.github/workflows/ci.yml +4 -4
  38. package/templates/app/.nvmrc +1 -1
  39. package/templates/app/.vscode/launch.json +1 -0
  40. package/templates/app/cypress/cypress.config.ts +2 -4
  41. package/templates/app/cypress/support/e2e.ts +1 -3
  42. package/templates/app/cypress/tsconfig.json +7 -8
  43. package/templates/app/index.html +2 -2
  44. package/templates/app/package.json +19 -18
  45. package/templates/app/src/App.vue +1 -1
  46. package/templates/app/src/assets/css/main.css +4 -0
  47. package/templates/app/src/main.ts +2 -2
  48. package/templates/app/tsconfig.json +3 -10
  49. package/templates/app/vite.config.ts +6 -4
  50. package/templates/component-button/[component.name].vue +2 -2
  51. package/templates/component-checkbox/[component.name].vue +34 -0
  52. package/templates/component-checkbox-story/[component.name].story.vue +63 -0
  53. package/templates/component-input/[component.name].vue +1 -0
  54. package/templates/overrides/components/overrides/ConfirmModal.vue +5 -5
  55. package/templates/overrides/components/overrides/ErrorReportModal.vue +6 -6
  56. package/templates/overrides/components/overrides/ModalWrapper.vue +3 -3
  57. package/templates/overrides/components/overrides/SnackbarNotification.vue +3 -3
  58. package/templates/overrides-story/Overrides.story.vue +10 -10
  59. package/templates/service/[service.name].ts +1 -1
  60. package/.prettierignore +0 -1
  61. package/dist/aerogel-cli.cjs.js +0 -2
  62. package/dist/aerogel-cli.cjs.js.map +0 -1
  63. package/dist/aerogel-cli.esm.js +0 -2
  64. package/dist/aerogel-cli.esm.js.map +0 -1
  65. package/src/plugins/Histoire.ts +0 -105
  66. package/src/testing/stubs/ProgramStub.ts +0 -35
  67. package/src/testing/utils.ts +0 -14
  68. package/templates/app/postcss.config.js +0 -6
  69. package/templates/app/src/assets/css/styles.css +0 -3
  70. package/templates/app/tailwind.config.js +0 -5
  71. package/templates/histoire/histoire.config.ts +0 -7
  72. package/templates/histoire/patches/histoire+0.17.6.patch +0 -13
  73. package/templates/histoire/src/main.histoire.ts +0 -8
  74. package/templates/postcss-pseudo-classes/postcss.config.js +0 -15
  75. package/tsconfig.json +0 -11
  76. package/vite.config.ts +0 -14
  77. /package/src/{main.ts → index.ts} +0 -0
@@ -1,15 +1,23 @@
1
- import { resolve } from 'path';
1
+ import { URL, fileURLToPath } from 'node:url';
2
2
  import { stringMatch } from '@noeldemartin/utils';
3
+ import { resolve } from 'node:path';
3
4
 
4
- import File from '@/lib/File';
5
- import Log from '@/lib/Log';
5
+ import File from '@aerogel/cli/lib/File';
6
+ import Log from '@aerogel/cli/lib/Log';
6
7
 
7
8
  export function basePath(path: string = ''): string {
8
- if (File.contains(resolve(__dirname, '../../../package.json'), '"name": "aerogel"')) {
9
- return resolve(__dirname, '../', path);
9
+ if (
10
+ File.contains(
11
+ fileURLToPath(new URL(/* @vite-ignore */ '../../../package.json', import.meta.url)),
12
+ '"packages/create-aerogel"',
13
+ )
14
+ ) {
15
+ return resolve(fileURLToPath(new URL(/* @vite-ignore */ '../', import.meta.url)), path);
10
16
  }
11
17
 
12
- const packageJson = File.read(resolve(__dirname, '../../../../package.json'));
18
+ const packageJson = File.read(
19
+ fileURLToPath(new URL(/* @vite-ignore */ '../../../../package.json', import.meta.url)),
20
+ );
13
21
  const matches = stringMatch<2>(packageJson ?? '', /"@aerogel\/core": "file:(.*)\/aerogel-core-[\d.]*\.tgz"/);
14
22
  const cliPath = matches?.[1] ?? Log.fail<string>('Could not determine base path');
15
23
 
@@ -30,5 +38,5 @@ export function packagePath(packageName: string): string {
30
38
  }
31
39
 
32
40
  export function templatePath(name: string): string {
33
- return resolve(__dirname, `../templates/${name}`);
41
+ return fileURLToPath(new URL(/* @vite-ignore */ `../templates/${name}`, import.meta.url));
34
42
  }
@@ -1,13 +1,13 @@
1
1
  import { Node, SyntaxKind } from 'ts-morph';
2
2
  import type { ArrayLiteralExpression, ImportDeclarationStructure, OptionalKind, SourceFile } from 'ts-morph';
3
3
 
4
- import Log from '@/lib/Log';
5
- import Shell from '@/lib/Shell';
6
- import File from '@/lib/File';
7
- import { app, isLinkedLocalApp, isLocalApp } from '@/lib/utils/app';
8
- import { editFiles, findDescendant, when } from '@/lib/utils/edit';
9
- import { packNotFound, packagePackPath, packagePath } from '@/lib/utils/paths';
10
- import type { Editor } from '@/lib/Editor';
4
+ import Log from '@aerogel/cli/lib/Log';
5
+ import Shell from '@aerogel/cli/lib/Shell';
6
+ import File from '@aerogel/cli/lib/File';
7
+ import { app, isLinkedLocalApp, isLocalApp } from '@aerogel/cli/lib/utils/app';
8
+ import { editFiles, findDescendant, when } from '@aerogel/cli/lib/utils/edit';
9
+ import { packNotFound, packagePackPath, packagePath } from '@aerogel/cli/lib/utils/paths';
10
+ import type { Editor } from '@aerogel/cli/lib/Editor';
11
11
 
12
12
  export default abstract class Plugin {
13
13
 
@@ -101,25 +101,6 @@ export default abstract class Plugin {
101
101
  });
102
102
  }
103
103
 
104
- protected async updateTailwindConfig(editor: Editor, options: { content: string }): Promise<void> {
105
- await Log.animate('Updating tailwind configuration', async () => {
106
- const tailwindConfig = editor.requireSourceFile('tailwind.config.js');
107
- const contentArray = this.getTailwindContentArray(tailwindConfig);
108
-
109
- if (!contentArray) {
110
- return Log.fail(`
111
- Could not find content array in tailwind config, please add the following manually:
112
-
113
- ${options.content}
114
- `);
115
- }
116
-
117
- contentArray.addElement(options.content);
118
-
119
- await editor.save(tailwindConfig);
120
- });
121
- }
122
-
123
104
  protected getBootstrapPluginsDeclaration(mainConfig: SourceFile): ArrayLiteralExpression | null {
124
105
  const bootstrapAppCall = findDescendant(mainConfig, {
125
106
  guard: Node.isCallExpression,
@@ -1,10 +1,8 @@
1
- import File from '@/lib/File';
2
- import Log from '@/lib/Log';
3
- import Plugin from '@/plugins/Plugin';
4
- import Shell from '@/lib/Shell';
5
- import { isLinkedLocalApp } from '@/lib/utils/app';
6
- import { packagePath } from '@/lib/utils/paths';
7
- import type { Editor } from '@/lib/Editor';
1
+ import File from '@aerogel/cli/lib/File';
2
+ import Log from '@aerogel/cli/lib/Log';
3
+ import Plugin from '@aerogel/cli/plugins/Plugin';
4
+ import Shell from '@aerogel/cli/lib/Shell';
5
+ import type { Editor } from '@aerogel/cli/lib/Editor';
8
6
 
9
7
  export class Solid extends Plugin {
10
8
 
@@ -12,21 +10,16 @@ export class Solid extends Plugin {
12
10
  super('solid');
13
11
  }
14
12
 
15
- protected async updateFiles(editor: Editor): Promise<void> {
16
- await this.updateTailwindConfig(editor, {
17
- content: isLinkedLocalApp()
18
- ? `'${packagePath('plugin-solid')}/dist/**/*.js'`
19
- : '\'./node_modules/@aerogel/plugin-solid/dist/**/*.js\'',
20
- });
21
-
13
+ protected override async updateFiles(editor: Editor): Promise<void> {
22
14
  await this.updateNpmScripts(editor);
23
15
  await this.updateGitIgnore();
24
16
  await super.updateFiles(editor);
25
17
  }
26
18
 
27
- protected async installNpmDependencies(): Promise<void> {
19
+ protected override async installNpmDependencies(): Promise<void> {
28
20
  await Shell.run('npm install soukai-solid@next --save-exact');
29
- await Shell.run('npm install @solid/community-server@7 --save');
21
+ await Shell.run('npm install @noeldemartin/solid-utils@next --save-exact');
22
+ await Shell.run('npm install @solid/community-server@7.1.6 --save-dev -E');
30
23
  await super.installNpmDependencies();
31
24
  }
32
25
 
@@ -50,17 +43,17 @@ export class Solid extends Plugin {
50
43
  .replace(
51
44
  '"cy:test": "start-server-and-test test:serve-app http-get://localhost:5001 cy:run",',
52
45
  '"cy:test": "start-server-and-test ' +
53
- 'test:serve-app http-get://localhost:5001 test:serve-pod http-get://localhost:4000 cy:run",',
46
+ 'test:serve-app http-get://localhost:5001 test:serve-pod http-get://localhost:3000 cy:run",',
54
47
  )
55
48
  .replace(
56
49
  '"dev": "vite",',
57
50
  '"dev": "vite",\n' +
58
- '"dev:serve-pod": "community-solid-server -c @css:config/file.json -p 4000 -f ./solid-data",',
51
+ '"dev:serve-pod": "community-solid-server -c @css:config/file.json -f ./solid",',
59
52
  )
60
53
  .replace(
61
- '"test:serve-app": "vite --port 5001"',
62
- '"test:serve-app": "vite --port 5001",\n' +
63
- '"test:serve-pod": "community-solid-server -p 4000 -l warn"',
54
+ '"test:serve-app": "vite --port 5001 --mode testing"',
55
+ '"test:serve-app": "vite --port 5001 --mode testing",\n' +
56
+ '"test:serve-pod": "community-solid-server -l warn"',
64
57
  ),
65
58
  );
66
59
 
@@ -72,7 +65,7 @@ export class Solid extends Plugin {
72
65
 
73
66
  const gitignore = File.read('.gitignore') ?? '';
74
67
 
75
- File.write('.gitignore', `${gitignore}/solid-data\n`);
68
+ File.write('.gitignore', `${gitignore}/solid\n`);
76
69
  }
77
70
 
78
71
  }
@@ -1,5 +1,5 @@
1
- import Plugin from '@/plugins/Plugin';
2
- import Shell from '@/lib/Shell';
1
+ import Plugin from '@aerogel/cli/plugins/Plugin';
2
+ import Shell from '@aerogel/cli/lib/Shell';
3
3
 
4
4
  export class Soukai extends Plugin {
5
5
 
@@ -7,12 +7,12 @@ export class Soukai extends Plugin {
7
7
  super('soukai');
8
8
  }
9
9
 
10
- protected async installNpmDependencies(): Promise<void> {
10
+ protected override async installNpmDependencies(): Promise<void> {
11
11
  await Shell.run('npm install soukai@next --save-exact');
12
12
  await super.installNpmDependencies();
13
13
  }
14
14
 
15
- protected getBootstrapConfig(): string {
15
+ protected override getBootstrapConfig(): string {
16
16
  return 'soukai({ models: import.meta.glob(\'@/models/*\', { eager: true }) })';
17
17
  }
18
18
 
@@ -1,31 +1,36 @@
1
- import { beforeEach, vi } from 'vitest';
2
- import { resolve } from 'path';
3
- import { setTestingNamespace } from '@noeldemartin/utils';
4
-
5
- import File from '@/lib/File';
6
- import FileMock from '@/lib/File.mock';
7
- import Log from '@/lib/Log';
8
- import LogMock from '@/lib/Log.mock';
9
- import Shell from '@/lib/Shell';
10
- import ShellMock from '@/lib/Shell.mock';
11
-
12
- setTestingNamespace(vi);
13
-
14
- File.setMockInstance(FileMock);
15
- Log.setMockInstance(LogMock);
16
- Shell.setMockInstance(ShellMock);
1
+ import { beforeAll, beforeEach, vi } from 'vitest';
2
+ import { resolve } from 'node:path';
3
+ import { setupFacadeMocks } from '@noeldemartin/testing';
4
+
5
+ import ShellMock from '@aerogel/cli/lib/Shell.mock';
6
+ import File from '@aerogel/cli/lib/File';
7
+ import FileMock from '@aerogel/cli/lib/File.mock';
8
+ import Log from '@aerogel/cli/lib/Log';
9
+ import LogMock from '@aerogel/cli/lib/Log.mock';
10
+ import Shell from '@aerogel/cli/lib/Shell';
11
+
12
+ beforeAll(() => {
13
+ File.setMockFacade(FileMock);
14
+ Log.setMockFacade(LogMock);
15
+ Shell.setMockFacade(ShellMock);
16
+ });
17
17
 
18
18
  beforeEach(() => {
19
- FileMock.reset();
20
- LogMock.reset();
21
-
22
19
  File.mock();
23
20
  Log.mock();
24
21
  Shell.mock();
25
22
  });
26
23
 
27
- vi.mock('@/lib/utils/app', async () => {
28
- const original = (await vi.importActual('@/lib/utils/app')) as object;
24
+ vi.mock('@noeldemartin/utils', async () => {
25
+ const original = (await vi.importActual('@noeldemartin/utils')) as object;
26
+
27
+ setupFacadeMocks();
28
+
29
+ return original;
30
+ });
31
+
32
+ vi.mock('@aerogel/cli/lib/utils/app', async () => {
33
+ const original = (await vi.importActual('@aerogel/cli/lib/utils/app')) as object;
29
34
 
30
35
  return {
31
36
  ...original,
@@ -34,8 +39,8 @@ vi.mock('@/lib/utils/app', async () => {
34
39
  };
35
40
  });
36
41
 
37
- vi.mock('@/lib/utils/edit', async () => {
38
- const original = (await vi.importActual('@/lib/utils/edit')) as object;
42
+ vi.mock('@aerogel/cli/lib/utils/edit', async () => {
43
+ const original = (await vi.importActual('@aerogel/cli/lib/utils/edit')) as object;
39
44
 
40
45
  return {
41
46
  ...original,
@@ -44,8 +49,8 @@ vi.mock('@/lib/utils/edit', async () => {
44
49
  });
45
50
 
46
51
  // TODO find out why these need to be mocked
47
- vi.mock('@/lib/utils/paths', async () => {
48
- const original = (await vi.importActual('@/lib/utils/paths')) as object;
52
+ vi.mock('@aerogel/cli/lib/utils/paths', async () => {
53
+ const original = (await vi.importActual('@aerogel/cli/lib/utils/paths')) as object;
49
54
 
50
55
  function basePath(path: string = '') {
51
56
  return resolve(__dirname, '../../', path);
@@ -66,9 +71,3 @@ vi.mock('@/lib/utils/paths', async () => {
66
71
  templatePath,
67
72
  };
68
73
  });
69
-
70
- vi.mock('mustache', async () => {
71
- const mustache = (await vi.importActual('mustache')) as { default: unknown };
72
-
73
- return mustache.default;
74
- });
@@ -6,8 +6,8 @@ jobs:
6
6
  ci:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
- - uses: actions/checkout@v3
10
- - uses: actions/setup-node@v3
9
+ - uses: actions/checkout@v4
10
+ - uses: actions/setup-node@v4
11
11
  with:
12
12
  node-version-file: '.nvmrc'
13
13
  - run: npm ci
@@ -16,13 +16,13 @@ jobs:
16
16
  - run: npm run test:ci
17
17
  - run: npm run cy:test-snapshots:ci
18
18
  - name: Upload Cypress screenshots
19
- uses: actions/upload-artifact@v3
19
+ uses: actions/upload-artifact@v4
20
20
  if: ${{ failure() }}
21
21
  with:
22
22
  name: cypress_screenshots
23
23
  path: cypress/screenshots
24
24
  - name: Upload Cypress snapshots
25
- uses: actions/upload-artifact@v3
25
+ uses: actions/upload-artifact@v4
26
26
  if: ${{ failure() }}
27
27
  with:
28
28
  name: cypress_snapshots
@@ -1 +1 @@
1
- lts/hydrogen
1
+ v22.9.0
@@ -3,6 +3,7 @@
3
3
  "configurations": [
4
4
  {
5
5
  "type": "node",
6
+ "runtimeVersion": "22.14.0",
6
7
  "request": "launch",
7
8
  "name": "Debug Current Test File",
8
9
  "autoAttachChildProcesses": true,
@@ -1,4 +1,4 @@
1
- import install from '@aerogel/cypress/dist/plugin';
1
+ import { setupAerogelNodeEvents } from '@aerogel/cypress/config';
2
2
  import { defineConfig } from 'cypress';
3
3
 
4
4
  export default defineConfig({
@@ -9,8 +9,6 @@ export default defineConfig({
9
9
  runMode: 3,
10
10
  openMode: 0,
11
11
  },
12
- setupNodeEvents(on) {
13
- install(on);
14
- },
12
+ setupNodeEvents: setupAerogelNodeEvents,
15
13
  },
16
14
  });
@@ -1,3 +1 @@
1
- import install from '@aerogel/cypress';
2
-
3
- install();
1
+ import '@aerogel/cypress/support';
@@ -1,12 +1,11 @@
1
1
  {
2
+ "extends": "@tsconfig/node22/tsconfig.json",
3
+ "include": ["**/*.ts"],
2
4
  "compilerOptions": {
3
- "target": "es5",
4
- "lib": ["es5", "dom"],
5
- "types": ["cypress", "node"],
6
5
  "baseUrl": ".",
7
- "paths": {
8
- "@cy/*": ["./*"]
9
- }
10
- },
11
- "include": ["**/*.ts"]
6
+ "module": "ESNext",
7
+ "moduleResolution": "Bundler",
8
+ "lib": ["DOM"],
9
+ "types": ["node", "cypress"]
10
+ }
12
11
  }
@@ -1,12 +1,12 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en" class="h-full w-full">
2
+ <html lang="en" class="size-full">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>{{ app.name }}</title>
7
7
  {{ socialMeta() }}
8
8
  </head>
9
- <body class="h-full w-full text-base font-normal leading-tight text-gray-900 antialiased">
9
+ <body class="size-full text-base font-normal leading-tight text-gray-900 antialiased">
10
10
  <div id="app" class="loading h-full"></div>
11
11
  <script type="module" src="./src/main.ts"></script>
12
12
  </body>
@@ -2,6 +2,7 @@
2
2
  "name": "<% app.slug %>",
3
3
  "version": "0.0.0",
4
4
  "private": true,
5
+ "type": "module",
5
6
  "scripts": {
6
7
  "build": "vite build",
7
8
  "cy:dev": "concurrently --kill-others \"npm run test:serve-app\" \"npm run cy:open\"",
@@ -11,23 +12,23 @@
11
12
  "cy:test-snapshots": "docker run -it -u `id -u ${whoami}` -e CYPRESS_SNAPSHOTS=true -v ./:/app -w /app cypress/base:18.16.0 sh -c \"npx cypress install && npm run cy:test\"",
12
13
  "cy:test-snapshots:ci": "docker run -e CYPRESS_SNAPSHOTS=true -v ./:/app -w /app cypress/base:18.16.0 sh -c \"npx cypress install && npm run cy:test\"",
13
14
  "dev": "vite",
14
- "lint": "noeldemartin-lint src",
15
+ "lint": "noeldemartin-lint src cypress",
15
16
  "test": "vitest --run",
16
17
  "test:ci": "vitest --run --reporter verbose",
17
- "test:serve-app": "vite --port 5001"
18
+ "test:serve-app": "vite --port 5001 --mode testing"
18
19
  },
19
20
  "dependencies": {
20
21
  "@aerogel/core": "<% &dependencies.aerogelCore %>",
21
22
  "@aerogel/plugin-i18n": "<% &dependencies.aerogelPluginI18n %>",
22
23
  "@aerogel/plugin-soukai": "<% &dependencies.aerogelPluginSoukai %>",
23
- "@intlify/unplugin-vue-i18n": "^0.12.2",
24
+ "@intlify/unplugin-vue-i18n": "^6.0.5",
24
25
  "@noeldemartin/utils": "next",
25
- "@tailwindcss/forms": "^0.5.3",
26
- "@tailwindcss/typography": "^0.5.9",
26
+ "@tailwindcss/forms": "^0.5.10",
27
+ "@tailwindcss/typography": "^0.5.16",
27
28
  "soukai": "next",
28
- "tailwindcss": "^3.3.2",
29
- "vue": "^3.3.0",
30
- "vue-i18n": "9.3.0-beta.19"
29
+ "tailwindcss": "^4.1.1",
30
+ "vue": "^3.5.13",
31
+ "vue-i18n": "^11.1.2"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@aerogel/cli": "<% &dependencies.aerogelCli %>",
@@ -37,20 +38,20 @@
37
38
  "@noeldemartin/eslint-config-vue": "next",
38
39
  "@noeldemartin/scripts": "next",
39
40
  "@total-typescript/ts-reset": "^0.4.2",
41
+ "@tsconfig/node22": "^22.0.1",
40
42
  "@types/node": "^20.3.1",
43
+ "@vue/tsconfig": "^0.7.0",
41
44
  "autoprefixer": "^10.4.14",
42
45
  "concurrently": "^8.2.0",
43
- "cypress": "^12.17.0",
44
- "eslint": "^8.40.0",
45
- "prettier": "^2.8.8",
46
- "prettier-eslint-cli": "^7.1.0",
47
- "prettier-plugin-tailwindcss": "^0.2.8",
46
+ "cypress": "^14.2.0",
47
+ "prettier-plugin-tailwindcss": "^0.6.11",
48
48
  "start-server-and-test": "^2.0.0",
49
+ "typescript": "^5.8.2",
49
50
  "unplugin-icons": "^0.16.3",
50
51
  "unplugin-vue-components": "^0.24.1",
51
- "vite": "^4.3.0",
52
- "vitest": "^0.33.0",
53
- "vue-tsc": "^1.8.15"
52
+ "vite": "^6.2.2",
53
+ "vitest": "^3.0.9",
54
+ "vue-tsc": "^2.2.8"
54
55
  },
55
56
  "eslintConfig": {
56
57
  "extends": [
@@ -58,9 +59,9 @@
58
59
  ]
59
60
  },
60
61
  "prettier": {
62
+ "printWidth": 120,
61
63
  "plugins": [
62
64
  "prettier-plugin-tailwindcss"
63
- ],
64
- "printWidth": 120
65
+ ]
65
66
  }
66
67
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <AGAppLayout class="bg-blue-50">
3
- <main class="flex flex-grow flex-col items-center justify-center">
3
+ <main class="flex grow flex-col items-center justify-center">
4
4
  <h1 class="text-4xl font-semibold">
5
5
  {{ $t('home.title') }}
6
6
  </h1>
@@ -0,0 +1,4 @@
1
+ @import 'tailwindcss';
2
+ @import '@aerogel/core';
3
+ @plugin '@tailwindcss/forms';
4
+ @plugin '@tailwindcss/typography';
@@ -2,12 +2,12 @@ import i18n from '@aerogel/plugin-i18n';
2
2
  import soukai from '@aerogel/plugin-soukai';
3
3
  import { bootstrap } from '@aerogel/core';
4
4
 
5
- import './assets/css/styles.css';
5
+ import './assets/css/main.css';
6
6
  import App from './App.vue';
7
7
 
8
8
  bootstrap(App, {
9
9
  plugins: [
10
10
  i18n({ messages: import.meta.glob('@/lang/*.yaml') }),
11
- soukai({ models: import.meta.glob('@/models/*', { eager: true }) }),
11
+ soukai({ models: import.meta.glob(['@/models/*', '!**/*.test.ts'], { eager: true }) }),
12
12
  ],
13
13
  });
@@ -1,16 +1,9 @@
1
1
  {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
2
3
  "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "strict": true,
7
- "jsx": "preserve",
8
- "noUncheckedIndexedAccess": true,
9
- "skipLibCheck": true,
10
- "resolveJsonModule": true,
11
- "esModuleInterop": true,
12
- "lib": ["esnext", "dom"],
13
4
  "baseUrl": ".",
5
+ "module": "ESNext",
6
+ "moduleResolution": "Bundler",
14
7
  "paths": {
15
8
  "@/*": ["./src/*"]
16
9
  }
@@ -1,20 +1,22 @@
1
+ import { URL, fileURLToPath } from 'node:url';
2
+
1
3
  import Aerogel, { AerogelResolver } from '@aerogel/vite';
2
4
  import Components from 'unplugin-vue-components/vite';
3
5
  import I18n from '@intlify/unplugin-vue-i18n/vite';
4
6
  import Icons from 'unplugin-icons/vite';
5
7
  import IconsResolver from 'unplugin-icons/resolver';
6
8
  import { defineConfig } from 'vitest/config';
7
- import { resolve } from 'path';
8
9
 
9
10
  export default defineConfig({
10
- publicDir: resolve(__dirname, './src/assets/public/'),
11
+ build: { sourcemap: true },
12
+ publicDir: fileURLToPath(new URL('./src/assets/public/', import.meta.url)),
11
13
  plugins: [
12
14
  Aerogel({ name: '<% app.name %>' }),
13
15
  Components({
14
16
  dts: false,
15
17
  resolvers: [AerogelResolver(), IconsResolver()],
16
18
  }),
17
- I18n({ include: resolve(__dirname, './src/lang/**/*.yaml') }),
19
+ I18n({ include: fileURLToPath(new URL('./src/lang/**/*.yaml', import.meta.url)) }),
18
20
  Icons({
19
21
  iconCustomizer(_, __, props) {
20
22
  props['aria-hidden'] = 'true';
@@ -23,7 +25,7 @@ export default defineConfig({
23
25
  ],
24
26
  resolve: {
25
27
  alias: {
26
- '@': resolve(__dirname, './src'),
28
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
27
29
  },
28
30
  },
29
31
  });
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <AGHeadlessButton :class="variantClasses" :disabled="disabled">
2
+ <HeadlessButton :class="variantClasses" :disabled="disabled">
3
3
  <slot />
4
- </AGHeadlessButton>
4
+ </HeadlessButton>
5
5
  </template>
6
6
 
7
7
  <script setup lang="ts">
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <AGHeadlessInput
3
+ ref="$input"
4
+ :name="name"
5
+ :class="className"
6
+ :label="label"
7
+ >
8
+ <AGHeadlessInputInput
9
+ v-bind="attrs"
10
+ type="checkbox"
11
+ />
12
+ <div v-if="$slots.default">
13
+ <AGHeadlessInputLabel>
14
+ <slot />
15
+ </AGHeadlessInputLabel>
16
+ <AGHeadlessInputError />
17
+ </div>
18
+ </AGHeadlessInput>
19
+ </template>
20
+
21
+ <script setup lang="ts">
22
+ import { AGHeadlessInputLabel, componentRef, stringProp, useInputAttrs } from '@aerogel/core';
23
+ import type { IAGHeadlessInput } from '@aerogel/core';
24
+
25
+ defineOptions({ inheritAttrs: false });
26
+ defineProps({
27
+ name: stringProp(),
28
+ label: stringProp(),
29
+ inputClass: stringProp(''),
30
+ });
31
+
32
+ const $input = componentRef<IAGHeadlessInput>();
33
+ const [attrs, className] = useInputAttrs();
34
+ </script>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <Story group="base" :layout="{ type: 'grid' }">
3
+ <Variant title="Playground">
4
+ <AGForm :form="form" class="m-1">
5
+ <<% component.name %> name="accept" :form="form">
6
+ {{ label }}
7
+ </<% component.name %>>
8
+ </AGForm>
9
+
10
+ <template #controls>
11
+ <HstText v-model="label" title="Label" />
12
+ </template>
13
+ </Variant>
14
+
15
+ <Variant title="Default">
16
+ <<% component.name %> class="m-1">
17
+ Accept Terms & Conditions
18
+ </<% component.name %>>
19
+ </Variant>
20
+
21
+ <Variant title="Hover">
22
+ <<% component.name %> class="m-1" input-class=":hover">
23
+ Accept Terms & Conditions
24
+ </<% component.name %>>
25
+ </Variant>
26
+
27
+ <Variant title="Focus">
28
+ <<% component.name %> class="m-1" input-class=":focus :focus-visible">
29
+ Accept Terms & Conditions
30
+ </<% component.name %>>
31
+ </Variant>
32
+
33
+ <Variant title="Error">
34
+ <AGForm :form="errorForm" class="m-1">
35
+ <<% component.name %> name="accept">
36
+ Accept Terms & Conditions
37
+ </<% component.name %>>
38
+ </AGForm>
39
+ </Variant>
40
+ </Story>
41
+ </template>
42
+
43
+ <script setup lang="ts">
44
+ import { requiredBooleanInput, useForm } from '@aerogel/core';
45
+ import { ref } from 'vue';
46
+
47
+ const form = useForm({ accept: requiredBooleanInput(true) });
48
+ const errorForm = useForm({ accept: requiredBooleanInput() });
49
+ const label = ref('Accept Terms & Conditions');
50
+
51
+ form.submit();
52
+ errorForm.submit();
53
+ </script>
54
+
55
+ <style>
56
+ .story-<% component.slug %> {
57
+ grid-template-columns: repeat(2, 300px) !important;
58
+ }
59
+
60
+ .story-<% component.slug %> .variant-playground {
61
+ grid-column: 1 / -1;
62
+ }
63
+ </style>