@stacksjs/actions 0.58.72 → 0.59.1

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 (115) hide show
  1. package/dist/action.d.ts +36 -0
  2. package/dist/add.d.ts +6 -0
  3. package/dist/build/component-libs.d.ts +1 -0
  4. package/dist/build/core.d.ts +1 -0
  5. package/dist/build/stacks.d.ts +1 -0
  6. package/dist/build.d.ts +9 -0
  7. package/dist/bump.d.ts +1 -0
  8. package/dist/changelog.d.ts +1 -0
  9. package/dist/clean.d.ts +1 -0
  10. package/dist/commit.d.ts +3 -0
  11. package/dist/copy-types.d.ts +5 -0
  12. package/dist/database/seed.d.ts +1 -0
  13. package/dist/deploy/index.d.ts +1 -0
  14. package/dist/dev/components.d.ts +1 -0
  15. package/dist/dev/docs.d.ts +1 -0
  16. package/dist/dev/index.d.ts +10 -0
  17. package/dist/examples.d.ts +5 -0
  18. package/dist/fresh.d.ts +1 -0
  19. package/dist/generate/component-meta.d.ts +5 -0
  20. package/dist/generate/ide-helpers.d.ts +6 -0
  21. package/dist/generate/index.d.ts +13 -0
  22. package/dist/generate/lib-entries.d.ts +2 -0
  23. package/dist/generate/vscode-custom-data.d.ts +6 -0
  24. package/dist/helpers/component-meta.d.ts +22 -0
  25. package/dist/helpers/lib-entries.d.ts +13 -0
  26. package/dist/helpers/package-json.d.ts +3 -0
  27. package/dist/helpers/utils.d.ts +18 -0
  28. package/dist/helpers/vscode-custom-data.d.ts +2 -0
  29. package/dist/index.d.ts +7 -0
  30. package/dist/key-generate.d.ts +1 -0
  31. package/dist/lint/fix.d.ts +1 -0
  32. package/dist/lint/index.d.ts +1 -0
  33. package/dist/make.d.ts +20 -0
  34. package/dist/prepublish.d.ts +1 -0
  35. package/dist/release.d.ts +2 -0
  36. package/dist/test/coverage.d.ts +1 -0
  37. package/dist/test/feature.d.ts +1 -0
  38. package/dist/test/ui.d.ts +1 -0
  39. package/dist/test/unit.d.ts +1 -0
  40. package/dist/test.d.ts +1 -0
  41. package/dist/tinker.d.ts +1 -0
  42. package/dist/typecheck.d.ts +1 -0
  43. package/dist/types.d.ts +3 -0
  44. package/dist/upgrade/dependencies.d.ts +1 -0
  45. package/dist/upgrade/framework.d.ts +1 -0
  46. package/dist/upgrade/index.d.ts +1 -0
  47. package/dist/upgrade.d.ts +4 -0
  48. package/package.json +5 -3
  49. package/src/bump.ts +8 -3
  50. package/src/check/ports.ts +27 -0
  51. package/src/deploy/index.ts +2 -6
  52. package/src/dev/api.ts +1 -1
  53. package/src/dev/index.ts +1 -1
  54. package/src/find-projects.ts +21 -0
  55. package/src/generate/action-types.ts +14 -78
  56. package/src/generate/custom-cli-file.ts +1 -1
  57. package/src/generate/index.ts +10 -2
  58. package/src/generate/symlink-core.ts +3 -0
  59. package/src/helpers/lib-entries.ts +3 -3
  60. package/src/helpers/utils.ts +10 -14
  61. package/src/index.ts +1 -2
  62. package/src/lint/fix.ts +1 -0
  63. package/src/upgrade/binary.ts +43 -0
  64. package/src/upgrade/index.ts +6 -0
  65. package/src/upgrade/shell.ts +64 -0
  66. package/dist/src/add.js +0 -29
  67. package/dist/src/build/component-libs.js +0 -6
  68. package/dist/src/build/core.js +0 -21
  69. package/dist/src/build/stacks.js +0 -8
  70. package/dist/src/build.js +0 -213
  71. package/dist/src/bump.js +0 -14
  72. package/dist/src/changelog.js +0 -17
  73. package/dist/src/clean.js +0 -6
  74. package/dist/src/commit.js +0 -17
  75. package/dist/src/copy-types.js +0 -14
  76. package/dist/src/database/seed.js +0 -1
  77. package/dist/src/deploy/index.js +0 -31
  78. package/dist/src/dev/components.js +0 -11
  79. package/dist/src/dev/docs.js +0 -7
  80. package/dist/src/dev/index.js +0 -92
  81. package/dist/src/examples.js +0 -43
  82. package/dist/src/fresh.js +0 -18
  83. package/dist/src/generate/component-meta.js +0 -59
  84. package/dist/src/generate/ide-helpers.js +0 -91
  85. package/dist/src/generate/index.js +0 -147
  86. package/dist/src/generate/lib-entries.js +0 -170
  87. package/dist/src/generate/vscode-custom-data.js +0 -91
  88. package/dist/src/helpers/component-meta.js +0 -50
  89. package/dist/src/helpers/index.js +0 -48
  90. package/dist/src/helpers/lib-entries.js +0 -161
  91. package/dist/src/helpers/package-json.js +0 -136
  92. package/dist/src/helpers/utils.js +0 -48
  93. package/dist/src/helpers/vscode-custom-data.js +0 -83
  94. package/dist/src/index.js +0 -583
  95. package/dist/src/key-generate.js +0 -10
  96. package/dist/src/lint/fix.js +0 -12
  97. package/dist/src/lint/index.js +0 -17
  98. package/dist/src/make.js +0 -291
  99. package/dist/src/prepublish.js +0 -14
  100. package/dist/src/release.js +0 -553
  101. package/dist/src/test/coverage.js +0 -6
  102. package/dist/src/test/feature.js +0 -6
  103. package/dist/src/test/ui.js +0 -6
  104. package/dist/src/test/unit.js +0 -6
  105. package/dist/src/test.js +0 -6
  106. package/dist/src/tinker.js +0 -5
  107. package/dist/src/typecheck.js +0 -6
  108. package/dist/src/types.js +0 -21
  109. package/dist/src/upgrade/dependencies.js +0 -6
  110. package/dist/src/upgrade/framework.js +0 -1
  111. package/dist/src/upgrade/index.js +0 -54
  112. package/dist/src/upgrade.js +0 -47
  113. package/src/generate/caddyfile.ts +0 -1
  114. package/src/helpers/index.ts +0 -1
  115. package/src/start-caddy.ts +0 -13
@@ -0,0 +1,36 @@
1
+ import type { JobOptions, Nullable } from '@stacksjs/types';
2
+ import type { ValidationBoolean, ValidationNumber, ValidationString } from '@stacksjs/validation';
3
+ type FieldKey = string;
4
+ interface FieldValue {
5
+ rule: ValidationString | ValidationNumber | ValidationBoolean | Date | Nullable<any>;
6
+ message: string;
7
+ factory?: any;
8
+ unique?: boolean;
9
+ }
10
+ interface Request {
11
+ message: string;
12
+ level: 'info' | 'warn' | 'error';
13
+ }
14
+ interface ActionOptions {
15
+ name?: string;
16
+ description?: string;
17
+ fields?: Record<FieldKey, FieldValue>;
18
+ path?: string;
19
+ rate?: JobOptions['rate'];
20
+ tries?: JobOptions['tries'];
21
+ backoff?: JobOptions['backoff'];
22
+ enabled?: JobOptions['enabled'];
23
+ handle: (request?: Request) => Promise<any> | object | string;
24
+ }
25
+ export declare class Action {
26
+ name?: string;
27
+ description?: string;
28
+ fields?: Record<FieldKey, FieldValue>;
29
+ rate?: JobOptions['rate'];
30
+ tries?: JobOptions['tries'];
31
+ backoff?: JobOptions['backoff'];
32
+ enabled?: boolean;
33
+ handle: (request?: Request) => Promise<any> | object | string;
34
+ constructor({ name, description, fields, handle, rate, tries, backoff, enabled }: ActionOptions);
35
+ }
36
+ export {};
package/dist/add.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import type { AddOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: AddOptions): Promise<void>;
3
+ export declare function add(options: AddOptions): Promise<void>;
4
+ export declare function addTable(): Promise<void>;
5
+ export declare function addCalendar(): Promise<void>;
6
+ export declare function installPackages(names: string[]): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { BuildOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: BuildOptions): Promise<void>;
3
+ export declare function build(options: BuildOptions): Promise<void>;
4
+ export declare function componentLibraries(options: BuildOptions): Promise<void>;
5
+ export declare function vueComponentLibrary(options: BuildOptions): Promise<void>;
6
+ export declare function webComponentLibrary(options: BuildOptions): Promise<void>;
7
+ export declare function docs(options: BuildOptions): Promise<void>;
8
+ export declare function stacks(options: BuildOptions): Promise<void>;
9
+ export declare function functionsLibrary(options: BuildOptions): Promise<void>;
package/dist/bump.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { CleanOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: CleanOptions): Promise<void>;
3
+ export declare function commit(options: CleanOptions): Promise<void>;
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * This action copies all the generated types.
4
+ */
5
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { DevOptions } from '@stacksjs/types';
2
+ export declare function runDevServer(options: DevOptions): Promise<void>;
3
+ export declare function runFrontendDevServer(options: DevOptions): Promise<void>;
4
+ export declare function runBackendDevServer(options: DevOptions): Promise<void>;
5
+ export declare function runApiDevServer(options: DevOptions): Promise<void>;
6
+ export declare function runComponentsDevServer(options: DevOptions): Promise<void>;
7
+ export declare function runDashboardDevServer(options: DevOptions): Promise<void>;
8
+ export declare function runSystemTrayDevServer(options: DevOptions): Promise<void>;
9
+ export declare function runDesktopDevServer(options: DevOptions): Promise<void>;
10
+ export declare function runDocsDevServer(options: DevOptions): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import type { ExamplesOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: ExamplesOptions): Promise<void>;
3
+ export declare function examples(options: ExamplesOptions): Promise<void>;
4
+ export declare function componentExample(options: ExamplesOptions): Promise<void>;
5
+ export declare function webComponentExample(options: ExamplesOptions): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * This action generates the component meta.
4
+ */
5
+ export {};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * This action generates the web-types.json & custom-elements.json
4
+ * files for the components.
5
+ */
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { GeneratorOptions } from '@stacksjs/types';
2
+ export declare function invoke(options?: GeneratorOptions): Promise<void>;
3
+ export declare function generate(options: GeneratorOptions): Promise<void>;
4
+ export declare function generateLibEntries(options: GeneratorOptions): Promise<void>;
5
+ export declare function generateWebTypes(options?: GeneratorOptions): Promise<void>;
6
+ export declare function generateVsCodeCustomData(options?: GeneratorOptions): Promise<void>;
7
+ export declare function generateIdeHelpers(options?: GeneratorOptions): Promise<void>;
8
+ export declare function generateComponentMeta(options?: GeneratorOptions): Promise<void>;
9
+ export declare function generateTypes(options?: GeneratorOptions): Promise<void>;
10
+ export declare function generateMigrations(): void;
11
+ export declare function generatePkgxConfig(): void;
12
+ export declare function generateSeeder(): Promise<void>;
13
+ export declare function generateCoreSymlink(): Promise<void>;
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * This action generates the web-types.json & custom-elements.json
4
+ * files for the components.
5
+ */
6
+ export {};
@@ -0,0 +1,22 @@
1
+ import { type ComponentMeta } from 'vue-component-meta';
2
+ /**
3
+ * ℹ️ Useful Links
4
+ *
5
+ * vue-component-meta tests: https://github.com/johnsoncodehk/volar/blob/master/vue-language-tools/vue-component-meta/tests/index.spec.ts
6
+ * Discord thread about improving vue-component-meta: https://discord.com/channels/793943652350427136/1027819645677350912
7
+ * GitHub issue for improving vue-component-meta based on runtime/dynamic props: https://github.com/johnsoncodehk/volar/issues/1854
8
+ * Discord chat: https://discord.com/channels/793943652350427136/1027819645677350912
9
+ * original script: https://raw.githubusercontent.com/jd-solanki/anu/main/scripts/gen-component-meta.ts
10
+ */
11
+ export declare function generateComponentMeta(): void;
12
+ export interface ComponentApiProps {
13
+ name: ComponentMeta['props'][number]['name'];
14
+ description: ComponentMeta['props'][number]['description'];
15
+ type: ComponentMeta['props'][number]['type'];
16
+ default: ComponentMeta['props'][number]['default'];
17
+ }
18
+ export interface ComponentApi {
19
+ props: ComponentApiProps[];
20
+ events: ComponentMeta['events'];
21
+ slots: ComponentMeta['slots'];
22
+ }
@@ -0,0 +1,13 @@
1
+ import type { LibraryType } from '@stacksjs/path';
2
+ /**
3
+ * Based on the config values, this method
4
+ * will generate the library entry points.
5
+ *
6
+ * @param type LibraryType
7
+ */
8
+ export declare function generateLibEntry(type: LibraryType): Promise<void>;
9
+ export declare function createLibraryEntryPoint(type: LibraryType): Promise<void>;
10
+ export declare function createVueLibraryEntryPoint(type?: LibraryType): Promise<void>;
11
+ export declare function createWebComponentLibraryEntryPoint(type?: LibraryType): Promise<void>;
12
+ export declare function createFunctionLibraryEntryPoint(type?: LibraryType): Promise<void>;
13
+ export declare function generateEntryPointData(type: LibraryType): string;
@@ -0,0 +1,3 @@
1
+ type PackageJsonType = 'vue-components' | 'web-components' | 'functions';
2
+ export declare function generatePackageJson(type: PackageJsonType): Promise<void>;
3
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { ActionOptions } from '@stacksjs/types';
2
+ /**
3
+ * Run an Action the Stacks way.
4
+ *
5
+ * @param action The action to invoke.
6
+ * @param options The options to pass to the command.
7
+ * @returns The result of the command.
8
+ */
9
+ export declare function runAction(action: string, options?: ActionOptions): Promise<any>;
10
+ /**
11
+ * Run Actions the Stacks way.
12
+ *
13
+ * @param actions The actions to invoke.
14
+ * @param options The options to pass to the command.
15
+ * @returns The result of the command.
16
+ */
17
+ export declare function runActions(actions: string[], options?: ActionOptions): Promise<any>;
18
+ export declare function hasAction(action: string): any;
@@ -0,0 +1,2 @@
1
+ export declare function generateVsCodeCustomData(): Promise<void>;
2
+ export declare function generateWebTypes(): Promise<void>;
@@ -0,0 +1,7 @@
1
+ export * from './action';
2
+ export * from './dev';
3
+ export * from './generate';
4
+ export * from './helpers/utils';
5
+ export { commit as runCommit } from './commit';
6
+ export { add as runAdd } from './add';
7
+ export { make as runMake, makeComponent, makeDatabase, makeFunction, makeLanguage, makeNotification, makePage, makeStack, createComponent, createDatabase, createFactory, createFunction, createLanguage, createMigration, createModel, createNotification, createPage, } from './make';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/dist/make.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import type { MakeOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: MakeOptions): Promise<void>;
3
+ export declare function make(options: MakeOptions): Promise<void>;
4
+ export declare function makeComponent(options: MakeOptions): Promise<void>;
5
+ export declare function createComponent(options: MakeOptions): Promise<void>;
6
+ export declare function makeDatabase(options: MakeOptions): void;
7
+ export declare function createDatabase(options: MakeOptions): void;
8
+ export declare function factory(options: MakeOptions): void;
9
+ export declare function createFactory(options: MakeOptions): void;
10
+ export declare function makeNotification(options: MakeOptions): Promise<void>;
11
+ export declare function makePage(options: MakeOptions): Promise<void>;
12
+ export declare function createPage(options: MakeOptions): Promise<void>;
13
+ export declare function makeFunction(options: MakeOptions): Promise<void>;
14
+ export declare function createFunction(options: MakeOptions): Promise<void>;
15
+ export declare function makeLanguage(options: MakeOptions): Promise<void>;
16
+ export declare function createLanguage(options: MakeOptions): Promise<void>;
17
+ export declare function makeStack(options: MakeOptions): void;
18
+ export declare function createNotification(options: MakeOptions): Promise<boolean>;
19
+ export declare function createMigration(options: MakeOptions): Promise<void>;
20
+ export declare function createModel(options: MakeOptions): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/dist/test.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { TypesOptions } from '@stacksjs/types';
2
+ export declare function invoke(options?: TypesOptions): Promise<void>;
3
+ export declare function types(options: TypesOptions): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { UpgradeOptions } from '@stacksjs/types';
2
+ export declare function checkForUncommittedChanges(options: UpgradeOptions): void;
3
+ export declare function downloadFrameworkUpdate(options: UpgradeOptions): Promise<void>;
4
+ export declare function updateDependencies(): Promise<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.58.72",
4
+ "version": "0.59.1",
5
5
  "description": "The Stacks actions.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -27,10 +27,12 @@
27
27
  "exports": {
28
28
  ".": {
29
29
  "bun": "./src/index.ts",
30
+ "types": "./dist/index.d.ts",
30
31
  "import": "./dist/index.js"
31
32
  },
32
33
  "./*": {
33
34
  "bun": "./src/*",
35
+ "types": "./dist/*.d.ts",
34
36
  "import": "./dist/*"
35
37
  }
36
38
  },
@@ -66,7 +68,7 @@
66
68
  "@stacksjs/utils": "latest",
67
69
  "@stacksjs/validation": "latest",
68
70
  "markdown-it": "^14.0.0",
69
- "vue-component-meta": "^1.8.27"
71
+ "vue-component-meta": "^2.0.5"
70
72
  },
71
73
  "dependencies": {
72
74
  "@stacksjs/cli": "latest",
@@ -84,7 +86,7 @@
84
86
  "@stacksjs/utils": "latest",
85
87
  "@stacksjs/validation": "latest",
86
88
  "markdown-it": "^14.0.0",
87
- "vue-component-meta": "^1.8.27"
89
+ "vue-component-meta": "^2.0.5"
88
90
  },
89
91
  "devDependencies": {
90
92
  "@stacksjs/development": "latest"
package/src/bump.ts CHANGED
@@ -9,10 +9,15 @@ await runCommand(changelogCommand, {
9
9
  })
10
10
 
11
11
  const bumpCommand = options?.dryRun
12
- ? 'bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --no-push'
13
- : 'bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --all'
12
+ ? 'bunx bumpp ./package.json ./**/package.json ../ide/vscode/package.json --no-push'
13
+ : 'bunx bumpp ./package.json ./**/package.json ../ide/vscode/package.json --all'
14
+
15
+ // eslint-disable-next-line no-console
16
+ console.log(`Running: ${bumpCommand}`)
17
+ // eslint-disable-next-line no-console
18
+ console.log(`In frameworkPath: ${p.frameworkPath()}`)
14
19
 
15
20
  await runCommand(bumpCommand, {
16
- cwd: p.frameworkPath(),
21
+ cwd: p.frameworkPath('core'),
17
22
  stdin: 'inherit',
18
23
  })
@@ -0,0 +1,27 @@
1
+ import process from 'node:process'
2
+ import { $ } from 'bun'
3
+ import { findStacksProjects } from '@stacksjs/utils'
4
+ import { log } from '@stacksjs/logging'
5
+
6
+ const projects = await findStacksProjects(undefined, { quiet: true })
7
+
8
+ log.debug('Running `buddy ports`')
9
+ log.debug(`Found ${projects.length} projects`)
10
+ log.debug('Projects:', projects)
11
+
12
+ // need to loop over the projects and then trigger `buddy ports` for each project (which returns a list of ports)
13
+ for (const project of projects) {
14
+ log.debug('Running `buddy ports`')
15
+ log.debug('Project:', project)
16
+
17
+ // this right now causes a loop of the same project
18
+ $.cwd(project)
19
+ const ports = await $`./buddy ports --project ${project} --quiet`.text()
20
+
21
+ // eslint-disable-next-line no-console
22
+ console.log('ports', ports)
23
+ }
24
+
25
+ process.exit(0)
26
+ // then we can check if the port is in use and if it is, we can prompt the user to kill the process or to auto assign a new port
27
+ // if the port is not in use, we can start the project
@@ -5,7 +5,7 @@ import { path as p } from '@stacksjs/path'
5
5
  import { storage } from '@stacksjs/storage'
6
6
 
7
7
  await runCommand('bun run build', {
8
- cwd: p.frameworkPath(),
8
+ cwd: p.corePath(),
9
9
  })
10
10
 
11
11
  if (storage.hasFiles(p.projectPath('docs'))) {
@@ -14,16 +14,12 @@ if (storage.hasFiles(p.projectPath('docs'))) {
14
14
  })
15
15
  }
16
16
 
17
- if (config.app.docMode !== true) { // when in docs mode, we disregard building views
17
+ if (config.app.docMode !== true) { // when in docMode, we can disregard building views
18
18
  await runCommand('bun run build', {
19
19
  cwd: p.frameworkPath('views'),
20
20
  })
21
21
  }
22
22
 
23
- // await runCommand('bun run build-layer', {
24
- // cwd: p.corePath('cloud'),
25
- // })
26
-
27
23
  // await runCommand('bun run build-edge', {
28
24
  // cwd: p.corePath('cloud'),
29
25
  // })
package/src/dev/api.ts CHANGED
@@ -8,7 +8,7 @@ const options = parseOptions()
8
8
  log.debug('Running API dev server via', `bunx vite --config ${p.vitePath('src/api.ts')}`, options)
9
9
 
10
10
  serve({
11
- port: config.app.ports?.api, // defaults to 3999
11
+ port: config.ports?.api, // defaults to 3008
12
12
  })
13
13
 
14
14
  // the reason we start a Vite dev server next is because we need the Bun server proxied by vite
package/src/dev/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { log } from '@stacksjs/logging'
2
2
  import type { DevOptions } from '@stacksjs/types'
3
3
  import { Action } from '@stacksjs/enums'
4
- import { runAction } from '../helpers'
4
+ import { runAction } from '../helpers/utils'
5
5
 
6
6
  export async function runDevServer(options: DevOptions) {
7
7
  log.info('Starting your Frontend Engine...')
@@ -0,0 +1,21 @@
1
+ import process from 'node:process'
2
+ import { findStacksProjects } from '@stacksjs/utils'
3
+ import { log } from '@stacksjs/logging'
4
+ import { parseOptions } from '@stacksjs/cli'
5
+
6
+ try {
7
+ const options = parseOptions()
8
+ const projects = await findStacksProjects(undefined, options)
9
+
10
+ if (projects.length > 0) {
11
+ log.info('Found Projects:')
12
+ // eslint-disable-next-line no-console
13
+ projects.forEach(project => console.log(` - ${project}`))
14
+ process.exit()
15
+ }
16
+
17
+ log.info('No Stacks Projects found.')
18
+ }
19
+ catch (error: any) {
20
+ log.error('Error searching for Stacks projects:', error)
21
+ }
@@ -1,89 +1,25 @@
1
+ import { readdir } from 'node:fs/promises'
1
2
  import { path as p } from '@stacksjs/path'
2
- import { storage } from '@stacksjs/storage'
3
- import { env as e, enums } from '@stacksjs/env'
4
3
  import { logger } from '@stacksjs/logging'
5
- import { envKeys } from '../../../../env'
6
-
7
- log.debug('Generating type Action types...')
8
-
9
- // generate ./storage/framework/types/env.d.ts file from .env
10
- const envTypes = `
11
- // This file is auto-generated by Stacks. Do not edit this file manually.
12
- // If you want to edit Action types, please edit the app/Actions/* validations
13
- //
14
- // For more information, please visit: https://stacksjs.org/docs
15
-
16
- declare module 'bun' {
17
- namespace env {
18
- ${envKeys.map((key) => {
19
- let type: string | undefined = typeof e[key]
20
- let value: string | boolean | number | undefined = e[key]
21
-
22
- if (!value) {
23
- if (enums[key]) {
24
- type = enums[key]?.map(item => `'${item}'`).join(' | ')
25
- value = enums[key]?.[0] // default to the first enum value
26
- }
27
- else {
28
- switch (type) {
29
- case 'number':
30
- value = '0'
31
- break
32
- case 'boolean':
33
- value = false
34
- break
35
- default:
36
- value = ''
37
- }
38
- }
39
- }
40
-
41
- type = 'string'
42
- if (typeof value === 'string') {
43
- if (value.toLowerCase() === 'true' || value.toLowerCase() === 'false') {
44
- type = 'boolean'
45
- }
46
- else if (!Number.isNaN(Number.parseFloat(value)) && Number.isFinite(Number(value))) {
47
- type = 'number'
48
- }
49
- else if (enums[key]) {
50
- // @ts-expect-error enums[key] is defined
51
- type = enums[key].map(item => `'${item}'`).join(' | ')
52
- }
53
- }
54
-
55
- else if (typeof value === 'number') {
56
- type = 'number'
57
- }
58
-
59
- else if (typeof value === 'boolean') {
60
- type = 'boolean'
61
- }
4
+ import { storage } from '@stacksjs/storage'
62
5
 
63
- return `const ${key}: ${type}`
64
- }).join('\n ')}
65
- }
66
- }
67
- `
6
+ logger.log('Generating action types...')
68
7
 
69
- await storage.writeFile(p.frameworkPath('types/env.d.ts'), envTypes)
8
+ const domain = 'Actions'
70
9
 
71
- logger.log(' - ./storage/framework/env.ts')
10
+ const files = await readdir(p.appPath(domain), { recursive: true })
72
11
 
73
- // generate ./storage/framework/env.ts file based on Bun.env
74
- const env = `
75
- // This file is auto-generated by Stacks. Do not edit this file manually.
76
- // If you want to change the environment variables, please edit the .env file.
12
+ const validActions = `// This file is auto-generated by Stacks. Do not edit this file manually.
13
+ // If you wish to rename an action, please do so by editing the file name.
77
14
  //
78
15
  // For more information, please visit: https://stacksjs.org/docs
79
16
 
80
- export const envKeys = [
81
- ${envKeys.map(key => `'${key}'`).join(',\n ')}
82
- ] as const
83
-
84
- export type EnvKey = typeof envKeys[number]
17
+ export type ActionPath = ${
18
+ files
19
+ .filter(file => file.endsWith('.ts'))
20
+ .map(value => `'${domain}/${value.replace('.ts', '')}'`)
21
+ .join(' | ')
22
+ }
85
23
  `
86
24
 
87
- await storage.writeFile(p.frameworkPath('env.ts'), env)
88
-
89
- logger.log(' - ./storage/framework/env.d.ts')
25
+ await storage.writeFile(p.frameworkPath('types/actions.d.ts'), validActions)
@@ -4,7 +4,7 @@ import { writeTextFile } from '@stacksjs/storage'
4
4
  import { projectPath } from '@stacksjs/path'
5
5
  import { cli } from '@stacksjs/config'
6
6
 
7
- log.info('Creating Vue Component Library Entry Point...')
7
+ log.info('Ensuring Component Library Entry Point...')
8
8
 
9
9
  if (!cli.command) {
10
10
  log.error('No command defined in the CLI configuration')
@@ -2,9 +2,10 @@ import process from 'node:process'
2
2
  import { log } from '@stacksjs/logging'
3
3
  import { Action, NpmScript } from '@stacksjs/enums'
4
4
  import type { GeneratorOptions } from '@stacksjs/types'
5
+ import { runCommand } from '@stacksjs/cli'
5
6
  import { runNpmScript } from '@stacksjs/utils'
6
7
  import { frameworkPath, projectPath } from '@stacksjs/path'
7
- import { runAction } from '../helpers'
8
+ import { runAction } from '../helpers/utils'
8
9
 
9
10
  // import { files } from '@stacksjs/storage'
10
11
 
@@ -26,6 +27,9 @@ export async function invoke(options?: GeneratorOptions) {
26
27
 
27
28
  else if (options?.componentMeta)
28
29
  await generateComponentMeta(options)
30
+
31
+ else if (options?.coreSymlink)
32
+ await generateCoreSymlink()
29
33
  }
30
34
 
31
35
  export function generate(options: GeneratorOptions) {
@@ -124,9 +128,13 @@ export function generatePkgxConfig() {
124
128
  // write the yaml string to a file in your project root
125
129
  // files.put(projectPath('./pkgx.yaml'), yamlStr)
126
130
 
127
- log.success('Successfully generated `./pkgx.yaml` based on your configs')
131
+ log.success('Successfully generated `./pkgx.yaml` based on your config')
128
132
  }
129
133
 
130
134
  export async function generateSeeder() {
131
135
  // await seed()
132
136
  }
137
+
138
+ export async function generateCoreSymlink() {
139
+ await runCommand(`ln -s ${frameworkPath()} ${projectPath('.stacks')}`)
140
+ }