@aerogel/cli 0.0.0-next.59bf5f7cc06e728d0cf6c00de28f1da48d7d6b8e → 0.0.0-next.60462e474474f4e52d52d457f9150df63c117214
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.
- package/bin/gel +4 -0
- package/dist/aerogel-cli.d.ts +2 -2
- package/dist/aerogel-cli.js +793 -0
- package/dist/aerogel-cli.js.map +1 -0
- package/package.json +27 -33
- package/src/cli.ts +28 -6
- package/src/commands/Command.ts +14 -9
- package/src/commands/create.test.ts +14 -6
- package/src/commands/create.ts +25 -14
- package/src/commands/generate-component.test.ts +51 -4
- package/src/commands/generate-component.ts +167 -26
- package/src/commands/generate-model.test.ts +3 -3
- package/src/commands/generate-model.ts +24 -27
- package/src/commands/generate-service.test.ts +21 -0
- package/src/commands/generate-service.ts +151 -0
- package/src/commands/info.ts +15 -0
- package/src/commands/install.test.ts +27 -0
- package/src/commands/install.ts +32 -0
- package/src/lib/App.ts +67 -9
- package/src/lib/Editor.ts +57 -0
- package/src/lib/File.mock.ts +7 -11
- package/src/lib/File.ts +9 -3
- package/src/lib/Log.mock.ts +5 -8
- package/src/lib/Log.test.ts +4 -4
- package/src/lib/Log.ts +13 -11
- package/src/lib/Shell.mock.ts +3 -3
- package/src/lib/Shell.ts +2 -2
- package/src/lib/Template.ts +24 -17
- package/src/lib/utils/app.ts +15 -0
- package/src/lib/utils/edit.ts +44 -0
- package/src/lib/utils/paths.ts +42 -0
- package/src/plugins/Plugin.ts +159 -0
- package/src/plugins/Solid.ts +71 -0
- package/src/plugins/Soukai.ts +19 -0
- package/src/testing/setup.ts +56 -27
- package/templates/app/.github/workflows/ci.yml +16 -4
- package/templates/app/.nvmrc +1 -1
- package/templates/app/.vscode/launch.json +17 -0
- package/templates/app/.vscode/settings.json +10 -0
- package/templates/app/README.md +3 -0
- package/templates/app/cypress/cypress.config.ts +14 -0
- package/templates/app/cypress/support/e2e.ts +1 -3
- package/templates/app/cypress/tsconfig.json +7 -8
- package/templates/app/index.html +5 -4
- package/templates/app/package.json +42 -19
- package/templates/app/src/App.vue +6 -4
- package/templates/app/src/assets/css/main.css +4 -0
- package/templates/app/src/assets/public/robots.txt +2 -0
- package/templates/app/src/main.ts +4 -4
- package/templates/app/src/types/globals.d.ts +0 -1
- package/templates/app/tsconfig.json +3 -9
- package/templates/app/vite.config.ts +15 -8
- package/templates/component-button/[component.name].vue +42 -0
- package/templates/component-button-story/[component.name].story.vue +77 -0
- package/templates/component-checkbox/[component.name].vue +34 -0
- package/templates/component-checkbox-story/[component.name].story.vue +63 -0
- package/templates/component-input/[component.name].vue +17 -0
- package/templates/component-input-story/[component.name].story.vue +63 -0
- package/templates/service/[service.name].ts +8 -0
- package/.eslintrc.js +0 -7
- package/bin/ag +0 -4
- package/dist/aerogel-cli.cjs.js +0 -2
- package/dist/aerogel-cli.cjs.js.map +0 -1
- package/dist/aerogel-cli.esm.js +0 -2
- package/dist/aerogel-cli.esm.js.map +0 -1
- package/noeldemartin.config.js +0 -4
- package/src/lib/utils.test.ts +0 -33
- package/src/lib/utils.ts +0 -44
- package/templates/app/cypress.config.ts +0 -8
- package/templates/app/postcss.config.js +0 -6
- package/templates/app/src/assets/styles.css +0 -3
- package/templates/app/tailwind.config.js +0 -5
- package/tsconfig.json +0 -11
- package/vite.config.ts +0 -14
- /package/src/{main.ts → index.ts} +0 -0
|
@@ -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
|
+
}
|
package/src/testing/setup.ts
CHANGED
|
@@ -1,44 +1,73 @@
|
|
|
1
|
-
import { beforeEach, vi } from 'vitest';
|
|
2
|
-
import { resolve } from 'path';
|
|
3
|
-
import {
|
|
1
|
+
import { beforeAll, beforeEach, vi } from 'vitest';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { setupFacadeMocks } from '@noeldemartin/testing';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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;
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
...original,
|
|
37
|
+
isLocalApp: () => false,
|
|
38
|
+
isLinkedLocalApp: () => false,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
28
41
|
|
|
29
|
-
vi.mock('
|
|
30
|
-
const
|
|
42
|
+
vi.mock('@aerogel/cli/lib/utils/edit', async () => {
|
|
43
|
+
const original = (await vi.importActual('@aerogel/cli/lib/utils/edit')) as object;
|
|
31
44
|
|
|
32
45
|
return {
|
|
33
|
-
...
|
|
34
|
-
|
|
35
|
-
return resolve(__dirname, '../../', path);
|
|
36
|
-
},
|
|
46
|
+
...original,
|
|
47
|
+
editFiles: () => false,
|
|
37
48
|
};
|
|
38
49
|
});
|
|
39
50
|
|
|
40
|
-
|
|
41
|
-
|
|
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
|
+
}
|
|
42
58
|
|
|
43
|
-
|
|
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
|
+
};
|
|
44
73
|
});
|
|
@@ -6,12 +6,24 @@ jobs:
|
|
|
6
6
|
ci:
|
|
7
7
|
runs-on: ubuntu-latest
|
|
8
8
|
steps:
|
|
9
|
-
- uses: actions/checkout@
|
|
10
|
-
- uses: actions/setup-node@
|
|
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
|
package/templates/app/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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,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,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
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "Bundler",
|
|
8
|
+
"lib": ["DOM"],
|
|
9
|
+
"types": ["node", "cypress"]
|
|
10
|
+
}
|
|
12
11
|
}
|
package/templates/app/index.html
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" class="
|
|
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
|
|
6
|
+
<title>{{ app.name }}</title>
|
|
7
|
+
{{ socialMeta() }}
|
|
7
8
|
</head>
|
|
8
|
-
<body class="
|
|
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": "<%
|
|
19
|
-
"@aerogel/plugin-i18n": "<%
|
|
20
|
-
"@aerogel/plugin-soukai": "<%
|
|
21
|
-
"@intlify/unplugin-vue-i18n": "^0.
|
|
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",
|
|
22
25
|
"@noeldemartin/utils": "next",
|
|
23
|
-
"@tailwindcss/forms": "^0.5.
|
|
24
|
-
"@tailwindcss/typography": "^0.5.
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"vue
|
|
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": "<%
|
|
31
|
-
"@aerogel/cypress": "<%
|
|
32
|
-
"@aerogel/vite": "<%
|
|
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",
|
|
33
40
|
"@total-typescript/ts-reset": "^0.4.2",
|
|
41
|
+
"@tsconfig/node22": "^22.0.1",
|
|
34
42
|
"@types/node": "^20.3.1",
|
|
43
|
+
"@vue/tsconfig": "^0.7.0",
|
|
35
44
|
"autoprefixer": "^10.4.14",
|
|
36
45
|
"concurrently": "^8.2.0",
|
|
37
|
-
"cypress": "^
|
|
46
|
+
"cypress": "^14.2.0",
|
|
47
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
38
48
|
"start-server-and-test": "^2.0.0",
|
|
49
|
+
"typescript": "^5.8.2",
|
|
39
50
|
"unplugin-icons": "^0.16.3",
|
|
40
51
|
"unplugin-vue-components": "^0.24.1",
|
|
41
|
-
"vite": "^
|
|
42
|
-
"vitest": "^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,10 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<main class="flex
|
|
4
|
-
<h1 class="text-4xl font-semibold">
|
|
2
|
+
<AppLayout 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>
|
|
8
10
|
</main>
|
|
9
|
-
</
|
|
11
|
+
</AppLayout>
|
|
10
12
|
</template>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import i18n from '@aerogel/plugin-i18n';
|
|
2
2
|
import soukai from '@aerogel/plugin-soukai';
|
|
3
|
-
import {
|
|
3
|
+
import { bootstrap } from '@aerogel/core';
|
|
4
4
|
|
|
5
|
-
import './assets/
|
|
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,15 +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
|
-
"resolveJsonModule": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"lib": ["esnext", "dom"],
|
|
12
4
|
"baseUrl": ".",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "Bundler",
|
|
13
7
|
"paths": {
|
|
14
8
|
"@/*": ["./src/*"]
|
|
15
9
|
}
|