@stacksjs/actions 0.43.1 → 0.44.7

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 (50) hide show
  1. package/README.md +1 -3
  2. package/dist/add.d.ts +11 -0
  3. package/dist/add.mjs +20 -0
  4. package/dist/build.d.ts +14 -0
  5. package/dist/build.mjs +68 -0
  6. package/dist/clean.d.ts +8 -0
  7. package/dist/clean.mjs +15 -0
  8. package/dist/commit.d.ts +8 -0
  9. package/dist/commit.mjs +11 -0
  10. package/dist/dev.d.ts +13 -0
  11. package/dist/dev.mjs +38 -0
  12. package/dist/examples.d.ts +10 -0
  13. package/dist/examples.mjs +33 -0
  14. package/dist/fresh.d.ts +8 -0
  15. package/dist/fresh.mjs +17 -0
  16. package/dist/generate-component-meta.mjs +1 -1
  17. package/dist/generate-ide-helpers.mjs +1 -1
  18. package/dist/generate-lib-entries.mjs +1 -1
  19. package/dist/generate-vscode-custom-data.mjs +1 -1
  20. package/dist/generate.d.ts +15 -0
  21. package/dist/generate.mjs +84 -0
  22. package/dist/helpers/index.d.ts +6 -0
  23. package/dist/helpers/index.mjs +6 -0
  24. package/dist/helpers/lib-entries.d.ts +1 -1
  25. package/dist/helpers/lib-entries.mjs +9 -11
  26. package/dist/helpers/package-json.mjs +5 -6
  27. package/dist/helpers/utils.d.ts +10 -0
  28. package/dist/helpers/utils.mjs +17 -0
  29. package/dist/helpers/vscode-custom-data.mjs +2 -2
  30. package/dist/index.d.ts +1 -5
  31. package/dist/index.mjs +1 -5
  32. package/dist/key.d.ts +10 -0
  33. package/dist/key.mjs +31 -0
  34. package/dist/lint.d.ts +4 -0
  35. package/dist/lint.mjs +28 -0
  36. package/dist/make.d.ts +25 -0
  37. package/dist/make.mjs +201 -0
  38. package/dist/preinstall.d.ts +8 -0
  39. package/dist/preinstall.mjs +17 -0
  40. package/dist/prepublish.d.ts +1 -0
  41. package/dist/prepublish.mjs +11 -0
  42. package/dist/release.d.ts +2 -0
  43. package/dist/release.mjs +21 -0
  44. package/dist/test.d.ts +11 -0
  45. package/dist/test.mjs +43 -0
  46. package/dist/types.d.ts +8 -0
  47. package/dist/types.mjs +14 -0
  48. package/dist/update.d.ts +14 -0
  49. package/dist/update.mjs +100 -0
  50. package/package.json +17 -13
package/dist/key.mjs ADDED
@@ -0,0 +1,31 @@
1
+ import { getRandomValues } from "node:crypto";
2
+ import { log, runCommand } from "@stacksjs/cli";
3
+ import { setEnvValue } from "@stacksjs/utils";
4
+ import { isFile } from "@stacksjs/storage";
5
+ import utf8 from "crypto-js/enc-utf8";
6
+ import base64 from "crypto-js/enc-base64";
7
+ export async function invoke(options) {
8
+ await generate(options);
9
+ }
10
+ export async function key(options) {
11
+ return invoke(options);
12
+ }
13
+ export async function generate(options) {
14
+ try {
15
+ log.info("Setting random application key.");
16
+ if (!isFile(".env"))
17
+ await runCommand("cp .env.example .env", options);
18
+ await setEnvValue("APP_KEY", await generateAppKey());
19
+ log.success("Application key set");
20
+ return true;
21
+ } catch (error) {
22
+ log.error("There was an error generating your key.", error);
23
+ process.exit();
24
+ }
25
+ }
26
+ export async function generateAppKey() {
27
+ const random = getRandomValues(new Uint8Array(32));
28
+ const encodedWord = utf8.parse(random.toString());
29
+ const key2 = base64.stringify(encodedWord);
30
+ return `base64:${key2}`;
31
+ }
package/dist/lint.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { LintOptions } from '@stacksjs/types';
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>;
package/dist/lint.mjs ADDED
@@ -0,0 +1,28 @@
1
+ import { log } from "@stacksjs/logging";
2
+ import { intro, outro, runCommand } from "@stacksjs/cli";
3
+ import { runNpmScript } from "@stacksjs/utils";
4
+ import { ExitCode, NpmScript } from "@stacksjs/types";
5
+ export async function invoke(options) {
6
+ if (options?.fix)
7
+ await lintFix(options);
8
+ else
9
+ await lint(options);
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");
28
+ }
package/dist/make.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import type { MakeOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: MakeOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function make(options: MakeOptions): Promise<void>;
9
+ export declare function component(options: MakeOptions): Promise<void>;
10
+ export declare function createComponent(options: MakeOptions): Promise<void>;
11
+ export declare function database(options: MakeOptions): Promise<void>;
12
+ export declare function createDatabase(options: MakeOptions): Promise<void>;
13
+ export declare function factory(options: MakeOptions): Promise<void>;
14
+ export declare function createFactory(options: MakeOptions): Promise<void>;
15
+ export declare function migration(options: MakeOptions): Promise<void>;
16
+ export declare function createMigration(options: MakeOptions): Promise<void>;
17
+ export declare function notification(options: MakeOptions): Promise<void>;
18
+ export declare function createNotification(options: MakeOptions): Promise<void>;
19
+ export declare function page(options: MakeOptions): Promise<void>;
20
+ export declare function createPage(options: MakeOptions): Promise<void>;
21
+ export declare function fx(options: MakeOptions): Promise<void>;
22
+ export declare function createFunction(options: MakeOptions): Promise<void>;
23
+ export declare function language(options: MakeOptions): Promise<void>;
24
+ export declare function createLanguage(options: MakeOptions): Promise<void>;
25
+ export declare function stack(options: MakeOptions): Promise<void>;
package/dist/make.mjs ADDED
@@ -0,0 +1,201 @@
1
+ import { italic, log, spawn } from "@stacksjs/cli";
2
+ import { writeTextFile } from "@stacksjs/storage";
3
+ import { resolve } from "@stacksjs/path";
4
+ export async function invoke(options) {
5
+ if (options.component)
6
+ await component(options);
7
+ if (options.database)
8
+ await database(options);
9
+ if (options.factory)
10
+ await factory(options);
11
+ if (options.function)
12
+ await fx(options);
13
+ if (options.language)
14
+ await language(options);
15
+ if (options.migration)
16
+ await migration(options);
17
+ if (options.notification)
18
+ await notification(options);
19
+ if (options.page)
20
+ await page(options);
21
+ if (options.stack)
22
+ await stack(options);
23
+ }
24
+ export async function make(options) {
25
+ return invoke(options);
26
+ }
27
+ export async function component(options) {
28
+ try {
29
+ const name = options.name;
30
+ log.info("Creating your component...");
31
+ await createComponent(options);
32
+ log.success(`Created ${italic(name)} component`);
33
+ } catch (error) {
34
+ log.error("There was an error creating your component.", error);
35
+ process.exit();
36
+ }
37
+ }
38
+ export async function createComponent(options) {
39
+ const name = options.name;
40
+ await writeTextFile({
41
+ path: `./components/${name}.vue`,
42
+ data: `<script setup lang="ts">
43
+ // eslint-disable-next-line no-console
44
+ console.log('Hello World component created')
45
+ <\/script>
46
+
47
+ <template>
48
+ <div>
49
+ Some HTML block
50
+ </div>
51
+ </template>
52
+ `
53
+ });
54
+ }
55
+ export async function database(options) {
56
+ try {
57
+ const name = options.name;
58
+ log.info(`Creating your ${italic(name)} database...`);
59
+ await createDatabase(options);
60
+ log.success(`Created ${italic(name)} database`);
61
+ } catch (error) {
62
+ log.error("There was an error creating your database.", error);
63
+ process.exit();
64
+ }
65
+ }
66
+ export async function createDatabase(options) {
67
+ console.log("options", options);
68
+ }
69
+ export async function factory(options) {
70
+ try {
71
+ const name = options.name;
72
+ log.info(`Creating your ${italic(name)} factory...`);
73
+ await createDatabase(options);
74
+ log.success(`Created ${italic(name)} factory`);
75
+ } catch (error) {
76
+ log.error("There was an error creating your factory.", error);
77
+ process.exit();
78
+ }
79
+ }
80
+ export async function createFactory(options) {
81
+ console.log("options", options);
82
+ }
83
+ export async function migration(options) {
84
+ try {
85
+ const name = options.name;
86
+ log.info(`Creating your ${italic(name)} migration...`);
87
+ await createMigration(options);
88
+ log.success(`Created ${italic(name)} migration`);
89
+ } catch (error) {
90
+ log.error("There was an error creating your migration.", error);
91
+ process.exit();
92
+ }
93
+ }
94
+ export async function createMigration(options) {
95
+ console.log("options", options);
96
+ }
97
+ export async function notification(options) {
98
+ try {
99
+ const name = options.name;
100
+ log.info(`Creating your ${italic(name)} notification...`);
101
+ await createNotification(options);
102
+ log.success(`Created ${italic(name)} notification`);
103
+ } catch (error) {
104
+ log.error("There was an error creating your notification.", error);
105
+ process.exit();
106
+ }
107
+ }
108
+ export async function createNotification(options) {
109
+ console.log("options", options);
110
+ }
111
+ export async function page(options) {
112
+ try {
113
+ const name = options.name;
114
+ log.info("Creating your page...");
115
+ createPage(options);
116
+ log.success(`Created ${name} page`);
117
+ } catch (error) {
118
+ log.error("There was an error creating your page.", error);
119
+ process.exit();
120
+ }
121
+ }
122
+ export async function createPage(options) {
123
+ const name = options.name;
124
+ await writeTextFile({
125
+ path: `./pages/${name}.vue`,
126
+ data: `<script setup lang="ts">
127
+ // eslint-disable-next-line no-console
128
+ console.log('Hello World page created')
129
+ <\/script>
130
+
131
+ <template>
132
+ <div>
133
+ Visit http://127.0.0.1/${name}
134
+ </div>
135
+ </template>
136
+ `
137
+ });
138
+ }
139
+ export async function fx(options) {
140
+ try {
141
+ const name = options.name;
142
+ log.info("Creating your function...");
143
+ await createFunction(options);
144
+ log.success(`Created ${name} function`);
145
+ } catch (error) {
146
+ log.error("There was an error creating your function.", error);
147
+ process.exit();
148
+ }
149
+ }
150
+ export async function createFunction(options) {
151
+ const name = options.name;
152
+ await writeTextFile({
153
+ path: `./functions/${name}.ts`,
154
+ data: `// reactive state
155
+ const ${name} = ref(0)
156
+
157
+ // functions that mutate state and trigger updates
158
+ function increment() {
159
+ ${name}.value++
160
+ }
161
+
162
+ export {
163
+ ${name},
164
+ increment,
165
+ }
166
+ `
167
+ });
168
+ }
169
+ export async function language(options) {
170
+ try {
171
+ const name = options.name;
172
+ log.info("Creating your translation file...");
173
+ createLanguage(options);
174
+ log.success(`Created ${name} translation file`);
175
+ } catch (error) {
176
+ log.error("There was an error creating your language.", error);
177
+ process.exit();
178
+ }
179
+ }
180
+ export async function createLanguage(options) {
181
+ const name = options.name;
182
+ await writeTextFile({
183
+ path: `./lang/${name}.yml`,
184
+ data: `button:
185
+ text: Copy
186
+ `
187
+ });
188
+ }
189
+ export async function stack(options) {
190
+ try {
191
+ const name = options.name;
192
+ log.info(`Creating your ${name} stack...`);
193
+ const path = resolve(process.cwd(), name);
194
+ await spawn(`giget stacks ${path}`);
195
+ log.success("Successfully scaffolded your project");
196
+ log.info(`cd ${path} && pnpm install`);
197
+ } catch (error) {
198
+ log.error("There was an error creating your stack.", error);
199
+ process.exit();
200
+ }
201
+ }
@@ -0,0 +1,8 @@
1
+ import type { PreinstallOptions } from '@stacksjs/types';
2
+ export declare function invoke(options?: PreinstallOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function preinstall(options: PreinstallOptions): Promise<void>;
@@ -0,0 +1,17 @@
1
+ import { log, spawn } from "@stacksjs/cli";
2
+ import { projectPath } from "@stacksjs/path";
3
+ import { determineDebugMode } from "@stacksjs/config";
4
+ export async function invoke(options) {
5
+ try {
6
+ const stdio = determineDebugMode(options) ? "inherit" : "ignore";
7
+ log.info("Preinstall check...");
8
+ await spawn("npx only-allow pnpm", { stdio, cwd: projectPath() });
9
+ log.success("Environment ready");
10
+ } catch (error) {
11
+ log.error("There was an error pre-installing your stack.", error);
12
+ process.exit();
13
+ }
14
+ }
15
+ export async function preinstall(options) {
16
+ return invoke(options);
17
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { log } from "@stacksjs/logging";
2
+ import { runtimePath } from "@stacksjs/path";
3
+ import { runNpmScript } from "@stacksjs/utils";
4
+ import { NpmScript } from "@stacksjs/types";
5
+ log.info("Running prepublish command...");
6
+ const result = await runNpmScript(NpmScript.BuildStacks, { debug: true, cwd: runtimePath() });
7
+ if (result.isErr()) {
8
+ log.error("There was an error while prepublishing your stack, during the process of building Stacks.", result.error);
9
+ process.exit();
10
+ }
11
+ log.success("Prepublishing completed");
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ import { frameworkPath } from "@stacksjs/path";
3
+ import { runAction } from "@stacksjs/actions";
4
+ import { runNpmScript } from "@stacksjs/utils";
5
+ import { NpmScript } from "@stacksjs/types";
6
+ import { log } from "@stacksjs/cli";
7
+ let result = await runAction("generate-package-json");
8
+ if (result.isErr()) {
9
+ log.error("There was an error while releasing your stack, during the process of fixing your lint errors.", result.error);
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
+ }
package/dist/test.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import type { TestOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: TestOptions): Promise<void>;
3
+ export declare function testUi(options: TestOptions): Promise<void>;
4
+ /**
5
+ * An alias of the invoke method.
6
+ * @param options
7
+ * @returns
8
+ */
9
+ export declare function test(options: TestOptions): Promise<void>;
10
+ export declare function typecheck(options: TestOptions): Promise<void>;
11
+ export declare function testCoverageReport(options: TestOptions): Promise<void>;
package/dist/test.mjs ADDED
@@ -0,0 +1,43 @@
1
+ import { NpmScript } from "@stacksjs/types";
2
+ import { intro, outro, runCommand } from "@stacksjs/cli";
3
+ import { projectPath } from "@stacksjs/path";
4
+ export async function invoke(options) {
5
+ const perf = intro("buddy test");
6
+ const result = await runCommand(NpmScript.Test, { ...options, debug: true, cwd: projectPath() });
7
+ if (result.isErr()) {
8
+ outro("While running `buddy test`, there was an issue", { startTime: perf, useSeconds: true, isError: true }, result.error);
9
+ process.exit();
10
+ }
11
+ outro("Finished running tests", { startTime: perf, useSeconds: true });
12
+ }
13
+ export async function testUi(options) {
14
+ const perf = intro("buddy test:ui");
15
+ const result = await runCommand(NpmScript.TestUi, { ...options, debug: true });
16
+ if (result.isErr()) {
17
+ outro("While running `buddy test:ui`, there was an issue", { startTime: perf, useSeconds: true, isError: true }, result.error);
18
+ process.exit();
19
+ }
20
+ }
21
+ export async function test(options) {
22
+ return invoke(options);
23
+ }
24
+ export async function typecheck(options) {
25
+ const perf = intro("buddy test:types");
26
+ const result = await runCommand(NpmScript.TestTypes, options);
27
+ if (result.isErr()) {
28
+ outro("While running `buddy test:types`, there was an issue", { startTime: perf, useSeconds: true, isError: true }, result.error);
29
+ process.exit();
30
+ }
31
+ outro("Finished typecheck", { startTime: perf, useSeconds: true });
32
+ process.exit();
33
+ }
34
+ export async function testCoverageReport(options) {
35
+ const perf = intro("buddy test:coverage");
36
+ const result = await runCommand(NpmScript.TestCoverage, options);
37
+ if (result.isErr()) {
38
+ outro("While running `buddy test:coverage`, there was an issue", { startTime: perf, useSeconds: true, isError: true }, result.error);
39
+ process.exit();
40
+ }
41
+ outro("Generated the test coverage report", { startTime: perf, useSeconds: true });
42
+ process.exit();
43
+ }
@@ -0,0 +1,8 @@
1
+ import { type TypesOptions } from '@stacksjs/types';
2
+ export declare function invoke(options?: TypesOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function types(options: TypesOptions): Promise<void>;
package/dist/types.mjs ADDED
@@ -0,0 +1,14 @@
1
+ import { log } from "@stacksjs/logging";
2
+ import { runNpmScript } from "@stacksjs/utils";
3
+ import { NpmScript } from "@stacksjs/types";
4
+ export async function invoke(options) {
5
+ const results = await runNpmScript(NpmScript.TypesFix, options);
6
+ if (results.isErr()) {
7
+ log.error("There was an error fixing your types.", results.error);
8
+ process.exit();
9
+ }
10
+ log.success("Types are set");
11
+ }
12
+ export async function types(options) {
13
+ return invoke(options);
14
+ }
@@ -0,0 +1,14 @@
1
+ import type { UpdateOptions } from '@stacksjs/types';
2
+ export declare function invoke(options?: UpdateOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function update(options: UpdateOptions): Promise<void>;
9
+ export declare function checkForUncommittedChanges(path: string | undefined, options: UpdateOptions): Promise<void>;
10
+ export declare function updateFramework(options: UpdateOptions): Promise<void>;
11
+ export declare function downloadFrameworkUpdate(options: UpdateOptions): Promise<void>;
12
+ export declare function updateDependencies(options: UpdateOptions): Promise<void>;
13
+ export declare function updatePackageManager(options: UpdateOptions): Promise<void>;
14
+ export declare function updateNode(options: UpdateOptions): Promise<void>;
@@ -0,0 +1,100 @@
1
+ import { intro, log, outro, prompts, runCommand, spawn } from "@stacksjs/cli";
2
+ import storage from "@stacksjs/storage";
3
+ import { loop } from "@stacksjs/utils";
4
+ import { determineDebugMode } from "@stacksjs/config";
5
+ import { frameworkPath, projectPath } from "@stacksjs/path";
6
+ import { ExitCode, NpmScript } from "@stacksjs/types";
7
+ export async function invoke(options) {
8
+ if (options?.framework || options?.all)
9
+ await updateFramework(options);
10
+ if (options?.dependencies || options?.all)
11
+ await updateDependencies(options);
12
+ if (options?.packageManager || options?.all)
13
+ await updatePackageManager(options);
14
+ if (options?.node || options?.all)
15
+ await updateNode(options);
16
+ else
17
+ process.exit(ExitCode.InvalidArgument);
18
+ }
19
+ export async function update(options) {
20
+ return await invoke(options);
21
+ }
22
+ export async function checkForUncommittedChanges(path = "./.stacks", options) {
23
+ try {
24
+ const stdio = determineDebugMode(options) ? "inherit" : "ignore";
25
+ await spawn(`git diff --quiet HEAD -- ${path}`, { stdio, cwd: projectPath() });
26
+ } catch (error) {
27
+ if (error.status === 1) {
28
+ if (!options?.force) {
29
+ const answer = await prompts.confirm({
30
+ type: "select",
31
+ name: "framework-update",
32
+ message: "We detected there are uncommitted in the ./stacks folder. Do you want to overwrite those?"
33
+ });
34
+ if (!answer) {
35
+ log.info("Aborted. Stacks did not update itself.");
36
+ log.info("Note: if you commit your changes and replay the update, you can see what changed.");
37
+ process.exit(ExitCode.Success);
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ export async function updateFramework(options) {
44
+ const perf = intro("buddy update:framework");
45
+ await checkForUncommittedChanges("./.stacks", options);
46
+ await downloadFrameworkUpdate(options);
47
+ log.info("Updating framework...");
48
+ const exclude = ["functions/package.json", "components/vue/package.json", "components/web/package.json", "auto-imports.d.ts", "components.d.ts", "dist"];
49
+ await storage.deleteFiles(frameworkPath(), exclude);
50
+ loop(5, async () => {
51
+ await storage.deleteEmptyFolders(frameworkPath());
52
+ });
53
+ await storage.copyFolder(frameworkPath(), projectPath("./updates/.stacks"), exclude);
54
+ if (determineDebugMode(options))
55
+ log.info("Cleanup...");
56
+ await storage.deleteFolder(projectPath("updates"));
57
+ outro("Framework updated", { startTime: perf, useSeconds: true });
58
+ process.exit();
59
+ }
60
+ export async function downloadFrameworkUpdate(options) {
61
+ const tempFolderName = "updates";
62
+ const tempUpdatePath = projectPath(tempFolderName);
63
+ if (storage.doesFolderExist(tempUpdatePath))
64
+ await deleteFolder(tempUpdatePath);
65
+ log.info("Downloading framework updates...");
66
+ await runCommand(`giget stacks ${tempFolderName}`, options);
67
+ const version = (await storage.readJsonFile(projectPath(`${tempFolderName}/.stacks/version`))).data;
68
+ log.success("Your framework updated correctly to version: ", version);
69
+ }
70
+ export async function updateDependencies(options) {
71
+ const perf = intro("buddy update:dependencies");
72
+ const result = await runCommand(NpmScript.UpdateDependencies, options);
73
+ if (result.isErr()) {
74
+ outro("While running the update:dependencies command, there was an issue", { startTime: perf, useSeconds: true, isError: true }, result.error);
75
+ process.exit();
76
+ }
77
+ outro("Freshly updated your dependencies.", { startTime: perf, useSeconds: true });
78
+ process.exit();
79
+ }
80
+ export async function updatePackageManager(options) {
81
+ const perf = intro("buddy update:package-manager");
82
+ const version = options?.version || "latest";
83
+ const result = await runCommand(`corepack prepare pnpm@${version} --activate`, options);
84
+ if (result.isErr()) {
85
+ outro("While running the update:package-manager command, there was an issue", { startTime: perf, useSeconds: true, isError: true }, result.error);
86
+ process.exit();
87
+ }
88
+ outro(`Updated to version: ${version}`, { startTime: perf, useSeconds: true });
89
+ process.exit();
90
+ }
91
+ export async function updateNode(options) {
92
+ const perf = intro("buddy update:node");
93
+ const result = await runCommand(NpmScript.UpdateNode, options);
94
+ if (result.isErr()) {
95
+ outro("While running the update:node command, there was an issue", { startTime: perf, useSeconds: true, isError: true }, result.error);
96
+ process.exit();
97
+ }
98
+ outro(`Updated your project's Node.js version to: ${process.version}`, { startTime: perf, useSeconds: true });
99
+ process.exit();
100
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.43.1",
5
- "packageManager": "pnpm@7.17.1",
4
+ "version": "0.44.7",
5
+ "packageManager": "pnpm@7.18.2",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -37,23 +37,27 @@
37
37
  ],
38
38
  "engines": {
39
39
  "node": ">=v18.12.1",
40
- "pnpm": ">=7.17.1"
40
+ "pnpm": ">=7.18.2"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "markdown-it": "^13.0.1",
44
- "vue-component-meta": "^1.0.10",
45
- "@stacksjs/config": "0.43.1",
46
- "@stacksjs/path": "0.43.1",
47
- "@stacksjs/storage": "0.43.1",
48
- "@stacksjs/strings": "0.43.1",
49
- "@stacksjs/types": "0.43.1",
50
- "@stacksjs/utils": "0.43.1",
51
- "@stacksjs/x-ray": "0.43.1"
44
+ "vue-component-meta": "^1.0.13",
45
+ "@stacksjs/cli": "0.44.7",
46
+ "@stacksjs/config": "0.44.7",
47
+ "@stacksjs/logging": "0.44.7",
48
+ "@stacksjs/path": "0.44.7",
49
+ "@stacksjs/storage": "0.44.7",
50
+ "@stacksjs/types": "0.44.7",
51
+ "@stacksjs/utils": "0.44.7"
52
+ },
53
+ "dependencies": {
54
+ "esno": "^0.16.3",
55
+ "@stacksjs/strings": "0.44.7"
52
56
  },
53
57
  "devDependencies": {
54
58
  "mkdist": "^1.0.0",
55
- "typescript": "^4.9.3",
56
- "@stacksjs/testing": "0.43.1"
59
+ "typescript": "^4.9.4",
60
+ "@stacksjs/testing": "0.44.7"
57
61
  },
58
62
  "scripts": {
59
63
  "build": "mkdist -d",