@stacksjs/actions 0.58.73 → 0.59.2

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 (108) 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 +11 -8
  51. package/src/deploy/index.ts +2 -6
  52. package/src/dev/index.ts +1 -1
  53. package/src/find-projects.ts +1 -1
  54. package/src/generate/index.ts +1 -1
  55. package/src/helpers/utils.ts +10 -14
  56. package/src/index.ts +1 -2
  57. package/src/lint/fix.ts +1 -0
  58. package/src/upgrade/shell.ts +5 -5
  59. package/dist/src/add.js +0 -29
  60. package/dist/src/build/component-libs.js +0 -6
  61. package/dist/src/build/core.js +0 -21
  62. package/dist/src/build/stacks.js +0 -8
  63. package/dist/src/build.js +0 -219
  64. package/dist/src/bump.js +0 -14
  65. package/dist/src/changelog.js +0 -17
  66. package/dist/src/clean.js +0 -6
  67. package/dist/src/commit.js +0 -17
  68. package/dist/src/copy-types.js +0 -14
  69. package/dist/src/database/seed.js +0 -1
  70. package/dist/src/deploy/index.js +0 -31
  71. package/dist/src/dev/components.js +0 -11
  72. package/dist/src/dev/docs.js +0 -7
  73. package/dist/src/dev/index.js +0 -92
  74. package/dist/src/examples.js +0 -43
  75. package/dist/src/fresh.js +0 -18
  76. package/dist/src/generate/component-meta.js +0 -59
  77. package/dist/src/generate/ide-helpers.js +0 -91
  78. package/dist/src/generate/index.js +0 -154
  79. package/dist/src/generate/lib-entries.js +0 -170
  80. package/dist/src/generate/vscode-custom-data.js +0 -91
  81. package/dist/src/helpers/component-meta.js +0 -50
  82. package/dist/src/helpers/index.js +0 -48
  83. package/dist/src/helpers/lib-entries.js +0 -161
  84. package/dist/src/helpers/package-json.js +0 -136
  85. package/dist/src/helpers/utils.js +0 -48
  86. package/dist/src/helpers/vscode-custom-data.js +0 -83
  87. package/dist/src/index.js +0 -590
  88. package/dist/src/key-generate.js +0 -10
  89. package/dist/src/lint/fix.js +0 -12
  90. package/dist/src/lint/index.js +0 -17
  91. package/dist/src/make.js +0 -291
  92. package/dist/src/prepublish.js +0 -14
  93. package/dist/src/release.js +0 -559
  94. package/dist/src/test/coverage.js +0 -6
  95. package/dist/src/test/feature.js +0 -6
  96. package/dist/src/test/ui.js +0 -6
  97. package/dist/src/test/unit.js +0 -6
  98. package/dist/src/test.js +0 -6
  99. package/dist/src/tinker.js +0 -5
  100. package/dist/src/typecheck.js +0 -6
  101. package/dist/src/types.js +0 -21
  102. package/dist/src/upgrade/dependencies.js +0 -6
  103. package/dist/src/upgrade/framework.js +0 -1
  104. package/dist/src/upgrade/index.js +0 -58
  105. package/dist/src/upgrade.js +0 -47
  106. package/src/generate/caddyfile.ts +0 -44
  107. package/src/helpers/index.ts +0 -1
  108. 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.73",
4
+ "version": "0.59.2",
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
  })
@@ -1,20 +1,23 @@
1
1
  import process from 'node:process'
2
- import { runCommand } from '@stacksjs/cli'
2
+ import { $ } from 'bun'
3
3
  import { findStacksProjects } from '@stacksjs/utils'
4
+ import { log } from '@stacksjs/logging'
4
5
 
5
6
  const projects = await findStacksProjects(undefined, { quiet: true })
6
7
 
7
- // eslint-disable-next-line no-console
8
- console.log('projects', projects)
8
+ log.debug('Running `buddy ports`')
9
+ log.debug(`Found ${projects.length} projects`)
10
+ log.debug('Projects:', projects)
9
11
 
10
12
  // need to loop over the projects and then trigger `buddy ports` for each project (which returns a list of ports)
11
13
  for (const project of projects) {
12
- // eslint-disable-next-line no-console
13
- console.log('project', project)
14
+ log.debug('Running `buddy ports`')
15
+ log.debug('Project:', project)
16
+
14
17
  // this right now causes a loop of the same project
15
- const ports = await runCommand(`buddy ports --project ${project}`)
16
- // eslint-disable-next-line no-console
17
- console.log('proj', project)
18
+ $.cwd(project)
19
+ const ports = await $`./buddy ports --project ${project} --quiet`.text()
20
+
18
21
  // eslint-disable-next-line no-console
19
22
  console.log('ports', ports)
20
23
  }
@@ -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/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...')
@@ -1,7 +1,7 @@
1
1
  import process from 'node:process'
2
2
  import { findStacksProjects } from '@stacksjs/utils'
3
3
  import { log } from '@stacksjs/logging'
4
- import { parseOptions } from 'stacks/cli'
4
+ import { parseOptions } from '@stacksjs/cli'
5
5
 
6
6
  try {
7
7
  const options = parseOptions()
@@ -5,7 +5,7 @@ import type { GeneratorOptions } from '@stacksjs/types'
5
5
  import { runCommand } from '@stacksjs/cli'
6
6
  import { runNpmScript } from '@stacksjs/utils'
7
7
  import { frameworkPath, projectPath } from '@stacksjs/path'
8
- import { runAction } from '../helpers'
8
+ import { runAction } from '../helpers/utils'
9
9
 
10
10
  // import { files } from '@stacksjs/storage'
11
11
 
@@ -1,10 +1,9 @@
1
- import * as storage from '@stacksjs/storage'
2
1
  import { buddyOptions, runCommand, runCommands } from '@stacksjs/cli'
2
+ import { storage } from '@stacksjs/storage'
3
3
  import { log } from '@stacksjs/logging'
4
+ import { err } from '@stacksjs/error-handling'
4
5
  import * as p from '@stacksjs/path'
5
- import type { ActionOptions, Subprocess } from '@stacksjs/types'
6
- import type { Result } from '@stacksjs/error-handling'
7
- import { err, handleError } from '@stacksjs/error-handling'
6
+ import type { ActionOptions } from '@stacksjs/types'
8
7
 
9
8
  /**
10
9
  * Run an Action the Stacks way.
@@ -13,9 +12,9 @@ import { err, handleError } from '@stacksjs/error-handling'
13
12
  * @param options The options to pass to the command.
14
13
  * @returns The result of the command.
15
14
  */
16
- export async function runAction(action: string, options?: ActionOptions): Promise<Result<Subprocess, Error>> {
15
+ export async function runAction(action: string, options?: ActionOptions) {
17
16
  const opts = buddyOptions()
18
- const path = p.relativeActionsPath(`${action}.ts`)
17
+ const path = p.relativeActionsPath(`src/${action}.ts`)
19
18
  const cmd = `bun --bun ${path} ${opts}`.trimEnd()
20
19
  const optionsWithCwd = {
21
20
  cwd: options?.cwd || p.projectPath(),
@@ -25,9 +24,6 @@ export async function runAction(action: string, options?: ActionOptions): Promis
25
24
  log.debug('runAction:', cmd)
26
25
  log.debug('action options:', optionsWithCwd)
27
26
 
28
- if (!hasAction(action))
29
- return err(handleError(`The specified action "${action}" does not exist`))
30
-
31
27
  return await runCommand(cmd, optionsWithCwd)
32
28
  }
33
29
 
@@ -46,6 +42,7 @@ export async function runActions(actions: string[], options?: ActionOptions) {
46
42
  return err('No actions were specified')
47
43
 
48
44
  for (const action of actions) {
45
+ log.debug(`running action "${action}"`)
49
46
  if (!hasAction(action))
50
47
  return err(`The specified action "${action}" does not exist`)
51
48
  }
@@ -57,14 +54,13 @@ export async function runActions(actions: string[], options?: ActionOptions) {
57
54
  ...options,
58
55
  }
59
56
 
60
- const commands = actions.map(action => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`)
57
+ const commands = actions.map(action => `bun --bun ${p.relativeActionsPath(`src/${action}.ts`)} ${opts}`)
58
+
59
+ log.debug('commands:', commands)
61
60
 
62
61
  return await runCommands(commands, o)
63
62
  }
64
63
 
65
64
  export function hasAction(action: string) {
66
- if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
67
- return true
68
-
69
- return storage.isFile(p.actionsPath(`${action}.ts`))
65
+ return storage.isFile(p.actionsPath(`src/${action}.ts`))
70
66
  }
package/src/index.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  export * from './action'
2
2
  export * from './dev'
3
3
  export * from './generate'
4
- export * from './helpers'
4
+ export * from './helpers/utils'
5
5
 
6
- export { examples as runExample } from './examples'
7
6
  export { commit as runCommit } from './commit'
8
7
  export { add as runAdd } from './add'
9
8
 
package/src/lint/fix.ts CHANGED
@@ -2,6 +2,7 @@ import { log, parseOptions, runCommand } from '@stacksjs/cli'
2
2
  import { projectPath } from '@stacksjs/path'
3
3
  import { NpmScript } from '@stacksjs/enums'
4
4
 
5
+ // TODO: this should be a loader
5
6
  log.info('Ensuring Code Style...')
6
7
 
7
8
  const options = parseOptions()
@@ -1,10 +1,10 @@
1
1
  import process from 'node:process'
2
2
  import { $ } from 'bun'
3
- import { path as p } from 'stacks/path'
4
- import { log } from 'stacks/logging'
5
- import { ExitCode } from 'stacks/types'
6
- import { writeFile } from 'stacks/storage'
7
- import { italic, runCommand } from 'stacks/cli'
3
+ import { path as p } from '@stacksjs/path'
4
+ import { log } from '@stacksjs/logging'
5
+ import { ExitCode } from '@stacksjs/types'
6
+ import { writeFile } from '@stacksjs/storage'
7
+ import { italic, runCommand } from '@stacksjs/cli'
8
8
 
9
9
  const homePath = (await $`echo $HOME`.text()).trim()
10
10
  const zshrcPath = p.join(homePath, '.zshrc')
package/dist/src/add.js DELETED
@@ -1,29 +0,0 @@
1
- // @bun
2
- // src/add.ts
3
- import {installPackage} from "@stacksjs/cli";
4
- async function invoke(options) {
5
- if (options?.table)
6
- await addTable();
7
- if (options?.calendar)
8
- await addCalendar();
9
- }
10
- async function add(options) {
11
- return invoke(options);
12
- }
13
- async function addTable() {
14
- await installPackage("@stacksjs/table");
15
- }
16
- async function addCalendar() {
17
- await installPackage("@stacksjs/calendar");
18
- }
19
- async function installPackages(names) {
20
- for (const name of names)
21
- await installPackage(name);
22
- }
23
- export {
24
- invoke,
25
- installPackages,
26
- addTable,
27
- addCalendar,
28
- add
29
- };
@@ -1,6 +0,0 @@
1
- // @bun
2
- // src/build/component-libs.ts
3
- import {frameworkPath} from "@stacksjs/path";
4
- import {runCommand} from "@stacksjs/cli";
5
- import {NpmScript} from "@stacksjs/enums";
6
- await runCommand(NpmScript.BuildComponents, { cwd: frameworkPath(), verbose: true });