@aerogel/cli 0.0.0-next.926bde19326fe7b6b24b277666936862b64d8295 → 0.0.0-next.a5b6ecb68fdca29d00c8b8906d00aa5bf64a9d7c

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 (64) hide show
  1. package/dist/aerogel-cli.cjs.js +1 -1
  2. package/dist/aerogel-cli.cjs.js.map +1 -1
  3. package/dist/aerogel-cli.esm.js +1 -1
  4. package/dist/aerogel-cli.esm.js.map +1 -1
  5. package/package.json +12 -5
  6. package/src/cli.ts +4 -0
  7. package/src/commands/Command.ts +15 -7
  8. package/src/commands/create.test.ts +32 -7
  9. package/src/commands/create.ts +25 -8
  10. package/src/commands/generate-component.test.ts +70 -6
  11. package/src/commands/generate-component.ts +165 -23
  12. package/src/commands/generate-model.test.ts +17 -6
  13. package/src/commands/generate-model.ts +34 -25
  14. package/src/commands/generate-service.test.ts +29 -0
  15. package/src/commands/generate-service.ts +151 -0
  16. package/src/commands/install.test.ts +49 -0
  17. package/src/commands/install.ts +33 -0
  18. package/src/lib/App.ts +65 -3
  19. package/src/lib/Editor.ts +58 -0
  20. package/src/lib/File.ts +6 -0
  21. package/src/lib/Log.mock.ts +2 -1
  22. package/src/lib/Log.ts +6 -4
  23. package/src/lib/Shell.mock.ts +1 -1
  24. package/src/lib/Template.ts +5 -1
  25. package/src/lib/utils/app.ts +15 -0
  26. package/src/lib/utils/edit.ts +44 -0
  27. package/src/lib/utils/paths.ts +34 -0
  28. package/src/plugins/Histoire.ts +105 -0
  29. package/src/plugins/Plugin.ts +178 -0
  30. package/src/plugins/Solid.ts +78 -0
  31. package/src/plugins/Soukai.ts +19 -0
  32. package/src/testing/setup.ts +36 -6
  33. package/src/testing/stubs/ProgramStub.ts +35 -0
  34. package/src/testing/utils.ts +14 -0
  35. package/templates/app/.github/workflows/ci.yml +14 -2
  36. package/templates/app/.vscode/launch.json +16 -0
  37. package/templates/app/.vscode/settings.json +10 -0
  38. package/templates/app/README.md +3 -0
  39. package/templates/app/cypress/cypress.config.ts +16 -0
  40. package/templates/app/index.html +4 -3
  41. package/templates/app/package.json +33 -9
  42. package/templates/app/src/App.vue +5 -3
  43. package/templates/app/src/assets/public/robots.txt +2 -0
  44. package/templates/app/src/main.ts +6 -2
  45. package/templates/app/src/types/globals.d.ts +0 -1
  46. package/templates/app/tailwind.config.js +1 -1
  47. package/templates/app/tsconfig.json +1 -0
  48. package/templates/app/vite.config.ts +14 -6
  49. package/templates/component-button/[component.name].vue +32 -0
  50. package/templates/component-button-story/[component.name].story.vue +71 -0
  51. package/templates/component-input/[component.name].vue +16 -0
  52. package/templates/component-input-story/[component.name].story.vue +63 -0
  53. package/templates/histoire/histoire.config.ts +7 -0
  54. package/templates/histoire/patches/histoire+0.17.6.patch +13 -0
  55. package/templates/histoire/src/main.histoire.ts +8 -0
  56. package/templates/postcss-pseudo-classes/postcss.config.js +15 -0
  57. package/templates/service/[service.name].ts +8 -0
  58. package/.eslintrc.js +0 -7
  59. package/noeldemartin.config.js +0 -4
  60. package/src/lib/utils.test.ts +0 -33
  61. package/src/lib/utils.ts +0 -44
  62. package/templates/app/cypress.config.ts +0 -8
  63. /package/bin/{ag → gel} +0 -0
  64. /package/templates/app/src/assets/{styles.css → css/styles.css} +0 -0
@@ -1,33 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- import { formatCodeBlock } from './utils';
4
-
5
- describe('Utils', () => {
6
-
7
- it('Formats code blocks', () => {
8
- // Arrange
9
- const raw = `
10
-
11
- const foo = 'bar';
12
-
13
- if (foo) {
14
- doSomething();
15
- }
16
-
17
- `;
18
- const formatted = [
19
- 'const foo = \'bar\';', //
20
- '', //
21
- 'if (foo) {', //
22
- ' doSomething();', //
23
- '}', //
24
- ].join('\n');
25
-
26
- // Act
27
- const actual = formatCodeBlock(raw);
28
-
29
- // Assert
30
- expect(actual).toEqual(formatted);
31
- });
32
-
33
- });
package/src/lib/utils.ts DELETED
@@ -1,44 +0,0 @@
1
- import { resolve } from 'path';
2
-
3
- export interface FormatCodeBlockOptions {
4
- indent?: number;
5
- }
6
-
7
- export function basePath(path: string): string {
8
- return resolve(__dirname, '../', path);
9
- }
10
-
11
- export function formatCodeBlock(code: string, options: FormatCodeBlockOptions = {}): string {
12
- const lines = code.split('\n');
13
- const indent = options.indent ?? 0;
14
- let originalIndent = 0;
15
- let formatted = '';
16
-
17
- for (const line of lines) {
18
- const trimmedLine = line.trim();
19
- const isEmptyLine = trimmedLine.length === 0;
20
-
21
- if (formatted.length === 0) {
22
- if (isEmptyLine) {
23
- continue;
24
- }
25
-
26
- originalIndent = line.indexOf(trimmedLine[0] ?? '');
27
- formatted += `${' '.repeat(indent)}${trimmedLine}\n`;
28
-
29
- continue;
30
- }
31
-
32
- if (isEmptyLine) {
33
- formatted += '\n';
34
-
35
- continue;
36
- }
37
-
38
- const lineIndent = line.indexOf(trimmedLine[0] ?? '');
39
-
40
- formatted += `${' '.repeat(indent + lineIndent - originalIndent)}${trimmedLine}\n`;
41
- }
42
-
43
- return formatted.trimEnd();
44
- }
@@ -1,8 +0,0 @@
1
- import { defineConfig } from 'cypress';
2
-
3
- export default defineConfig({
4
- e2e: {
5
- baseUrl: 'http://localhost:5001',
6
- video: false,
7
- },
8
- });
/package/bin/{ag → gel} RENAMED
File without changes