@aerogel/cli 0.0.0-next.47ed8ee3c048720794026e45140e9b700cb428b9 → 0.0.0-next.4b4da752b2ea1e9ee76a4d33a1e616bf87478f69

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 (84) hide show
  1. package/bin/gel +4 -0
  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 +27 -33
  6. package/src/cli.ts +30 -6
  7. package/src/commands/Command.ts +14 -9
  8. package/src/commands/create.test.ts +24 -7
  9. package/src/commands/create.ts +38 -20
  10. package/src/commands/generate-component.test.ts +62 -4
  11. package/src/commands/generate-component.ts +181 -28
  12. package/src/commands/generate-model.test.ts +8 -5
  13. package/src/commands/generate-model.ts +41 -24
  14. package/src/commands/generate-overrides.ts +85 -0
  15. package/src/commands/generate-service.test.ts +21 -0
  16. package/src/commands/generate-service.ts +151 -0
  17. package/src/commands/info.ts +15 -0
  18. package/src/commands/install.test.ts +27 -0
  19. package/src/commands/install.ts +32 -0
  20. package/src/lib/App.ts +71 -6
  21. package/src/lib/Editor.ts +57 -0
  22. package/src/lib/File.mock.ts +7 -11
  23. package/src/lib/File.ts +9 -3
  24. package/src/lib/Log.mock.ts +11 -6
  25. package/src/lib/Log.test.ts +22 -6
  26. package/src/lib/Log.ts +43 -27
  27. package/src/lib/Shell.mock.ts +3 -3
  28. package/src/lib/Shell.ts +2 -2
  29. package/src/lib/Template.ts +24 -17
  30. package/src/lib/utils/app.ts +15 -0
  31. package/src/lib/utils/edit.ts +44 -0
  32. package/src/lib/utils/paths.ts +42 -0
  33. package/src/plugins/Plugin.ts +159 -0
  34. package/src/plugins/Solid.ts +71 -0
  35. package/src/plugins/Soukai.ts +19 -0
  36. package/src/testing/setup.ts +56 -25
  37. package/templates/app/.github/workflows/ci.yml +16 -4
  38. package/templates/app/.nvmrc +1 -1
  39. package/templates/app/.vscode/launch.json +17 -0
  40. package/templates/app/.vscode/settings.json +10 -0
  41. package/templates/app/README.md +3 -0
  42. package/templates/app/cypress/cypress.config.ts +14 -0
  43. package/templates/app/cypress/support/e2e.ts +1 -3
  44. package/templates/app/cypress/tsconfig.json +7 -8
  45. package/templates/app/index.html +5 -4
  46. package/templates/app/package.json +44 -21
  47. package/templates/app/src/App.vue +5 -3
  48. package/templates/app/src/assets/css/main.css +4 -0
  49. package/templates/app/src/assets/public/robots.txt +2 -0
  50. package/templates/app/src/main.ts +8 -4
  51. package/templates/app/src/types/globals.d.ts +0 -1
  52. package/templates/app/tsconfig.json +3 -9
  53. package/templates/app/vite.config.ts +18 -8
  54. package/templates/component-button/[component.name].vue +42 -0
  55. package/templates/component-button-story/[component.name].story.vue +77 -0
  56. package/templates/component-checkbox/[component.name].vue +34 -0
  57. package/templates/component-checkbox-story/[component.name].story.vue +63 -0
  58. package/templates/component-input/[component.name].vue +17 -0
  59. package/templates/component-input-story/[component.name].story.vue +63 -0
  60. package/templates/overrides/components/index.ts +15 -0
  61. package/templates/overrides/components/overrides/AlertModal.vue +11 -0
  62. package/templates/overrides/components/overrides/ConfirmModal.vue +20 -0
  63. package/templates/overrides/components/overrides/ErrorReportModal.vue +35 -0
  64. package/templates/overrides/components/overrides/LoadingModal.vue +12 -0
  65. package/templates/overrides/components/overrides/ModalWrapper.vue +22 -0
  66. package/templates/overrides/components/overrides/SnackbarNotification.vue +34 -0
  67. package/templates/overrides-story/Overrides.story.vue +86 -0
  68. package/templates/service/[service.name].ts +8 -0
  69. package/.eslintrc.js +0 -7
  70. package/bin/ag +0 -4
  71. package/dist/aerogel-cli.cjs.js +0 -2
  72. package/dist/aerogel-cli.cjs.js.map +0 -1
  73. package/dist/aerogel-cli.esm.js +0 -2
  74. package/dist/aerogel-cli.esm.js.map +0 -1
  75. package/noeldemartin.config.js +0 -4
  76. package/src/lib/utils.test.ts +0 -33
  77. package/src/lib/utils.ts +0 -44
  78. package/templates/app/cypress.config.ts +0 -8
  79. package/templates/app/postcss.config.js +0 -6
  80. package/templates/app/src/assets/styles.css +0 -3
  81. package/templates/app/tailwind.config.js +0 -5
  82. package/tsconfig.json +0 -11
  83. package/vite.config.ts +0 -14
  84. /package/src/{main.ts → index.ts} +0 -0
@@ -0,0 +1,42 @@
1
+ import { URL, fileURLToPath } from 'node:url';
2
+ import { stringMatch } from '@noeldemartin/utils';
3
+ import { resolve } from 'node:path';
4
+
5
+ import File from '@aerogel/cli/lib/File';
6
+ import Log from '@aerogel/cli/lib/Log';
7
+
8
+ export function basePath(path: string = ''): string {
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);
16
+ }
17
+
18
+ const packageJson = File.read(
19
+ fileURLToPath(new URL(/* @vite-ignore */ '../../../../package.json', import.meta.url)),
20
+ );
21
+ const matches = stringMatch<2>(packageJson ?? '', /"@aerogel\/core": "file:(.*)\/aerogel-core-[\d.]*\.tgz"/);
22
+ const cliPath = matches?.[1] ?? Log.fail<string>('Could not determine base path');
23
+
24
+ return resolve(cliPath, path);
25
+ }
26
+
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ export function packNotFound(packageName: string): any {
29
+ return Log.fail(`Could not find ${packageName} pack file, did you run 'npm pack'?`);
30
+ }
31
+
32
+ export function packagePackPath(packageName: string): string | null {
33
+ return File.getFiles(packagePath(packageName)).find((file) => file.endsWith('.tgz')) ?? null;
34
+ }
35
+
36
+ export function packagePath(packageName: string): string {
37
+ return basePath(`../${packageName}`);
38
+ }
39
+
40
+ export function templatePath(name: string): string {
41
+ return fileURLToPath(new URL(/* @vite-ignore */ `../templates/${name}`, import.meta.url));
42
+ }
@@ -0,0 +1,159 @@
1
+ import { Node, SyntaxKind } from 'ts-morph';
2
+ import type { ArrayLiteralExpression, ImportDeclarationStructure, OptionalKind, SourceFile } from 'ts-morph';
3
+
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
+
12
+ export default abstract class Plugin {
13
+
14
+ public readonly name: string;
15
+
16
+ constructor(name: string) {
17
+ this.name = name;
18
+ }
19
+
20
+ public async install(): Promise<void> {
21
+ this.assertNotInstalled();
22
+
23
+ await this.beforeInstall();
24
+ await this.installDependencies();
25
+
26
+ if (editFiles()) {
27
+ const editor = app().edit();
28
+
29
+ await this.updateFiles(editor);
30
+ await editor.format();
31
+ }
32
+
33
+ await this.afterInstall();
34
+
35
+ Log.info(`Plugin ${this.name} installed!`);
36
+ }
37
+
38
+ protected assertNotInstalled(): void {
39
+ if (File.contains('package.json', `"${this.getNpmPackageName()}"`)) {
40
+ Log.fail(`${this.name} is already installed!`);
41
+ }
42
+ }
43
+
44
+ protected async beforeInstall(): Promise<void> {
45
+ // Placeholder for overrides, don't place any functionality here.
46
+ }
47
+
48
+ protected async afterInstall(): Promise<void> {
49
+ // Placeholder for overrides, don't place any functionality here.
50
+ }
51
+
52
+ protected async installDependencies(): Promise<void> {
53
+ await Log.animate('Installing plugin dependencies', async () => {
54
+ await this.installNpmDependencies();
55
+ });
56
+ }
57
+
58
+ protected async updateFiles(editor: Editor): Promise<void> {
59
+ if (!this.isForDevelopment()) {
60
+ await this.updateBootstrapConfig(editor);
61
+ }
62
+ }
63
+
64
+ protected async installNpmDependencies(): Promise<void> {
65
+ const flags = this.isForDevelopment() ? '--save-dev' : '';
66
+
67
+ if (isLinkedLocalApp()) {
68
+ await Shell.run(`npm install file:${packagePath(this.getLocalPackageName())} ${flags}`);
69
+
70
+ return;
71
+ }
72
+
73
+ if (isLocalApp()) {
74
+ const packPath = packagePackPath(this.getLocalPackageName()) ?? packNotFound(this.getLocalPackageName());
75
+
76
+ await Shell.run(`npm install file:${packPath} ${flags}`);
77
+
78
+ return;
79
+ }
80
+
81
+ await Shell.run(`npm install ${this.getNpmPackageName()}@next --save-exact ${flags}`);
82
+ }
83
+
84
+ protected async updateBootstrapConfig(editor: Editor): Promise<void> {
85
+ await Log.animate('Injecting plugin in bootstrap configuration', async () => {
86
+ const mainConfig = editor.requireSourceFile('src/main.ts');
87
+ const pluginsArray = this.getBootstrapPluginsDeclaration(mainConfig);
88
+
89
+ if (!pluginsArray) {
90
+ return Log.fail(`
91
+ Could not find plugins array in bootstrap config, please add the following manually:
92
+
93
+ ${this.getBootstrapConfig()}
94
+ `);
95
+ }
96
+
97
+ mainConfig.addImportDeclaration(this.getBootstrapImport());
98
+ pluginsArray.addElement(this.getBootstrapConfig());
99
+
100
+ await editor.save(mainConfig);
101
+ });
102
+ }
103
+
104
+ protected getBootstrapPluginsDeclaration(mainConfig: SourceFile): ArrayLiteralExpression | null {
105
+ const bootstrapAppCall = findDescendant(mainConfig, {
106
+ guard: Node.isCallExpression,
107
+ validate: (callExpression) => callExpression.getExpression().getText() === 'bootstrap',
108
+ skip: SyntaxKind.ImportDeclaration,
109
+ });
110
+ const bootstrapOptions = bootstrapAppCall?.getArguments()[1];
111
+ const pluginsOption = when(bootstrapOptions, Node.isObjectLiteralExpression)?.getProperty('plugins');
112
+ const pluginsArray = when(pluginsOption, Node.isPropertyAssignment)?.getInitializer();
113
+
114
+ if (!Node.isArrayLiteralExpression(pluginsArray)) {
115
+ return null;
116
+ }
117
+
118
+ return pluginsArray;
119
+ }
120
+
121
+ protected getTailwindContentArray(tailwindConfig: SourceFile): ArrayLiteralExpression | null {
122
+ const contentAssignment = findDescendant(tailwindConfig, {
123
+ guard: Node.isPropertyAssignment,
124
+ validate: (propertyAssignment) => propertyAssignment.getName() === 'content',
125
+ skip: SyntaxKind.JSDoc,
126
+ });
127
+ const contentArray = contentAssignment?.getInitializer();
128
+
129
+ if (!Node.isArrayLiteralExpression(contentArray)) {
130
+ return null;
131
+ }
132
+
133
+ return contentArray;
134
+ }
135
+
136
+ protected getBootstrapImport(): OptionalKind<ImportDeclarationStructure> {
137
+ return {
138
+ defaultImport: this.name,
139
+ moduleSpecifier: `@aerogel/plugin-${this.name}`,
140
+ };
141
+ }
142
+
143
+ protected getNpmPackageName(): string {
144
+ return `@aerogel/${this.getLocalPackageName()}`;
145
+ }
146
+
147
+ protected getLocalPackageName(): string {
148
+ return `plugin-${this.name}`;
149
+ }
150
+
151
+ protected isForDevelopment(): boolean {
152
+ return false;
153
+ }
154
+
155
+ protected getBootstrapConfig(): string {
156
+ return `${this.name}()`;
157
+ }
158
+
159
+ }
@@ -0,0 +1,71 @@
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';
6
+
7
+ export class Solid extends Plugin {
8
+
9
+ constructor() {
10
+ super('solid');
11
+ }
12
+
13
+ protected override async updateFiles(editor: Editor): Promise<void> {
14
+ await this.updateNpmScripts(editor);
15
+ await this.updateGitIgnore();
16
+ await super.updateFiles(editor);
17
+ }
18
+
19
+ protected override async installNpmDependencies(): Promise<void> {
20
+ await Shell.run('npm install soukai-solid@next --save-exact');
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');
23
+ await super.installNpmDependencies();
24
+ }
25
+
26
+ protected async updateNpmScripts(editor: Editor): Promise<void> {
27
+ Log.info('Updating npm scripts...');
28
+
29
+ const packageJson = File.read('package.json');
30
+
31
+ if (!packageJson) {
32
+ return Log.fail('Could not find package.json file');
33
+ }
34
+
35
+ File.write(
36
+ 'package.json',
37
+ packageJson
38
+ .replace(
39
+ '"cy:dev": "concurrently --kill-others \\"npm run test:serve-app\\" \\"npm run cy:open\\"",',
40
+ '"cy:dev": "concurrently --kill-others ' +
41
+ '\\"npm run test:serve-app\\" \\"npm run test:serve-pod\\" \\"npm run cy:open\\"",',
42
+ )
43
+ .replace(
44
+ '"cy:test": "start-server-and-test test:serve-app http-get://localhost:5001 cy:run",',
45
+ '"cy:test": "start-server-and-test ' +
46
+ 'test:serve-app http-get://localhost:5001 test:serve-pod http-get://localhost:3000 cy:run",',
47
+ )
48
+ .replace(
49
+ '"dev": "vite",',
50
+ '"dev": "vite",\n' +
51
+ '"dev:serve-pod": "community-solid-server -c @css:config/file.json -f ./solid",',
52
+ )
53
+ .replace(
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"',
57
+ ),
58
+ );
59
+
60
+ editor.addModifiedFile('package.json');
61
+ }
62
+
63
+ protected async updateGitIgnore(): Promise<void> {
64
+ Log.info('Updating .gitignore');
65
+
66
+ const gitignore = File.read('.gitignore') ?? '';
67
+
68
+ File.write('.gitignore', `${gitignore}/solid\n`);
69
+ }
70
+
71
+ }
@@ -0,0 +1,19 @@
1
+ import Plugin from '@aerogel/cli/plugins/Plugin';
2
+ import Shell from '@aerogel/cli/lib/Shell';
3
+
4
+ export class Soukai extends Plugin {
5
+
6
+ constructor() {
7
+ super('soukai');
8
+ }
9
+
10
+ protected override async installNpmDependencies(): Promise<void> {
11
+ await Shell.run('npm install soukai@next --save-exact');
12
+ await super.installNpmDependencies();
13
+ }
14
+
15
+ protected override getBootstrapConfig(): string {
16
+ return 'soukai({ models: import.meta.glob(\'@/models/*\', { eager: true }) })';
17
+ }
18
+
19
+ }
@@ -1,42 +1,73 @@
1
- import { beforeEach, vi } from 'vitest';
2
- import { resolve } from 'path';
3
- import { setTestingNamespace } from '@noeldemartin/utils';
1
+ import { beforeAll, beforeEach, vi } from 'vitest';
2
+ import { resolve } from 'node:path';
3
+ import { setupFacadeMocks } from '@noeldemartin/testing';
4
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';
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
11
 
12
- setTestingNamespace(vi);
13
-
14
- File.setMockInstance(FileMock);
15
- Log.setMockInstance(LogMock);
16
- Shell.setMockInstance(ShellMock);
12
+ beforeAll(() => {
13
+ File.setMockFacade(FileMock);
14
+ Log.setMockFacade(LogMock);
15
+ Shell.setMockFacade(ShellMock);
16
+ });
17
17
 
18
18
  beforeEach(() => {
19
- FileMock.reset();
20
19
  File.mock();
21
20
  Log.mock();
22
21
  Shell.mock();
23
22
  });
24
23
 
25
- // TODO find out why these need to be mocked
24
+ vi.mock('@noeldemartin/utils', async () => {
25
+ const original = (await vi.importActual('@noeldemartin/utils')) as object;
26
26
 
27
- vi.mock('@/lib/utils', async () => {
28
- const utils = (await vi.importActual('@/lib/utils')) as object;
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
- ...utils,
32
- basePath(path: string) {
33
- return resolve(__dirname, '../../', path);
34
- },
36
+ ...original,
37
+ isLocalApp: () => false,
38
+ isLinkedLocalApp: () => false,
35
39
  };
36
40
  });
37
41
 
38
- vi.mock('mustache', async () => {
39
- const mustache = (await vi.importActual('mustache')) as { default: unknown };
42
+ vi.mock('@aerogel/cli/lib/utils/edit', async () => {
43
+ const original = (await vi.importActual('@aerogel/cli/lib/utils/edit')) as object;
40
44
 
41
- return mustache.default;
45
+ return {
46
+ ...original,
47
+ editFiles: () => false,
48
+ };
49
+ });
50
+
51
+ // TODO find out why these need to be mocked
52
+ vi.mock('@aerogel/cli/lib/utils/paths', async () => {
53
+ const original = (await vi.importActual('@aerogel/cli/lib/utils/paths')) as object;
54
+
55
+ function basePath(path: string = '') {
56
+ return resolve(__dirname, '../../', path);
57
+ }
58
+
59
+ function packagePath(packageName: string) {
60
+ return basePath(`../${packageName}`);
61
+ }
62
+
63
+ function templatePath(name: string = '') {
64
+ return resolve(__dirname, `../../templates/${name}`);
65
+ }
66
+
67
+ return {
68
+ ...original,
69
+ basePath,
70
+ packagePath,
71
+ templatePath,
72
+ };
42
73
  });
@@ -6,12 +6,24 @@ 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
14
14
  - run: npm run lint
15
- - run: npm run test:ci
16
- - run: npm run cy:test
17
15
  - run: npm run build
16
+ - run: npm run test:ci
17
+ - run: npm run cy:test-snapshots:ci
18
+ - name: Upload Cypress screenshots
19
+ uses: actions/upload-artifact@v4
20
+ if: ${{ failure() }}
21
+ with:
22
+ name: cypress_screenshots
23
+ path: cypress/screenshots
24
+ - name: Upload Cypress snapshots
25
+ uses: actions/upload-artifact@v4
26
+ if: ${{ failure() }}
27
+ with:
28
+ name: cypress_snapshots
29
+ path: cypress/snapshots
@@ -1 +1 @@
1
- lts/hydrogen
1
+ v22.9.0
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "type": "node",
6
+ "runtimeVersion": "22.14.0",
7
+ "request": "launch",
8
+ "name": "Debug Current Test File",
9
+ "autoAttachChildProcesses": true,
10
+ "skipFiles": ["<node_internals>/**", "**/node_modules/**"],
11
+ "program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
12
+ "args": ["run", "${fileBasenameNoExtension}"],
13
+ "smartStep": true,
14
+ "console": "integratedTerminal"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "emeraldwalk.runonsave": {
3
+ "commands": [
4
+ {
5
+ "match": ".*",
6
+ "cmd": "npx prettier-eslint ${file} --write"
7
+ }
8
+ ]
9
+ }
10
+ }
@@ -0,0 +1,3 @@
1
+ # <% app.name %>
2
+
3
+ App created with [AerogelJS](https://aerogel.js.org)
@@ -0,0 +1,14 @@
1
+ import { setupAerogelNodeEvents } from '@aerogel/cypress/config';
2
+ import { defineConfig } from 'cypress';
3
+
4
+ export default defineConfig({
5
+ e2e: {
6
+ baseUrl: 'http://localhost:5001',
7
+ video: false,
8
+ retries: {
9
+ runMode: 3,
10
+ openMode: 0,
11
+ },
12
+ setupNodeEvents: setupAerogelNodeEvents,
13
+ },
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,13 @@
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
- <title><% app.name %></title>
6
+ <title>{{ app.name }}</title>
7
+ {{ socialMeta() }}
7
8
  </head>
8
- <body class="h-full w-full">
9
- <div id="app" class="h-full"></div>
9
+ <body class="size-full text-base font-normal leading-tight text-gray-900 antialiased">
10
+ <div id="app" class="loading h-full"></div>
10
11
  <script type="module" src="./src/main.ts"></script>
11
12
  </body>
12
13
  </html>
@@ -2,43 +2,66 @@
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\"",
8
- "cy:open": "cypress open --e2e --browser chromium",
9
- "cy:run": "cypress run",
9
+ "cy:open": "cypress open --config-file ./cypress/cypress.config.ts --e2e --browser chromium",
10
+ "cy:run": "cypress run --config-file ./cypress/cypress.config.ts",
10
11
  "cy:test": "start-server-and-test test:serve-app http-get://localhost:5001 cy:run",
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\"",
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\"",
11
14
  "dev": "vite",
12
- "lint": "noeldemartin-lint src",
15
+ "lint": "noeldemartin-lint src cypress",
13
16
  "test": "vitest --run",
14
17
  "test:ci": "vitest --run --reporter verbose",
15
- "test:serve-app": "vite --port 5001"
18
+ "test:serve-app": "vite --port 5001 --mode testing"
16
19
  },
17
20
  "dependencies": {
18
- "@aerogel/core": "next",
19
- "@aerogel/plugin-i18n": "next",
20
- "@intlify/unplugin-vue-i18n": "^0.12.2",
21
- "@tailwindcss/forms": "^0.5.3",
22
- "@tailwindcss/typography": "^0.5.9",
23
- "soukai": "^0.5.1",
24
- "tailwindcss": "^3.3.2",
25
- "vue": "^3.3.0",
26
- "vue-i18n": "9.3.0-beta.19",
27
- "vue-router": "^4.2.1"
21
+ "@aerogel/core": "<% &dependencies.aerogelCore %>",
22
+ "@aerogel/plugin-i18n": "<% &dependencies.aerogelPluginI18n %>",
23
+ "@aerogel/plugin-soukai": "<% &dependencies.aerogelPluginSoukai %>",
24
+ "@intlify/unplugin-vue-i18n": "^6.0.5",
25
+ "@noeldemartin/utils": "next",
26
+ "@tailwindcss/forms": "^0.5.10",
27
+ "@tailwindcss/typography": "^0.5.16",
28
+ "soukai": "next",
29
+ "tailwindcss": "^4.1.1",
30
+ "vue": "^3.5.13",
31
+ "vue-i18n": "^11.1.2"
28
32
  },
29
33
  "devDependencies": {
30
- "@aerogel/cli": "next",
31
- "@aerogel/cypress": "next",
32
- "@aerogel/vite": "next",
33
- "@noeldemartin/utils": "0.4.0-next.ac00beaecf32bb02ed8e335225d7948d946d73bd",
34
+ "@aerogel/cli": "<% &dependencies.aerogelCli %>",
35
+ "@aerogel/cypress": "<% &dependencies.aerogelCypress %>",
36
+ "@aerogel/vite": "<% &dependencies.aerogelVite %>",
37
+ "@iconify/json": "^2.2.134",
38
+ "@noeldemartin/eslint-config-vue": "next",
39
+ "@noeldemartin/scripts": "next",
34
40
  "@total-typescript/ts-reset": "^0.4.2",
41
+ "@tsconfig/node22": "^22.0.1",
35
42
  "@types/node": "^20.3.1",
43
+ "@vue/tsconfig": "^0.7.0",
36
44
  "autoprefixer": "^10.4.14",
37
45
  "concurrently": "^8.2.0",
38
- "cypress": "^12.17.0",
46
+ "cypress": "^14.2.0",
47
+ "prettier-plugin-tailwindcss": "^0.6.11",
39
48
  "start-server-and-test": "^2.0.0",
49
+ "typescript": "^5.8.2",
50
+ "unplugin-icons": "^0.16.3",
40
51
  "unplugin-vue-components": "^0.24.1",
41
- "vite": "^4.3.0",
42
- "vitest": "^0.33.0"
52
+ "vite": "^6.2.2",
53
+ "vitest": "^3.0.9",
54
+ "vue-tsc": "^2.2.8"
55
+ },
56
+ "eslintConfig": {
57
+ "extends": [
58
+ "@noeldemartin/eslint-config-vue"
59
+ ]
60
+ },
61
+ "prettier": {
62
+ "printWidth": 120,
63
+ "plugins": [
64
+ "prettier-plugin-tailwindcss"
65
+ ]
43
66
  }
44
67
  }
@@ -1,7 +1,9 @@
1
1
  <template>
2
- <AGAppLayout>
3
- <main class="flex flex-grow flex-col items-center justify-center bg-blue-50">
4
- <h1 class="text-4xl font-semibold">{{ $t('home.title') }}</h1>
2
+ <AGAppLayout class="bg-blue-50">
3
+ <main class="flex grow flex-col items-center justify-center">
4
+ <h1 class="text-4xl font-semibold">
5
+ {{ $t('home.title') }}
6
+ </h1>
5
7
  <a href="https://aerogel.js.org" target="_blank" class="mt-2 underline opacity-75 hover:opacity-100">
6
8
  {{ $t('home.getStarted') }}
7
9
  </a>
@@ -0,0 +1,4 @@
1
+ @import 'tailwindcss';
2
+ @plugin '@tailwindcss/forms';
3
+ @plugin '@tailwindcss/typography';
4
+ @source '../../../node_modules/@aerogel/core';
@@ -0,0 +1,2 @@
1
+ User-agent: *
2
+ Disallow:
@@ -1,9 +1,13 @@
1
1
  import i18n from '@aerogel/plugin-i18n';
2
- import { bootstrapApplication } from '@aerogel/core';
2
+ import soukai from '@aerogel/plugin-soukai';
3
+ import { bootstrap } from '@aerogel/core';
3
4
 
4
- import './assets/styles.css';
5
+ import './assets/css/main.css';
5
6
  import App from './App.vue';
6
7
 
7
- bootstrapApplication(App, {
8
- plugins: [i18n({ messages: import.meta.glob('@/lang/*.yaml') })],
8
+ bootstrap(App, {
9
+ plugins: [
10
+ i18n({ messages: import.meta.glob('@/lang/*.yaml') }),
11
+ soukai({ models: import.meta.glob(['@/models/*', '!**/*.test.ts'], { eager: true }) }),
12
+ ],
9
13
  });
@@ -1,3 +1,2 @@
1
1
  /// <reference types="vite/client" />
2
- /// <reference types="vue-router" />
3
2
  /// <reference types="vue-i18n" />