@stacksjs/actions 0.52.10 → 0.56.3
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/build/component-libs.mjs +2 -8
- package/dist/clean.mjs +1 -1
- package/dist/dev/index.d.ts +0 -6
- package/dist/dev/index.mjs +6 -8
- package/dist/generate/index.mjs +2 -2
- package/dist/generate/settings.d.ts +0 -1
- package/dist/generate/settings.mjs +0 -2
- package/dist/helpers/lib-entries.d.ts +8 -7
- package/dist/helpers/lib-entries.mjs +42 -33
- package/dist/helpers/utils.d.ts +2 -2
- package/dist/helpers/utils.mjs +3 -6
- package/dist/lint/index.d.ts +1 -1
- package/dist/lint/index.mjs +12 -2
- package/dist/make.mjs +8 -5
- package/dist/migrate.mjs +2 -2
- package/dist/prepublish.mjs +1 -1
- package/dist/release.mjs +6 -3
- package/dist/seed.mjs +1 -1
- package/dist/upgrade/framework.d.ts +0 -1
- package/dist/upgrade/framework.mjs +0 -18
- package/dist/upgrade/index.d.ts +0 -1
- package/dist/upgrade/index.mjs +0 -11
- package/dist/upgrade/node.d.ts +0 -1
- package/dist/upgrade/node.mjs +0 -3
- package/dist/upgrade/package-manager.d.ts +0 -1
- package/dist/upgrade/package-manager.mjs +0 -3
- package/dist/upgrade.mjs +3 -3
- package/package.json +27 -33
- package/dist/generate/package-jsons.d.ts +0 -2
- package/dist/generate/package-jsons.mjs +0 -9
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import { log } from "@stacksjs/logging";
|
|
2
1
|
import { frameworkPath } from "@stacksjs/path";
|
|
3
2
|
import { runCommand } from "@stacksjs/cli";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (result.isErr()) {
|
|
7
|
-
log.error("There was an error running `npx mkdist -d`.", result.error);
|
|
8
|
-
process.exit();
|
|
9
|
-
}
|
|
10
|
-
log.success("Building Stacks was successful.");
|
|
3
|
+
import { NpmScript } from "@stacksjs/types";
|
|
4
|
+
await runCommand(NpmScript.BuildComponents, { cwd: frameworkPath(), verbose: true });
|
package/dist/clean.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { log } from "@stacksjs/cli";
|
|
2
2
|
import { projectPath } from "@stacksjs/path";
|
|
3
3
|
import { del } from "@stacksjs/utils";
|
|
4
|
-
log.info("Running clean command..."
|
|
4
|
+
log.info("Running clean command...");
|
|
5
5
|
await del([
|
|
6
6
|
projectPath("pnpm-lock.yaml"),
|
|
7
7
|
projectPath("node_modules/"),
|
package/dist/dev/index.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import type { DevOptions } from '@stacksjs/types';
|
|
2
|
-
/**
|
|
3
|
-
* An alias of the invoke method.
|
|
4
|
-
* @param options
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export declare function dev(options: DevOptions): Promise<any>;
|
|
8
2
|
export declare function components(options: DevOptions): Promise<void>;
|
|
9
3
|
export declare function desktop(options: DevOptions): Promise<void>;
|
|
10
4
|
export declare function pages(options: DevOptions): Promise<void>;
|
package/dist/dev/index.mjs
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { log } from "@stacksjs/logging";
|
|
2
|
-
import {
|
|
2
|
+
import { frameworkPath } from "@stacksjs/path";
|
|
3
|
+
import { runCommand } from "@stacksjs/cli";
|
|
3
4
|
import { NpmScript } from "@stacksjs/types";
|
|
4
|
-
export async function dev(options) {
|
|
5
|
-
return invoke(options);
|
|
6
|
-
}
|
|
7
5
|
export async function components(options) {
|
|
8
6
|
log.info("Starting your components dev server...");
|
|
9
|
-
await
|
|
7
|
+
await runCommand(NpmScript.DevComponents, { ...options, cwd: frameworkPath() });
|
|
10
8
|
}
|
|
11
9
|
export async function desktop(options) {
|
|
12
10
|
log.info("Starting your Desktop engine...");
|
|
13
|
-
await
|
|
11
|
+
await runCommand(NpmScript.DevDesktop, options);
|
|
14
12
|
}
|
|
15
13
|
export async function pages(options) {
|
|
16
14
|
log.info("Starting your page engine...");
|
|
17
|
-
await
|
|
15
|
+
await runCommand(NpmScript.DevPages, options);
|
|
18
16
|
}
|
|
19
17
|
export async function functions(options) {
|
|
20
18
|
log.info("Starting your function's dev server...");
|
|
21
|
-
await
|
|
19
|
+
await runCommand(NpmScript.DevFunctions, options);
|
|
22
20
|
}
|
package/dist/generate/index.mjs
CHANGED
|
@@ -25,9 +25,9 @@ export async function generate(options) {
|
|
|
25
25
|
return invoke(options);
|
|
26
26
|
}
|
|
27
27
|
export async function libEntries(options) {
|
|
28
|
-
const result = await runAction(Action.
|
|
28
|
+
const result = await runAction(Action.GenerateLibraryEntries, { ...options, verbose: true, cwd: projectPath() });
|
|
29
29
|
if (result.isErr()) {
|
|
30
|
-
log.error("There was an error generating your library entry points
|
|
30
|
+
log.error("There was an error generating your library entry points", result.error);
|
|
31
31
|
process.exit();
|
|
32
32
|
}
|
|
33
33
|
log.success("Library entry points generated successfully");
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LibraryType } from '@stacksjs/path';
|
|
2
2
|
/**
|
|
3
3
|
* Based on the config values, this method
|
|
4
4
|
* will generate the library entry points.
|
|
5
5
|
*
|
|
6
|
-
* @param type
|
|
6
|
+
* @param type LibraryType
|
|
7
7
|
*/
|
|
8
|
-
export declare function generateLibEntry(type:
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function
|
|
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;
|
|
@@ -1,71 +1,80 @@
|
|
|
1
1
|
import { log } from "@stacksjs/logging";
|
|
2
|
-
import {
|
|
2
|
+
import { kebabCase } from "@stacksjs/strings";
|
|
3
|
+
import { componentsPath, functionsPath, libraryEntryPath } from "@stacksjs/path";
|
|
3
4
|
import { writeTextFile } from "@stacksjs/storage";
|
|
4
5
|
import { determineResetPreset } from "@stacksjs/utils";
|
|
5
6
|
import { library } from "@stacksjs/config";
|
|
7
|
+
import { ExitCode } from "@stacksjs/types";
|
|
6
8
|
export async function generateLibEntry(type) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
process.exit();
|
|
17
|
-
}
|
|
9
|
+
await createLibraryEntryPoint(type);
|
|
10
|
+
}
|
|
11
|
+
export async function createLibraryEntryPoint(type) {
|
|
12
|
+
if (type === "vue-components")
|
|
13
|
+
await createVueLibraryEntryPoint();
|
|
14
|
+
if (type === "web-components")
|
|
15
|
+
await createWebComponentLibraryEntryPoint();
|
|
16
|
+
if (type === "functions")
|
|
17
|
+
await createFunctionLibraryEntryPoint();
|
|
18
18
|
}
|
|
19
|
-
export async function createVueLibraryEntryPoint() {
|
|
19
|
+
export async function createVueLibraryEntryPoint(type = "vue-components") {
|
|
20
20
|
log.info("Creating the Vue component library entry point...");
|
|
21
21
|
await writeTextFile({
|
|
22
|
-
path: libraryEntryPath(
|
|
23
|
-
data: generateEntryPointData(
|
|
22
|
+
path: libraryEntryPath(type),
|
|
23
|
+
data: generateEntryPointData(type)
|
|
24
|
+
}).catch((err) => {
|
|
25
|
+
log.error(new Error("There was an error generating the Vue component library entry point.", err));
|
|
26
|
+
process.exit(ExitCode.FatalError);
|
|
24
27
|
});
|
|
25
|
-
log.success("Created the Vue component library entry point
|
|
28
|
+
log.success("Created the Vue component library entry point");
|
|
26
29
|
}
|
|
27
|
-
export async function createWebComponentLibraryEntryPoint() {
|
|
30
|
+
export async function createWebComponentLibraryEntryPoint(type = "web-components") {
|
|
28
31
|
log.info("Creating the Web Component library entry point...");
|
|
29
32
|
await writeTextFile({
|
|
30
|
-
path: libraryEntryPath(
|
|
31
|
-
data: generateEntryPointData(
|
|
33
|
+
path: libraryEntryPath(type),
|
|
34
|
+
data: generateEntryPointData(type)
|
|
35
|
+
}).catch((err) => {
|
|
36
|
+
log.error(new Error("There was an error generating the Web Component library entry point", err));
|
|
37
|
+
process.exit(ExitCode.FatalError);
|
|
32
38
|
});
|
|
33
|
-
log.success("Created Web Component library entry point
|
|
39
|
+
log.success("Created Web Component library entry point");
|
|
34
40
|
}
|
|
35
|
-
export async function createFunctionLibraryEntryPoint() {
|
|
41
|
+
export async function createFunctionLibraryEntryPoint(type = "functions") {
|
|
36
42
|
log.info("Creating the Function library entry point...");
|
|
37
43
|
await writeTextFile({
|
|
38
|
-
path: libraryEntryPath(
|
|
39
|
-
data: generateEntryPointData(
|
|
44
|
+
path: libraryEntryPath(type),
|
|
45
|
+
data: generateEntryPointData(type)
|
|
46
|
+
}).catch((err) => {
|
|
47
|
+
log.error(new Error("There was an error generating Function library entry point", err));
|
|
48
|
+
process.exit(ExitCode.FatalError);
|
|
40
49
|
});
|
|
41
|
-
log.success("Created Functions library entry point
|
|
50
|
+
log.success("Created Functions library entry point");
|
|
42
51
|
}
|
|
43
52
|
export function generateEntryPointData(type) {
|
|
44
53
|
let arr = [];
|
|
45
54
|
if (type === "functions") {
|
|
46
55
|
if (!library.functions?.functions) {
|
|
47
|
-
log.error("There are no functions defined to be built. Please check your config/library.ts file for potential adjustments
|
|
56
|
+
log.error(new Error("There are no functions defined to be built. Please check your config/library.ts file for potential adjustments"));
|
|
48
57
|
process.exit();
|
|
49
58
|
}
|
|
50
59
|
for (const fx of library.functions?.functions) {
|
|
51
60
|
if (Array.isArray(fx))
|
|
52
|
-
arr.push(`export * as ${fx[1]} from '
|
|
61
|
+
arr.push(`export * as ${fx[1]} from '${functionsPath(fx[0])}'`);
|
|
53
62
|
else
|
|
54
|
-
arr.push(`export * from '
|
|
63
|
+
arr.push(`export * from '${functionsPath(fx)}'`);
|
|
55
64
|
}
|
|
56
65
|
return arr.join("\r\n");
|
|
57
66
|
}
|
|
58
67
|
if (type === "vue-components") {
|
|
59
68
|
if (!library.vueComponents?.tags) {
|
|
60
|
-
log.error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments
|
|
69
|
+
log.error(new Error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments"));
|
|
61
70
|
process.exit();
|
|
62
71
|
}
|
|
63
72
|
arr = determineResetPreset();
|
|
64
73
|
for (const component of library.vueComponents?.tags.map((tag) => tag.name)) {
|
|
65
74
|
if (Array.isArray(component))
|
|
66
|
-
arr.push(`export { default as ${component[1]} } from '
|
|
75
|
+
arr.push(`export { default as ${component[1]} } from '${componentsPath(component[0])}.vue'`);
|
|
67
76
|
else
|
|
68
|
-
arr.push(`export { default as ${component} } from '
|
|
77
|
+
arr.push(`export { default as ${component} } from '${componentsPath(component)}.vue'`);
|
|
69
78
|
}
|
|
70
79
|
return arr.join("\r\n");
|
|
71
80
|
}
|
|
@@ -74,16 +83,16 @@ export function generateEntryPointData(type) {
|
|
|
74
83
|
const declarations = [];
|
|
75
84
|
const definitions = [];
|
|
76
85
|
if (!library.webComponents?.tags) {
|
|
77
|
-
log.error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments
|
|
86
|
+
log.error(new Error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments"));
|
|
78
87
|
process.exit();
|
|
79
88
|
}
|
|
80
89
|
for (const component of library.webComponents?.tags.map((tag) => tag.name)) {
|
|
81
90
|
if (Array.isArray(component)) {
|
|
82
|
-
imports.push(`import ${component[1]} from '
|
|
91
|
+
imports.push(`import ${component[1]} from '${componentsPath(component[0])}.vue'`);
|
|
83
92
|
declarations.push(`const ${component[1]}CustomElement = defineCustomElement(${component[1]})`);
|
|
84
93
|
definitions.push(`customElements.define('${kebabCase(component[1])}', ${component[1]}CustomElement)`);
|
|
85
94
|
} else {
|
|
86
|
-
imports.push(`import ${component} from '
|
|
95
|
+
imports.push(`import ${component} from '${componentsPath(component)}.vue'`);
|
|
87
96
|
declarations.push(`const ${component}CustomElement = defineCustomElement(${component})`);
|
|
88
97
|
definitions.push(`customElements.define('${kebabCase(component)}', ${component}CustomElement)`);
|
|
89
98
|
}
|
package/dist/helpers/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type ActionResult = CommandResult;
|
|
|
3
3
|
/**
|
|
4
4
|
* Run an Action the Stacks way.
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param action The action to invoke.
|
|
7
7
|
* @param options The options to pass to the command.
|
|
8
8
|
* @returns The result of the command.
|
|
9
9
|
*/
|
|
@@ -11,7 +11,7 @@ export declare function runAction(action: string, options?: ActionOptions): Prom
|
|
|
11
11
|
/**
|
|
12
12
|
* Run Actions the Stacks way.
|
|
13
13
|
*
|
|
14
|
-
* @param
|
|
14
|
+
* @param actions The actions to invoke.
|
|
15
15
|
* @param options The options to pass to the command.
|
|
16
16
|
* @returns The result of the command.
|
|
17
17
|
*/
|
package/dist/helpers/utils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import storage from "@stacksjs/storage";
|
|
1
|
+
import * as storage from "@stacksjs/storage";
|
|
2
2
|
import { italic, log, runCommand, runCommands } from "@stacksjs/cli";
|
|
3
3
|
import { actionsPath, functionsPath } from "@stacksjs/path";
|
|
4
4
|
import { err } from "@stacksjs/error-handling";
|
|
@@ -10,8 +10,7 @@ function parseOptions(options) {
|
|
|
10
10
|
return `-${key}=${value}`;
|
|
11
11
|
if (typeof value === "boolean" && value)
|
|
12
12
|
return `--${key}`;
|
|
13
|
-
|
|
14
|
-
return `--${key}=${value}`;
|
|
13
|
+
return `--${key}=${value}`;
|
|
15
14
|
});
|
|
16
15
|
return parsedOptions.filter(Boolean).join(" ").replace("----=", "");
|
|
17
16
|
}
|
|
@@ -37,7 +36,5 @@ export async function runActions(actions, options) {
|
|
|
37
36
|
export function hasAction(action) {
|
|
38
37
|
if (storage.isFile(functionsPath(`actions/${action}.ts`)))
|
|
39
38
|
return true;
|
|
40
|
-
|
|
41
|
-
return true;
|
|
42
|
-
return false;
|
|
39
|
+
return storage.isFile(actionsPath(`${action}.ts`));
|
|
43
40
|
}
|
package/dist/lint/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default function lintAction(): Promise<void>;
|
package/dist/lint/index.mjs
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExitCode, runCommands } from "@stacksjs/cli";
|
|
2
2
|
import { projectPath } from "@stacksjs/path";
|
|
3
3
|
import { NpmScript } from "@stacksjs/types";
|
|
4
|
-
|
|
4
|
+
export default async function lintAction() {
|
|
5
|
+
const result = await runCommands([
|
|
6
|
+
NpmScript.Lint,
|
|
7
|
+
NpmScript.LintPackageJson
|
|
8
|
+
], { cwd: projectPath(), verbose: true });
|
|
9
|
+
if (Array.isArray(result)) {
|
|
10
|
+
if (result.map((r) => r.isErr()).includes(true))
|
|
11
|
+
process.exit(ExitCode.FatalError);
|
|
12
|
+
}
|
|
13
|
+
process.exit(ExitCode.Success);
|
|
14
|
+
}
|
package/dist/make.mjs
CHANGED
|
@@ -238,23 +238,26 @@ export async function createModel(options) {
|
|
|
238
238
|
try {
|
|
239
239
|
await writeTextFile({
|
|
240
240
|
path: `${path}`,
|
|
241
|
-
data: `import { faker } from '
|
|
242
|
-
import { validate } from '
|
|
243
|
-
import type { Model } from '
|
|
241
|
+
data: `import { faker } from '@stacksjs/faker'
|
|
242
|
+
import { validate } from '@stacksjs/validation'
|
|
243
|
+
import type { Model } from '@stacksjs/types'
|
|
244
244
|
|
|
245
245
|
export default <Model> {
|
|
246
246
|
name: '${name}',
|
|
247
|
+
|
|
247
248
|
searchable: true, // boolean | IndexSettings,
|
|
248
249
|
authenticatable: true, // boolean | AuthSettings,
|
|
250
|
+
|
|
249
251
|
seeder: {
|
|
250
252
|
count: 10,
|
|
251
253
|
},
|
|
254
|
+
|
|
252
255
|
fields: {
|
|
253
256
|
name: {
|
|
254
|
-
type: 'String',
|
|
255
257
|
validation: validate.string().min(3).max(255),
|
|
256
|
-
factory: () => faker.
|
|
258
|
+
factory: () => faker.person,
|
|
257
259
|
},
|
|
260
|
+
|
|
258
261
|
// more fields here
|
|
259
262
|
},
|
|
260
263
|
}`
|
package/dist/migrate.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { migrations } from "
|
|
2
|
-
await
|
|
1
|
+
import { migrations as generateMigrations } from "./generate/index.mjs";
|
|
2
|
+
await generateMigrations();
|
package/dist/prepublish.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { NpmScript } from "@stacksjs/types";
|
|
|
5
5
|
log.info("Running prepublish command...");
|
|
6
6
|
const result = await runNpmScript(NpmScript.BuildStacks, { verbose: true, cwd: runtimePath() });
|
|
7
7
|
if (result.isErr()) {
|
|
8
|
-
log.error("There was an error while prepublishing your stack
|
|
8
|
+
log.error(new Error("There was an error while prepublishing your stack"), result.error);
|
|
9
9
|
process.exit();
|
|
10
10
|
}
|
|
11
11
|
log.success("Prepublishing completed");
|
package/dist/release.mjs
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { frameworkPath } from "@stacksjs/path";
|
|
3
|
-
import { runActions } from "@stacksjs/actions";
|
|
4
3
|
import { Action } from "@stacksjs/types";
|
|
4
|
+
import { log } from "@stacksjs/cli";
|
|
5
|
+
import { app } from "@stacksjs/config";
|
|
6
|
+
import { runActions } from ".//index.mjs";
|
|
5
7
|
await runActions([
|
|
6
|
-
Action.
|
|
7
|
-
//
|
|
8
|
+
Action.GenerateLibraryEntries,
|
|
9
|
+
// generates the package/library entry points
|
|
8
10
|
Action.LintFix,
|
|
9
11
|
// ensure there are no lint errors
|
|
10
12
|
// Action.Test, // run the tests
|
|
11
13
|
Action.Bump
|
|
12
14
|
// bump the versions, create the git tag, generate the changelog, commit & push the changes
|
|
13
15
|
], { verbose: true, cwd: frameworkPath(), shell: true });
|
|
16
|
+
log.success(`Successfully released ${app.name}`);
|
package/dist/seed.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { seeder } from "
|
|
1
|
+
import { seeder } from "./generate/index.mjs";
|
|
2
2
|
await seeder();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { log, outro } from "@stacksjs/cli";
|
|
2
|
-
import storage from "@stacksjs/storage";
|
|
3
|
-
import { determineDebugLevel, loop } from "@stacksjs/utils";
|
|
4
|
-
import { frameworkPath, projectPath } from "@stacksjs/path";
|
|
5
|
-
await checkForUncommittedChanges("./.stacks", options);
|
|
6
|
-
await downloadFrameworkUpdate(options);
|
|
7
|
-
log.info("Updating framework...");
|
|
8
|
-
const exclude = ["functions/package.json", "components/vue/package.json", "components/web/package.json", "auto-imports.d.ts", "components.d.ts", "dist"];
|
|
9
|
-
await storage.deleteFiles(frameworkPath(), exclude);
|
|
10
|
-
loop(5, async () => {
|
|
11
|
-
await storage.deleteEmptyFolders(frameworkPath());
|
|
12
|
-
});
|
|
13
|
-
await storage.copyFolder(frameworkPath(), projectPath("./updates/.stacks"), exclude);
|
|
14
|
-
if (determineDebugLevel(options))
|
|
15
|
-
log.info("Cleanup...");
|
|
16
|
-
await storage.deleteFolder(projectPath("updates"));
|
|
17
|
-
outro("Framework updated", { startTime: perf, useSeconds: true });
|
|
18
|
-
process.exit();
|
package/dist/upgrade/index.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/upgrade/index.mjs
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ExitCode, parseArgs } from "@stacksjs/cli";
|
|
2
|
-
import { Action } from "@stacksjs/types";
|
|
3
|
-
import { runAction } from "../helpers/index.mjs";
|
|
4
|
-
const options = parseArgs();
|
|
5
|
-
console.log("here is opt", options);
|
|
6
|
-
if (options?.packageManager || options?.all)
|
|
7
|
-
await runAction(Action.UpgradePackageManager, options);
|
|
8
|
-
if (options?.node || options?.all)
|
|
9
|
-
await runAction(Action.UpgradeNode, options);
|
|
10
|
-
else
|
|
11
|
-
process.exit(ExitCode.InvalidArgument);
|
package/dist/upgrade/node.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/upgrade/node.mjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/upgrade.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { intro, log, outro,
|
|
2
|
-
import storage from "@stacksjs/storage";
|
|
1
|
+
import { intro, log, outro, runCommand, spawn } from "@stacksjs/cli";
|
|
2
|
+
import * as storage from "@stacksjs/storage";
|
|
3
3
|
import { determineDebugLevel } from "@stacksjs/utils";
|
|
4
4
|
import { projectPath } from "@stacksjs/path";
|
|
5
5
|
import { ExitCode, NpmScript } from "@stacksjs/types";
|
|
@@ -10,7 +10,7 @@ export async function checkForUncommittedChanges(path = "./.stacks", options) {
|
|
|
10
10
|
} catch (error) {
|
|
11
11
|
if (error.status === 1) {
|
|
12
12
|
if (!options?.force) {
|
|
13
|
-
const confirmed = await prompt("We detected there are uncommitted in the ./stacks folder. Do you want to overwrite those?", {
|
|
13
|
+
const confirmed = await log.prompt("We detected there are uncommitted in the ./stacks folder. Do you want to overwrite those?", {
|
|
14
14
|
type: "confirm"
|
|
15
15
|
});
|
|
16
16
|
if (!confirmed) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/actions",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@8.5
|
|
4
|
+
"version": "0.56.3",
|
|
5
|
+
"packageManager": "pnpm@8.6.5",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -77,10 +77,6 @@
|
|
|
77
77
|
"types": "./dist/generate/lib-entries.d.ts",
|
|
78
78
|
"import": "./dist/generate/lib-entries.mjs"
|
|
79
79
|
},
|
|
80
|
-
"./generate/package-jsons": {
|
|
81
|
-
"types": "./dist/generate/package-jsons.d.ts",
|
|
82
|
-
"import": "./dist/generate/package-jsons.mjs"
|
|
83
|
-
},
|
|
84
80
|
"./generate/settings": {
|
|
85
81
|
"types": "./dist/generate/settings.d.ts",
|
|
86
82
|
"import": "./dist/generate/settings.mjs"
|
|
@@ -239,40 +235,38 @@
|
|
|
239
235
|
],
|
|
240
236
|
"peerDependencies": {
|
|
241
237
|
"markdown-it": "^13.0.1",
|
|
242
|
-
"vue-component-meta": "^1.
|
|
243
|
-
"@stacksjs/cli": "0.
|
|
244
|
-
"@stacksjs/
|
|
245
|
-
"@stacksjs/
|
|
246
|
-
"@stacksjs/
|
|
247
|
-
"@stacksjs/
|
|
248
|
-
"@stacksjs/
|
|
249
|
-
"@stacksjs/
|
|
250
|
-
"@stacksjs/
|
|
251
|
-
"@stacksjs/
|
|
252
|
-
"@stacksjs/
|
|
253
|
-
"@stacksjs/
|
|
238
|
+
"vue-component-meta": "^1.8.2",
|
|
239
|
+
"@stacksjs/cli": "0.56.3",
|
|
240
|
+
"@stacksjs/database": "0.56.3",
|
|
241
|
+
"@stacksjs/config": "0.56.3",
|
|
242
|
+
"@stacksjs/logging": "0.56.3",
|
|
243
|
+
"@stacksjs/path": "0.56.3",
|
|
244
|
+
"@stacksjs/storage": "0.56.3",
|
|
245
|
+
"@stacksjs/security": "0.56.3",
|
|
246
|
+
"@stacksjs/utils": "0.56.3",
|
|
247
|
+
"@stacksjs/types": "0.56.3",
|
|
248
|
+
"@stacksjs/pages": "0.56.3",
|
|
249
|
+
"@stacksjs/error-handling": "0.56.3"
|
|
254
250
|
},
|
|
255
251
|
"dependencies": {
|
|
256
252
|
"fast-glob": "^3.2.12",
|
|
257
253
|
"fs-extra": "^11.1.1",
|
|
258
254
|
"markdown-it": "^13.0.1",
|
|
259
|
-
"vue-component-meta": "^1.
|
|
260
|
-
"@stacksjs/cli": "0.
|
|
261
|
-
"@stacksjs/
|
|
262
|
-
"@stacksjs/
|
|
263
|
-
"@stacksjs/
|
|
264
|
-
"@stacksjs/logging": "0.
|
|
265
|
-
"@stacksjs/
|
|
266
|
-
"@stacksjs/
|
|
267
|
-
"@stacksjs/
|
|
268
|
-
"@stacksjs/
|
|
269
|
-
"@stacksjs/
|
|
270
|
-
"@stacksjs/
|
|
255
|
+
"vue-component-meta": "^1.8.2",
|
|
256
|
+
"@stacksjs/cli": "0.56.3",
|
|
257
|
+
"@stacksjs/error-handling": "0.56.3",
|
|
258
|
+
"@stacksjs/config": "0.56.3",
|
|
259
|
+
"@stacksjs/database": "0.56.3",
|
|
260
|
+
"@stacksjs/logging": "0.56.3",
|
|
261
|
+
"@stacksjs/path": "0.56.3",
|
|
262
|
+
"@stacksjs/security": "0.56.3",
|
|
263
|
+
"@stacksjs/storage": "0.56.3",
|
|
264
|
+
"@stacksjs/strings": "0.56.3",
|
|
265
|
+
"@stacksjs/utils": "0.56.3",
|
|
266
|
+
"@stacksjs/pages": "0.56.3"
|
|
271
267
|
},
|
|
272
268
|
"devDependencies": {
|
|
273
|
-
"
|
|
274
|
-
"@stacksjs/development": "0.52.10",
|
|
275
|
-
"@stacksjs/types": "0.52.10"
|
|
269
|
+
"@stacksjs/development": "0.56.3"
|
|
276
270
|
},
|
|
277
271
|
"scripts": {
|
|
278
272
|
"build": "unbuild",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { hasComponents, hasFunctions } from "@stacksjs/storage";
|
|
3
|
-
import { generatePackageJson } from "../helpers/package-json.mjs";
|
|
4
|
-
if (hasComponents()) {
|
|
5
|
-
await generatePackageJson("vue-components");
|
|
6
|
-
await generatePackageJson("web-components");
|
|
7
|
-
}
|
|
8
|
-
if (hasFunctions())
|
|
9
|
-
await generatePackageJson("functions");
|