@stacksjs/actions 0.44.12 → 0.45.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/build-core.d.ts +1 -0
- package/dist/build-core.mjs +6 -0
- package/dist/bump.d.ts +1 -0
- package/dist/bump.mjs +6 -0
- package/dist/fix-lint-issues.d.ts +1 -0
- package/dist/fix-lint-issues.mjs +3 -0
- package/dist/fresh.mjs +4 -1
- package/dist/{generate-package-json.d.ts → generate-package-jsons.d.ts} +0 -0
- package/dist/{generate-package-json.mjs → generate-package-jsons.mjs} +0 -0
- package/dist/generate.mjs +5 -5
- package/dist/helpers/lib-entries.mjs +1 -1
- package/dist/helpers/package-json.mjs +1 -1
- package/dist/helpers/utils.d.ts +12 -3
- package/dist/helpers/utils.mjs +13 -3
- package/dist/lint-fix.d.ts +1 -0
- package/dist/lint-fix.mjs +7 -0
- package/dist/lint.d.ts +1 -4
- package/dist/lint.mjs +6 -25
- package/dist/make.mjs +8 -8
- package/dist/release.mjs +7 -19
- package/package.json +11 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { frameworkPath } from "@stacksjs/path";
|
|
2
|
+
import { runCommands } from "@stacksjs/cli";
|
|
3
|
+
await runCommands([
|
|
4
|
+
"pnpm --filter './core/**' --filter='!./core/config' --filter='!./core/x-ray' build",
|
|
5
|
+
"pnpm --filter '../core/config' build"
|
|
6
|
+
], { debug: true, cwd: frameworkPath() });
|
package/dist/bump.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/bump.mjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { runCommand } from "@stacksjs/cli";
|
|
2
|
+
import { frameworkPath } from "@stacksjs/path";
|
|
3
|
+
await runCommand(
|
|
4
|
+
"npx bumpp ./package.json ./buddy/package.json ./core/**/package.json ./vscode/package.json --execute 'pnpm run changelog' --all",
|
|
5
|
+
{ debug: true, cwd: frameworkPath(), shell: true }
|
|
6
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/fresh.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { runCommands } from "@stacksjs/cli";
|
|
2
2
|
import { frameworkPath } from "@stacksjs/path";
|
|
3
|
-
await runCommands([
|
|
3
|
+
await runCommands([
|
|
4
|
+
"pnpm run clean",
|
|
5
|
+
"pnpm install"
|
|
6
|
+
], { cwd: frameworkPath(), debug: true });
|
|
File without changes
|
|
File without changes
|
package/dist/generate.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { log } from "@stacksjs/logging";
|
|
2
|
-
import { NpmScript } from "@stacksjs/types";
|
|
2
|
+
import { Action, NpmScript } from "@stacksjs/types";
|
|
3
3
|
import { runNpmScript } from "@stacksjs/utils";
|
|
4
4
|
import { projectPath } from "@stacksjs/path";
|
|
5
5
|
import { runCommand } from "@stacksjs/cli";
|
|
6
|
-
import {
|
|
6
|
+
import { runAction } from "./helpers/index.mjs";
|
|
7
7
|
export async function invoke(options) {
|
|
8
8
|
if (options?.types)
|
|
9
9
|
await types(options);
|
|
@@ -53,7 +53,7 @@ export async function vsCodeCustomData(options) {
|
|
|
53
53
|
log.error("There was an error generating the custom-elements.json file.", result.error);
|
|
54
54
|
process.exit();
|
|
55
55
|
}
|
|
56
|
-
await
|
|
56
|
+
await runAction(Action.LintFix, { debug: true });
|
|
57
57
|
log.success("Successfully generated the custom-elements.json file");
|
|
58
58
|
}
|
|
59
59
|
export async function ideHelpers(options) {
|
|
@@ -62,7 +62,7 @@ export async function ideHelpers(options) {
|
|
|
62
62
|
log.error("There was an error generating IDE helpers.", result.error);
|
|
63
63
|
process.exit();
|
|
64
64
|
}
|
|
65
|
-
await
|
|
65
|
+
await runAction(Action.LintFix, { debug: true });
|
|
66
66
|
log.success("Successfully generated IDE helpers");
|
|
67
67
|
}
|
|
68
68
|
export async function componentMeta(options) {
|
|
@@ -71,7 +71,7 @@ export async function componentMeta(options) {
|
|
|
71
71
|
log.error("There was an error generating your component meta information.", result.error);
|
|
72
72
|
process.exit();
|
|
73
73
|
}
|
|
74
|
-
await
|
|
74
|
+
await runAction(Action.LintFix, { debug: true });
|
|
75
75
|
log.success("Successfully generated component meta information");
|
|
76
76
|
}
|
|
77
77
|
export async function types(options) {
|
|
@@ -22,7 +22,7 @@ export async function createVueLibraryEntryPoint() {
|
|
|
22
22
|
path: libraryEntryPath("vue-components"),
|
|
23
23
|
data: generateEntryPointData("vue-components")
|
|
24
24
|
});
|
|
25
|
-
log.success("Created Vue component library entry point.");
|
|
25
|
+
log.success("Created the Vue component library entry point.");
|
|
26
26
|
}
|
|
27
27
|
export async function createWebComponentLibraryEntryPoint() {
|
|
28
28
|
log.info("Creating the Web Component library entry point...");
|
|
@@ -76,7 +76,7 @@ export async function generatePackageJson(type) {
|
|
|
76
76
|
prettyName = "Web Component library";
|
|
77
77
|
else if (type === "functions")
|
|
78
78
|
prettyName = "Function Library";
|
|
79
|
-
log.success(`Created ${prettyName} package.json
|
|
79
|
+
log.success(`Created the ${prettyName} package.json file.`);
|
|
80
80
|
} catch (err) {
|
|
81
81
|
log.error(`There was an error creating the ${prettyName} package.json.`, err);
|
|
82
82
|
}
|
package/dist/helpers/utils.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
import type { CliOptions } from '@stacksjs/types';
|
|
1
|
+
import type { CliOptions, CommandResult } from '@stacksjs/types';
|
|
2
|
+
import type { Err, Result } from '@stacksjs/error-handling';
|
|
2
3
|
/**
|
|
3
|
-
* Run
|
|
4
|
+
* Run an Action the Stacks way.
|
|
4
5
|
*
|
|
5
6
|
* @param command The action to invoke.
|
|
6
7
|
* @param options The options to pass to the command.
|
|
7
8
|
* @returns The result of the command.
|
|
8
9
|
*/
|
|
9
|
-
export declare function runAction(action: string, options?: CliOptions): Promise<
|
|
10
|
+
export declare function runAction(action: string, options?: CliOptions): Promise<Result<CommandResult<string>, Error> | Err<CommandResult<string>, string>>;
|
|
11
|
+
/**
|
|
12
|
+
* Run Actions the Stacks way.
|
|
13
|
+
*
|
|
14
|
+
* @param command The action to invoke.
|
|
15
|
+
* @param options The options to pass to the command.
|
|
16
|
+
* @returns The result of the command.
|
|
17
|
+
*/
|
|
18
|
+
export declare function runActions(actions: string[], options?: CliOptions): Promise<Result<CommandResult<string>, Error>[] | Result<CommandResult<string>, Error> | Err<CommandResult<string>, string>>;
|
|
10
19
|
export declare function hasAction(action: string): boolean;
|
package/dist/helpers/utils.mjs
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import storage from "@stacksjs/storage";
|
|
2
|
-
import { runCommand } from "@stacksjs/cli";
|
|
2
|
+
import { runCommand, runCommands } from "@stacksjs/cli";
|
|
3
3
|
import { actionsPath, functionsPath } from "@stacksjs/path";
|
|
4
4
|
import { err } from "@stacksjs/error-handling";
|
|
5
5
|
export async function runAction(action, options) {
|
|
6
6
|
if (!hasAction(action))
|
|
7
|
-
return err(`The specified action "${action}" does not exist
|
|
7
|
+
return err(`The specified action "${action}" does not exist.`);
|
|
8
8
|
const cmd = `npx esno ${actionsPath(`${action}.ts`)}`;
|
|
9
|
-
return await runCommand(cmd, options);
|
|
9
|
+
return options?.shouldShowSpinner ? await runCommands([cmd], options) : await runCommand(cmd, options);
|
|
10
|
+
}
|
|
11
|
+
export async function runActions(actions, options) {
|
|
12
|
+
if (!actions.length)
|
|
13
|
+
return err("No actions were specified");
|
|
14
|
+
for (const action of actions) {
|
|
15
|
+
if (!hasAction(action))
|
|
16
|
+
return err(`The specified action "${action}" does not exist`);
|
|
17
|
+
}
|
|
18
|
+
const commands = actions.map((action) => `npx esno ${actionsPath(`${action}.ts`)}`);
|
|
19
|
+
return await runCommands(commands, options);
|
|
10
20
|
}
|
|
11
21
|
export function hasAction(action) {
|
|
12
22
|
if (storage.isFile(functionsPath(`actions/${action}.ts`)))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { runAction } from "@stacksjs/actions";
|
|
2
|
+
import { log } from "@stacksjs/cli";
|
|
3
|
+
import { projectPath } from "@stacksjs/path";
|
|
4
|
+
import { Action } from "@stacksjs/types";
|
|
5
|
+
log.info("Linting your project.");
|
|
6
|
+
await runAction(Action.FixLintIssues, { cwd: projectPath(), shouldShowSpinner: true, spinnerText: "Linting..." });
|
|
7
|
+
log.success("Linted your project.");
|
package/dist/lint.d.ts
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function invoke(options: LintOptions): Promise<void>;
|
|
3
|
-
export declare function lint(options: LintOptions): Promise<void>;
|
|
4
|
-
export declare function lintFix(options?: LintOptions): Promise<void>;
|
|
1
|
+
export {};
|
package/dist/lint.mjs
CHANGED
|
@@ -1,28 +1,9 @@
|
|
|
1
|
-
import { log } from "@stacksjs/logging";
|
|
2
1
|
import { intro, outro, runCommand } from "@stacksjs/cli";
|
|
3
|
-
import { runNpmScript } from "@stacksjs/utils";
|
|
4
2
|
import { ExitCode, NpmScript } from "@stacksjs/types";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
export async function lint(options) {
|
|
12
|
-
const perf = intro("buddy lint");
|
|
13
|
-
const result = await runCommand(NpmScript.Lint, { ...options, debug: true });
|
|
14
|
-
if (result.isErr()) {
|
|
15
|
-
outro("While running `buddy lint`, there was an issue", { startTime: perf, useSeconds: true, isError: true });
|
|
16
|
-
process.exit(ExitCode.FatalError);
|
|
17
|
-
}
|
|
18
|
-
outro("Linted", { startTime: perf, useSeconds: true });
|
|
19
|
-
}
|
|
20
|
-
export async function lintFix(options) {
|
|
21
|
-
log.info("Fixing lint errors...");
|
|
22
|
-
const result = await runNpmScript(NpmScript.LintFix, options);
|
|
23
|
-
if (result.isErr()) {
|
|
24
|
-
log.error("There was an error lint fixing your code.", result.error);
|
|
25
|
-
process.exit();
|
|
26
|
-
}
|
|
27
|
-
log.success("Fixed lint errors");
|
|
3
|
+
const perf = intro("buddy lint");
|
|
4
|
+
const result = await runCommand(NpmScript.Lint, { cwd: frameworkPath(), debug: true });
|
|
5
|
+
if (result.isErr()) {
|
|
6
|
+
outro("While running `buddy lint`, there was an issue", { startTime: perf, useSeconds: true, isError: true });
|
|
7
|
+
process.exit(ExitCode.FatalError);
|
|
28
8
|
}
|
|
9
|
+
outro("Linted", { startTime: perf, useSeconds: true });
|
package/dist/make.mjs
CHANGED
|
@@ -29,7 +29,7 @@ export async function component(options) {
|
|
|
29
29
|
const name = options.name;
|
|
30
30
|
log.info("Creating your component...");
|
|
31
31
|
await createComponent(options);
|
|
32
|
-
log.success(`Created ${italic(name)} component
|
|
32
|
+
log.success(`Created the ${italic(name)} component.`);
|
|
33
33
|
} catch (error) {
|
|
34
34
|
log.error("There was an error creating your component.", error);
|
|
35
35
|
process.exit();
|
|
@@ -57,7 +57,7 @@ export async function database(options) {
|
|
|
57
57
|
const name = options.name;
|
|
58
58
|
log.info(`Creating your ${italic(name)} database...`);
|
|
59
59
|
await createDatabase(options);
|
|
60
|
-
log.success(`Created ${italic(name)} database
|
|
60
|
+
log.success(`Created the ${italic(name)} database.`);
|
|
61
61
|
} catch (error) {
|
|
62
62
|
log.error("There was an error creating your database.", error);
|
|
63
63
|
process.exit();
|
|
@@ -71,7 +71,7 @@ export async function factory(options) {
|
|
|
71
71
|
const name = options.name;
|
|
72
72
|
log.info(`Creating your ${italic(name)} factory...`);
|
|
73
73
|
await createDatabase(options);
|
|
74
|
-
log.success(`Created ${italic(name)} factory
|
|
74
|
+
log.success(`Created the ${italic(name)} factory.`);
|
|
75
75
|
} catch (error) {
|
|
76
76
|
log.error("There was an error creating your factory.", error);
|
|
77
77
|
process.exit();
|
|
@@ -85,7 +85,7 @@ export async function migration(options) {
|
|
|
85
85
|
const name = options.name;
|
|
86
86
|
log.info(`Creating your ${italic(name)} migration...`);
|
|
87
87
|
await createMigration(options);
|
|
88
|
-
log.success(`Created ${italic(name)} migration
|
|
88
|
+
log.success(`Created the ${italic(name)} migration.`);
|
|
89
89
|
} catch (error) {
|
|
90
90
|
log.error("There was an error creating your migration.", error);
|
|
91
91
|
process.exit();
|
|
@@ -99,7 +99,7 @@ export async function notification(options) {
|
|
|
99
99
|
const name = options.name;
|
|
100
100
|
log.info(`Creating your ${italic(name)} notification...`);
|
|
101
101
|
await createNotification(options);
|
|
102
|
-
log.success(`Created ${italic(name)} notification
|
|
102
|
+
log.success(`Created the ${italic(name)} notification.`);
|
|
103
103
|
} catch (error) {
|
|
104
104
|
log.error("There was an error creating your notification.", error);
|
|
105
105
|
process.exit();
|
|
@@ -113,7 +113,7 @@ export async function page(options) {
|
|
|
113
113
|
const name = options.name;
|
|
114
114
|
log.info("Creating your page...");
|
|
115
115
|
createPage(options);
|
|
116
|
-
log.success(`Created ${name} page
|
|
116
|
+
log.success(`Created the ${name} page.`);
|
|
117
117
|
} catch (error) {
|
|
118
118
|
log.error("There was an error creating your page.", error);
|
|
119
119
|
process.exit();
|
|
@@ -141,7 +141,7 @@ export async function fx(options) {
|
|
|
141
141
|
const name = options.name;
|
|
142
142
|
log.info("Creating your function...");
|
|
143
143
|
await createFunction(options);
|
|
144
|
-
log.success(`Created ${name} function
|
|
144
|
+
log.success(`Created the ${name} function.`);
|
|
145
145
|
} catch (error) {
|
|
146
146
|
log.error("There was an error creating your function.", error);
|
|
147
147
|
process.exit();
|
|
@@ -171,7 +171,7 @@ export async function language(options) {
|
|
|
171
171
|
const name = options.name;
|
|
172
172
|
log.info("Creating your translation file...");
|
|
173
173
|
createLanguage(options);
|
|
174
|
-
log.success(`Created ${name} translation file
|
|
174
|
+
log.success(`Created the ${name} translation file.`);
|
|
175
175
|
} catch (error) {
|
|
176
176
|
log.error("There was an error creating your language.", error);
|
|
177
177
|
process.exit();
|
package/dist/release.mjs
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { frameworkPath } from "@stacksjs/path";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
process.exit();
|
|
11
|
-
}
|
|
12
|
-
result = await runNpmScript(NpmScript.LintFix, { debug: true, cwd: frameworkPath() });
|
|
13
|
-
if (result.isErr()) {
|
|
14
|
-
log.error("There was an error while releasing your stack, during the process of fixing your lint errors.", result.error);
|
|
15
|
-
process.exit();
|
|
16
|
-
}
|
|
17
|
-
result = await runNpmScript(NpmScript.Release, { debug: true, cwd: frameworkPath() });
|
|
18
|
-
if (result.isErr()) {
|
|
19
|
-
log.error("There was an error while releasing your stack.", result.error);
|
|
20
|
-
process.exit();
|
|
21
|
-
}
|
|
3
|
+
import { runActions } from "@stacksjs/actions";
|
|
4
|
+
import { Action } from "@stacksjs/types";
|
|
5
|
+
await runActions([
|
|
6
|
+
Action.GeneratePackageJsons,
|
|
7
|
+
Action.LintFix,
|
|
8
|
+
Action.Bump
|
|
9
|
+
], { debug: true, cwd: frameworkPath() });
|
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.45.1",
|
|
5
5
|
"packageManager": "pnpm@7.18.2",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"markdown-it": "^13.0.1",
|
|
44
|
-
"vue-component-meta": "^1.0.
|
|
45
|
-
"@stacksjs/cli": "0.
|
|
46
|
-
"@stacksjs/config": "0.
|
|
47
|
-
"@stacksjs/logging": "0.
|
|
48
|
-
"@stacksjs/path": "0.
|
|
49
|
-
"@stacksjs/storage": "0.
|
|
50
|
-
"@stacksjs/types": "0.
|
|
51
|
-
"@stacksjs/utils": "0.
|
|
44
|
+
"vue-component-meta": "^1.0.16",
|
|
45
|
+
"@stacksjs/cli": "0.45.1",
|
|
46
|
+
"@stacksjs/config": "0.45.1",
|
|
47
|
+
"@stacksjs/logging": "0.45.1",
|
|
48
|
+
"@stacksjs/path": "0.45.1",
|
|
49
|
+
"@stacksjs/storage": "0.45.1",
|
|
50
|
+
"@stacksjs/types": "0.45.1",
|
|
51
|
+
"@stacksjs/utils": "0.45.1"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"esno": "^0.16.3",
|
|
55
|
-
"@stacksjs/strings": "0.
|
|
55
|
+
"@stacksjs/strings": "0.45.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"mkdist": "^1.0.0",
|
|
59
59
|
"typescript": "^4.9.4",
|
|
60
|
-
"@stacksjs/testing": "0.
|
|
60
|
+
"@stacksjs/testing": "0.45.1"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "mkdist -d",
|