@stacksjs/actions 0.58.73 → 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.
- package/dist/action.d.ts +36 -0
- package/dist/add.d.ts +6 -0
- package/dist/build/component-libs.d.ts +1 -0
- package/dist/build/core.d.ts +1 -0
- package/dist/build/stacks.d.ts +1 -0
- package/dist/build.d.ts +9 -0
- package/dist/bump.d.ts +1 -0
- package/dist/changelog.d.ts +1 -0
- package/dist/clean.d.ts +1 -0
- package/dist/commit.d.ts +3 -0
- package/dist/copy-types.d.ts +5 -0
- package/dist/database/seed.d.ts +1 -0
- package/dist/deploy/index.d.ts +1 -0
- package/dist/dev/components.d.ts +1 -0
- package/dist/dev/docs.d.ts +1 -0
- package/dist/dev/index.d.ts +10 -0
- package/dist/examples.d.ts +5 -0
- package/dist/fresh.d.ts +1 -0
- package/dist/generate/component-meta.d.ts +5 -0
- package/dist/generate/ide-helpers.d.ts +6 -0
- package/dist/generate/index.d.ts +13 -0
- package/dist/generate/lib-entries.d.ts +2 -0
- package/dist/generate/vscode-custom-data.d.ts +6 -0
- package/dist/helpers/component-meta.d.ts +22 -0
- package/dist/helpers/lib-entries.d.ts +13 -0
- package/dist/helpers/package-json.d.ts +3 -0
- package/dist/helpers/utils.d.ts +18 -0
- package/dist/helpers/vscode-custom-data.d.ts +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/key-generate.d.ts +1 -0
- package/dist/lint/fix.d.ts +1 -0
- package/dist/lint/index.d.ts +1 -0
- package/dist/make.d.ts +20 -0
- package/dist/prepublish.d.ts +1 -0
- package/dist/release.d.ts +2 -0
- package/dist/test/coverage.d.ts +1 -0
- package/dist/test/feature.d.ts +1 -0
- package/dist/test/ui.d.ts +1 -0
- package/dist/test/unit.d.ts +1 -0
- package/dist/test.d.ts +1 -0
- package/dist/tinker.d.ts +1 -0
- package/dist/typecheck.d.ts +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/upgrade/dependencies.d.ts +1 -0
- package/dist/upgrade/framework.d.ts +1 -0
- package/dist/upgrade/index.d.ts +1 -0
- package/dist/upgrade.d.ts +4 -0
- package/package.json +5 -3
- package/src/bump.ts +8 -3
- package/src/check/ports.ts +11 -8
- package/src/deploy/index.ts +2 -6
- package/src/dev/index.ts +1 -1
- package/src/find-projects.ts +1 -1
- package/src/generate/index.ts +1 -1
- package/src/helpers/utils.ts +10 -14
- package/src/index.ts +1 -2
- package/src/lint/fix.ts +1 -0
- package/src/upgrade/shell.ts +5 -5
- package/dist/src/add.js +0 -29
- package/dist/src/build/component-libs.js +0 -6
- package/dist/src/build/core.js +0 -21
- package/dist/src/build/stacks.js +0 -8
- package/dist/src/build.js +0 -219
- package/dist/src/bump.js +0 -14
- package/dist/src/changelog.js +0 -17
- package/dist/src/clean.js +0 -6
- package/dist/src/commit.js +0 -17
- package/dist/src/copy-types.js +0 -14
- package/dist/src/database/seed.js +0 -1
- package/dist/src/deploy/index.js +0 -31
- package/dist/src/dev/components.js +0 -11
- package/dist/src/dev/docs.js +0 -7
- package/dist/src/dev/index.js +0 -92
- package/dist/src/examples.js +0 -43
- package/dist/src/fresh.js +0 -18
- package/dist/src/generate/component-meta.js +0 -59
- package/dist/src/generate/ide-helpers.js +0 -91
- package/dist/src/generate/index.js +0 -154
- package/dist/src/generate/lib-entries.js +0 -170
- package/dist/src/generate/vscode-custom-data.js +0 -91
- package/dist/src/helpers/component-meta.js +0 -50
- package/dist/src/helpers/index.js +0 -48
- package/dist/src/helpers/lib-entries.js +0 -161
- package/dist/src/helpers/package-json.js +0 -136
- package/dist/src/helpers/utils.js +0 -48
- package/dist/src/helpers/vscode-custom-data.js +0 -83
- package/dist/src/index.js +0 -590
- package/dist/src/key-generate.js +0 -10
- package/dist/src/lint/fix.js +0 -12
- package/dist/src/lint/index.js +0 -17
- package/dist/src/make.js +0 -291
- package/dist/src/prepublish.js +0 -14
- package/dist/src/release.js +0 -559
- package/dist/src/test/coverage.js +0 -6
- package/dist/src/test/feature.js +0 -6
- package/dist/src/test/ui.js +0 -6
- package/dist/src/test/unit.js +0 -6
- package/dist/src/test.js +0 -6
- package/dist/src/tinker.js +0 -5
- package/dist/src/typecheck.js +0 -6
- package/dist/src/types.js +0 -21
- package/dist/src/upgrade/dependencies.js +0 -6
- package/dist/src/upgrade/framework.js +0 -1
- package/dist/src/upgrade/index.js +0 -58
- package/dist/src/upgrade.js +0 -47
- package/src/generate/caddyfile.ts +0 -44
- package/src/helpers/index.ts +0 -1
- package/src/start-caddy.ts +0 -13
package/dist/action.d.ts
ADDED
|
@@ -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 {};
|
package/dist/build.d.ts
ADDED
|
@@ -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 {};
|
package/dist/clean.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/commit.d.ts
ADDED
|
@@ -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>;
|
package/dist/fresh.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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,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,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;
|
package/dist/index.d.ts
ADDED
|
@@ -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 @@
|
|
|
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 {};
|
package/dist/tinker.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types.d.ts
ADDED
|
@@ -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.
|
|
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": "^
|
|
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": "^
|
|
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
|
|
13
|
-
: 'bunx bumpp ./package.json
|
|
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
|
})
|
package/src/check/ports.ts
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import process from 'node:process'
|
|
2
|
-
import {
|
|
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
|
-
|
|
8
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
}
|
package/src/deploy/index.ts
CHANGED
|
@@ -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.
|
|
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
|
|
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...')
|
package/src/find-projects.ts
CHANGED
package/src/generate/index.ts
CHANGED
|
@@ -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
|
|
package/src/helpers/utils.ts
CHANGED
|
@@ -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
|
|
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)
|
|
15
|
+
export async function runAction(action: string, options?: ActionOptions) {
|
|
17
16
|
const opts = buddyOptions()
|
|
18
|
-
const path = p.relativeActionsPath(
|
|
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(
|
|
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
|
-
|
|
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
package/src/upgrade/shell.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import process from 'node:process'
|
|
2
2
|
import { $ } from 'bun'
|
|
3
|
-
import { path as p } from '
|
|
4
|
-
import { log } from '
|
|
5
|
-
import { ExitCode } from '
|
|
6
|
-
import { writeFile } from '
|
|
7
|
-
import { italic, runCommand } from '
|
|
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
|
-
};
|