@stacksjs/actions 0.43.1 → 0.44.8

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/README.md CHANGED
@@ -13,15 +13,13 @@ This package contains the Stacks Actions.
13
13
 
14
14
  ## 🤖 Usage
15
15
 
16
- wip
17
-
18
16
  ```bash
19
17
  pnpm i -D @stacksjs/actions
20
18
  ```
21
19
 
22
20
  Now, you can use it in your project:
23
21
 
24
- ```js
22
+ ```ts
25
23
  import actions from '@stacksjs/actions'
26
24
 
27
25
  // wip
package/dist/add.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import type { AddOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: AddOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function add(options: AddOptions): Promise<void>;
9
+ export declare function addTable(): Promise<void>;
10
+ export declare function addCalendar(): Promise<void>;
11
+ export declare function installPackages(names: string[]): Promise<void>;
package/dist/add.mjs ADDED
@@ -0,0 +1,20 @@
1
+ import { installPackage } from "@stacksjs/cli";
2
+ export async function invoke(options) {
3
+ if (options?.table)
4
+ await addTable();
5
+ if (options?.calendar)
6
+ await addCalendar();
7
+ }
8
+ export async function add(options) {
9
+ return invoke(options);
10
+ }
11
+ export async function addTable() {
12
+ await installPackage("@stacksjs/table");
13
+ }
14
+ export async function addCalendar() {
15
+ await installPackage("@stacksjs/calendar");
16
+ }
17
+ export async function installPackages(names) {
18
+ for (const name of names)
19
+ await installPackage(name);
20
+ }
@@ -0,0 +1,14 @@
1
+ import { type BuildOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: BuildOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function build(options: BuildOptions): Promise<void>;
9
+ export declare function componentLibraries(options: BuildOptions): Promise<void>;
10
+ export declare function vueComponentLibrary(options: BuildOptions): Promise<void>;
11
+ export declare function webComponentLibrary(options: BuildOptions): Promise<void>;
12
+ export declare function docs(options: BuildOptions): Promise<void>;
13
+ export declare function stacks(options: BuildOptions): Promise<void>;
14
+ export declare function functionsLibrary(options: BuildOptions): Promise<void>;
package/dist/build.mjs ADDED
@@ -0,0 +1,68 @@
1
+ import { log } from "@stacksjs/logging";
2
+ import { hasComponents, hasFunctions } from "@stacksjs/storage";
3
+ import { runNpmScript } from "@stacksjs/utils";
4
+ import { NpmScript } from "@stacksjs/types";
5
+ import { types as generateTypes } from "./generate.mjs";
6
+ export async function invoke(options) {
7
+ if (options.components)
8
+ await componentLibraries(options);
9
+ else if (options.vueComponents)
10
+ await vueComponentLibrary(options);
11
+ else if (options.webComponents || options.elements)
12
+ await webComponentLibrary(options);
13
+ else if (options.functions)
14
+ await functionsLibrary(options);
15
+ else if (options.docs)
16
+ await docs(options);
17
+ else if (options.stacks)
18
+ await stacks(options);
19
+ await generateTypes();
20
+ }
21
+ export async function build(options) {
22
+ return invoke(options);
23
+ }
24
+ export async function componentLibraries(options) {
25
+ await runNpmScript(NpmScript.GenerateEntries, options);
26
+ await vueComponentLibrary(options);
27
+ await webComponentLibrary(options);
28
+ }
29
+ export async function vueComponentLibrary(options) {
30
+ if (hasComponents()) {
31
+ log.info("Building your component library...");
32
+ await runNpmScript(NpmScript.BuildComponents, options);
33
+ log.success("Your component library was built successfully");
34
+ } else {
35
+ log.warn("No components found.");
36
+ log.info("Before you can build components,");
37
+ log.info("you need to have created some in the ./components folder.");
38
+ }
39
+ }
40
+ export async function webComponentLibrary(options) {
41
+ log.info("Building your component library for production use & npm/CDN distribution...");
42
+ if (hasComponents()) {
43
+ await runNpmScript(NpmScript.BuildWebComponents, options);
44
+ log.success("Your Web Component library was built successfully");
45
+ } else {
46
+ log.info("No components found.");
47
+ }
48
+ }
49
+ export async function docs(options) {
50
+ log.info("Building the documentation site...");
51
+ await runNpmScript(NpmScript.BuildDocs, options);
52
+ log.success("Docs built successfully");
53
+ }
54
+ export async function stacks(options) {
55
+ log.info("Building the Stacks Framework...");
56
+ await runNpmScript(NpmScript.BuildStacks, options);
57
+ log.success("Stacks built successfully");
58
+ }
59
+ export async function functionsLibrary(options) {
60
+ if (hasFunctions()) {
61
+ log.info("Building your functions library for production usages...");
62
+ log.info("Production usages include: manual npm distribution and/or CDN distribution");
63
+ await runNpmScript(NpmScript.BuildFunctions, options);
64
+ log.success("Functions library built successfully");
65
+ } else {
66
+ log.info("No functions found");
67
+ }
68
+ }
@@ -0,0 +1,8 @@
1
+ import { type CleanOptions } from '@stacksjs/types';
2
+ export declare function invoke(options?: CleanOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function clean(options: CleanOptions): Promise<void>;
package/dist/clean.mjs ADDED
@@ -0,0 +1,15 @@
1
+ import { log, runCommand } from "@stacksjs/cli";
2
+ import { ExitCode, NpmScript } from "@stacksjs/types";
3
+ export async function invoke(options) {
4
+ log.info("Running clean command...");
5
+ const result = await runCommand(NpmScript.Clean, options);
6
+ if (result.isOk()) {
7
+ log.success("Cleaned up");
8
+ process.exit(ExitCode.Success);
9
+ }
10
+ log.error(result.error);
11
+ process.exit(ExitCode.FatalError);
12
+ }
13
+ export async function clean(options) {
14
+ return invoke(options);
15
+ }
@@ -0,0 +1,8 @@
1
+ import type { CleanOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: CleanOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function commit(options: CleanOptions): Promise<void>;
@@ -0,0 +1,11 @@
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
+ log.info("Committing...");
6
+ await runNpmScript(NpmScript.Commit, options);
7
+ log.success("Committed");
8
+ }
9
+ export async function commit(options) {
10
+ return invoke(options);
11
+ }
package/dist/dev.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import type { DevOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: DevOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function dev(options: DevOptions): Promise<void>;
9
+ export declare function components(options: DevOptions): Promise<void>;
10
+ export declare function docs(options: DevOptions): Promise<void>;
11
+ export declare function desktop(options: DevOptions): Promise<void>;
12
+ export declare function pages(options: DevOptions): Promise<void>;
13
+ export declare function functions(options: DevOptions): Promise<void>;
package/dist/dev.mjs ADDED
@@ -0,0 +1,38 @@
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
+ if (options.components || options.all)
6
+ await components(options);
7
+ else if (options.docs || options.all)
8
+ await docs(options);
9
+ else if (options.pages || options.all)
10
+ await pages(options);
11
+ else if (options.functions || options.all)
12
+ await functions(options);
13
+ else if (options.desktop || options.all)
14
+ await desktop(options);
15
+ }
16
+ export async function dev(options) {
17
+ return invoke(options);
18
+ }
19
+ export async function components(options) {
20
+ log.info("Starting your components dev server...");
21
+ await runNpmScript(NpmScript.DevComponents, options);
22
+ }
23
+ export async function docs(options) {
24
+ log.info("Starting your docs dev server...");
25
+ await runNpmScript(NpmScript.DevDocs, options);
26
+ }
27
+ export async function desktop(options) {
28
+ log.info("Starting your Desktop engine...");
29
+ await runNpmScript(NpmScript.DevDesktop, options);
30
+ }
31
+ export async function pages(options) {
32
+ log.info("Starting your page engine...");
33
+ await runNpmScript(NpmScript.DevPages, options);
34
+ }
35
+ export async function functions(options) {
36
+ log.info("Starting your function's dev server...");
37
+ await runNpmScript(NpmScript.DevFunctions, options);
38
+ }
@@ -0,0 +1,10 @@
1
+ import { type ExamplesOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: ExamplesOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function examples(options: ExamplesOptions): Promise<void>;
9
+ export declare function componentExample(options: ExamplesOptions): Promise<void>;
10
+ export declare function webComponentExample(options: ExamplesOptions): Promise<void>;
@@ -0,0 +1,33 @@
1
+ import { log } from "@stacksjs/logging";
2
+ import { hasComponents } from "@stacksjs/storage";
3
+ import { runNpmScript } from "@stacksjs/utils";
4
+ import { ExitCode, NpmScript } from "@stacksjs/types";
5
+ export async function invoke(options) {
6
+ if (options.components || options.vue)
7
+ await componentExample(options);
8
+ else if (options.webComponents || options.elements)
9
+ await webComponentExample(options);
10
+ else
11
+ log.error("An unsupported option was used. Please try again, check the documentation & report the issue, if needed.");
12
+ }
13
+ export async function examples(options) {
14
+ return invoke(options);
15
+ }
16
+ export async function componentExample(options) {
17
+ if (hasComponents()) {
18
+ await runNpmScript(NpmScript.ExampleVue, options);
19
+ log.success("Your component library was built successfully");
20
+ } else {
21
+ log.info("No components found.");
22
+ }
23
+ }
24
+ export async function webComponentExample(options) {
25
+ if (hasComponents()) {
26
+ log.info("Building your Web Component library...");
27
+ await runNpmScript(NpmScript.BuildWebComponents, options);
28
+ log.success("Your Web Component library was built successfully");
29
+ } else {
30
+ log.info("No components found.");
31
+ process.exit(ExitCode.FatalError);
32
+ }
33
+ }
@@ -0,0 +1,8 @@
1
+ import type { CliOptions as FreshOptions } from '@stacksjs/types';
2
+ export declare function invoke(options?: FreshOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function fresh(options: FreshOptions): Promise<void>;
package/dist/fresh.mjs ADDED
@@ -0,0 +1,17 @@
1
+ import { intro, outro, runCommands } from "@stacksjs/cli";
2
+ import { ExitCode } from "@stacksjs/types";
3
+ export async function invoke(options) {
4
+ const perf = intro("buddy fresh");
5
+ const results = await runCommands(["pnpm run clean", "pnpm install"], options);
6
+ for (const result of results) {
7
+ if (result.isErr()) {
8
+ outro("While running the fresh command, there was an issue", { startTime: perf, useSeconds: true, isError: true }, result.error);
9
+ process.exit(ExitCode.FatalError);
10
+ }
11
+ }
12
+ outro("Freshly reinstalled your dependencies.", { startTime: perf, useSeconds: true });
13
+ process.exit(ExitCode.Success);
14
+ }
15
+ export async function fresh(options) {
16
+ return invoke(options);
17
+ }
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { log } from "@stacksjs/x-ray";
2
+ import { log } from "@stacksjs/logging";
3
3
  import { hasComponents } from "@stacksjs/storage";
4
4
  import { generateComponentMeta } from "./helpers/component-meta.mjs";
5
5
  if (hasComponents())
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { log } from "@stacksjs/x-ray";
2
+ import { log } from "@stacksjs/logging";
3
3
  import { hasComponents } from "@stacksjs/storage";
4
4
  import { generateVsCodeCustomData } from "./helpers/vscode-custom-data.mjs";
5
5
  if (hasComponents()) {
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { log } from "@stacksjs/x-ray";
2
+ import { log } from "@stacksjs/logging";
3
3
  import { hasComponents, hasFunctions } from "@stacksjs/storage";
4
4
  import { generateLibEntry } from "./helpers/lib-entries.mjs";
5
5
  if (hasComponents()) {
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { log } from "@stacksjs/x-ray";
2
+ import { log } from "@stacksjs/logging";
3
3
  import { hasComponents } from "@stacksjs/storage";
4
4
  import { generateVsCodeCustomData } from "./helpers/vscode-custom-data.mjs";
5
5
  if (hasComponents())
@@ -0,0 +1,15 @@
1
+ import type { GeneratorOptions } from '@stacksjs/types';
2
+ export declare function invoke(options?: GeneratorOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function generate(options: GeneratorOptions): Promise<void>;
9
+ export declare function libEntries(options: GeneratorOptions): Promise<void>;
10
+ export declare function vueCompat(options?: GeneratorOptions): Promise<void>;
11
+ export declare function webTypes(options?: GeneratorOptions): Promise<void>;
12
+ export declare function vsCodeCustomData(options?: GeneratorOptions): Promise<void>;
13
+ export declare function ideHelpers(options?: GeneratorOptions): Promise<void>;
14
+ export declare function componentMeta(options?: GeneratorOptions): Promise<void>;
15
+ export declare function types(options?: GeneratorOptions): Promise<void>;
@@ -0,0 +1,84 @@
1
+ import { log } from "@stacksjs/logging";
2
+ import { NpmScript } from "@stacksjs/types";
3
+ import { runNpmScript } from "@stacksjs/utils";
4
+ import { projectPath } from "@stacksjs/path";
5
+ import { runCommand } from "@stacksjs/cli";
6
+ import { lintFix } from "./lint.mjs";
7
+ export async function invoke(options) {
8
+ if (options?.types)
9
+ await types(options);
10
+ else if (options?.entries)
11
+ await libEntries(options);
12
+ else if (options?.webTypes)
13
+ await webTypes(options);
14
+ else if (options?.customData)
15
+ await vsCodeCustomData(options);
16
+ else if (options?.ideHelpers)
17
+ await ideHelpers(options);
18
+ else if (options?.vueCompatibility)
19
+ await vueCompat(options);
20
+ else if (options?.componentMeta)
21
+ await componentMeta(options);
22
+ }
23
+ export async function generate(options) {
24
+ return invoke(options);
25
+ }
26
+ export async function libEntries(options) {
27
+ const result = await runCommand("esno .stacks/core/actions/src/generate-package-json.ts", { ...options, debug: true, cwd: projectPath() });
28
+ if (result.isErr()) {
29
+ log.error("There was an error generating your library entry points.", result.error);
30
+ process.exit();
31
+ }
32
+ log.success("Library entry points were generated successfully");
33
+ }
34
+ export async function vueCompat(options) {
35
+ const result = await runNpmScript(NpmScript.GenerateVueCompat, options);
36
+ if (result.isErr()) {
37
+ log.error("There was an error generating Vue 2 compatibility.", result.error);
38
+ process.exit();
39
+ }
40
+ log.success("Libraries are now Vue 2 & 3 compatible");
41
+ }
42
+ export async function webTypes(options) {
43
+ const result = await runNpmScript(NpmScript.GenerateWebTypes, options);
44
+ if (result.isErr()) {
45
+ log.error("There was an error generating the web-types.json file.", result.error);
46
+ process.exit();
47
+ }
48
+ log.success("Successfully generated the web-types.json file");
49
+ }
50
+ export async function vsCodeCustomData(options) {
51
+ const result = await runNpmScript(NpmScript.GenerateVsCodeCustomData, options);
52
+ if (result.isErr()) {
53
+ log.error("There was an error generating the custom-elements.json file.", result.error);
54
+ process.exit();
55
+ }
56
+ await lintFix({ fix: true });
57
+ log.success("Successfully generated the custom-elements.json file");
58
+ }
59
+ export async function ideHelpers(options) {
60
+ const result = await runNpmScript(NpmScript.GenerateIdeHelpers, options);
61
+ if (result.isErr()) {
62
+ log.error("There was an error generating IDE helpers.", result.error);
63
+ process.exit();
64
+ }
65
+ await lintFix({ fix: true });
66
+ log.success("Successfully generated IDE helpers");
67
+ }
68
+ export async function componentMeta(options) {
69
+ const result = await runNpmScript(NpmScript.GenerateComponentMeta, options);
70
+ if (result.isErr()) {
71
+ log.error("There was an error generating your component meta information.", result.error);
72
+ process.exit();
73
+ }
74
+ await lintFix({ fix: true });
75
+ log.success("Successfully generated component meta information");
76
+ }
77
+ export async function types(options) {
78
+ const result = await runNpmScript(NpmScript.GenerateTypes, options);
79
+ if (result.isErr()) {
80
+ log.error("There was an error generating your types.", result.error);
81
+ process.exit();
82
+ }
83
+ log.success("Types were generated successfully");
84
+ }
@@ -0,0 +1,6 @@
1
+ export * from './component-meta';
2
+ export * from './lib-entries';
3
+ export * from './package-json';
4
+ export * from './utils';
5
+ export * from './vscode-custom-data';
6
+ export * from './vue-compat';
@@ -0,0 +1,6 @@
1
+ export * from "./component-meta.mjs";
2
+ export * from "./lib-entries.mjs";
3
+ export * from "./package-json.mjs";
4
+ export * from "./utils.mjs";
5
+ export * from "./vscode-custom-data.mjs";
6
+ export * from "./vue-compat.mjs";
@@ -1,4 +1,4 @@
1
- import { type LibEntryType } from '@stacksjs/types';
1
+ import type { LibEntryType } from '@stacksjs/types';
2
2
  /**
3
3
  * Based on the config values, this method
4
4
  * will generate the library entry points.
@@ -1,9 +1,7 @@
1
- import { log } from "@stacksjs/x-ray";
2
- import { kebabCase } from "@stacksjs/strings";
1
+ import { log } from "@stacksjs/logging";
3
2
  import { libraryEntryPath } from "@stacksjs/path";
4
3
  import { writeTextFile } from "@stacksjs/storage";
5
4
  import { determineResetPreset } from "@stacksjs/utils";
6
- import { ExitCode } from "@stacksjs/types";
7
5
  import { library } from "@stacksjs/config";
8
6
  export async function generateLibEntry(type) {
9
7
  try {
@@ -14,8 +12,8 @@ export async function generateLibEntry(type) {
14
12
  if (type === "functions")
15
13
  await createFunctionLibraryEntryPoint();
16
14
  } catch (err) {
17
- log.error(err);
18
- process.exit(ExitCode.FatalError);
15
+ log.error("There was an error generating the library entry point.", err);
16
+ process.exit();
19
17
  }
20
18
  }
21
19
  export async function createVueLibraryEntryPoint() {
@@ -24,7 +22,7 @@ export async function createVueLibraryEntryPoint() {
24
22
  path: libraryEntryPath("vue-components"),
25
23
  data: generateEntryPointData("vue-components")
26
24
  });
27
- log.success("Created the Vue component library entry point.");
25
+ log.success("Created Vue component library entry point.");
28
26
  }
29
27
  export async function createWebComponentLibraryEntryPoint() {
30
28
  log.info("Creating the Web Component library entry point...");
@@ -32,7 +30,7 @@ export async function createWebComponentLibraryEntryPoint() {
32
30
  path: libraryEntryPath("web-components"),
33
31
  data: generateEntryPointData("web-components")
34
32
  });
35
- log.success("Created the Web Component library entry point.");
33
+ log.success("Created Web Component library entry point.");
36
34
  }
37
35
  export async function createFunctionLibraryEntryPoint() {
38
36
  log.info("Creating the Function library entry point...");
@@ -40,14 +38,14 @@ export async function createFunctionLibraryEntryPoint() {
40
38
  path: libraryEntryPath("functions"),
41
39
  data: generateEntryPointData("functions")
42
40
  });
43
- log.success("Created the Functions library entry point.");
41
+ log.success("Created Functions library entry point.");
44
42
  }
45
43
  export function generateEntryPointData(type) {
46
44
  let arr = [];
47
45
  if (type === "functions") {
48
46
  if (!library.functions.functions) {
49
47
  log.error("There are no functions defined to be built. Please check your config/library.ts file for potential adjustments.");
50
- process.exit(ExitCode.FatalError);
48
+ process.exit();
51
49
  }
52
50
  for (const fx of library.functions.functions) {
53
51
  if (Array.isArray(fx))
@@ -60,7 +58,7 @@ export function generateEntryPointData(type) {
60
58
  if (type === "vue-components") {
61
59
  if (!library.vueComponents.tags) {
62
60
  log.error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments.");
63
- process.exit(ExitCode.FatalError);
61
+ process.exit();
64
62
  }
65
63
  arr = determineResetPreset();
66
64
  for (const component of library.vueComponents.tags.map((tag) => tag.name)) {
@@ -77,7 +75,7 @@ export function generateEntryPointData(type) {
77
75
  const definitions = [];
78
76
  if (!library.webComponents.tags) {
79
77
  log.error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments.");
80
- process.exit(ExitCode.FatalError);
78
+ process.exit();
81
79
  }
82
80
  for (const component of library.webComponents.tags.map((tag) => tag.name)) {
83
81
  if (Array.isArray(component)) {
@@ -1,10 +1,10 @@
1
- import { log } from "@stacksjs/x-ray";
1
+ import { log } from "@stacksjs/logging";
2
2
  import { writeTextFile } from "@stacksjs/storage";
3
3
  import { packageJsonPath } from "@stacksjs/path";
4
4
  import { library } from "@stacksjs/config";
5
- import { packageManager } from "../../package.json";
5
+ import { packageManager } from "../../package.json" assert { type: "json" };
6
6
  export async function generatePackageJson(type) {
7
- let name, description, directory, keywords, config;
7
+ let name, description, directory, keywords, config, prettyName;
8
8
  if (type === "vue-components") {
9
9
  name = library.vueComponents.name;
10
10
  description = library.vueComponents.description;
@@ -70,15 +70,14 @@ export async function generatePackageJson(type) {
70
70
  }
71
71
  `
72
72
  });
73
- let prettyName;
74
73
  if (type === "vue-components")
75
74
  prettyName = "Vue Component library";
76
75
  else if (type === "web-components")
77
76
  prettyName = "Web Component library";
78
77
  else if (type === "functions")
79
78
  prettyName = "Function Library";
80
- log.success(`Created the ${prettyName} package.json`);
79
+ log.success(`Created ${prettyName} package.json`);
81
80
  } catch (err) {
82
- log.error(err);
81
+ log.error(`There was an error creating the ${prettyName} package.json.`, err);
83
82
  }
84
83
  }
@@ -0,0 +1,10 @@
1
+ import type { CliOptions } from '@stacksjs/types';
2
+ /**
3
+ * Run a command the Stacks way.
4
+ *
5
+ * @param command 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?: CliOptions): Promise<any>;
10
+ export declare function hasAction(action: string): boolean;
@@ -0,0 +1,17 @@
1
+ import storage from "@stacksjs/storage";
2
+ import { runCommand } from "@stacksjs/cli";
3
+ import { actionsPath, functionsPath } from "@stacksjs/path";
4
+ import { err } from "@stacksjs/error-handling";
5
+ export async function runAction(action, options) {
6
+ if (!hasAction(action))
7
+ return err(`The specified action "${action}" does not exist`);
8
+ const cmd = `esno ${actionsPath(`${action}.ts`)}`;
9
+ return await runCommand(cmd, options);
10
+ }
11
+ export function hasAction(action) {
12
+ if (storage.isFile(functionsPath(`actions/${action}.ts`)))
13
+ return true;
14
+ if (storage.isFile(actionsPath(`${action}.ts`)))
15
+ return true;
16
+ return false;
17
+ }
@@ -1,4 +1,4 @@
1
- import { log } from "@stacksjs/x-ray";
1
+ import { log } from "@stacksjs/logging";
2
2
  import { customElementsDataPath } from "@stacksjs/path";
3
3
  import { writeTextFile } from "@stacksjs/storage";
4
4
  import { library } from "@stacksjs/config";
@@ -9,7 +9,7 @@ export async function generateVsCodeCustomData() {
9
9
  data: generateComponentInfoData()
10
10
  });
11
11
  } catch (err) {
12
- log.error(err);
12
+ log.error("There was an error generating the VS Code custom data file.", err);
13
13
  }
14
14
  }
15
15
  function generateComponentInfoData() {
package/dist/index.d.ts CHANGED
@@ -1,5 +1 @@
1
- export * from './helpers/component-meta';
2
- export * from './helpers/lib-entries';
3
- export * from './helpers/package-json';
4
- export * from './helpers/vscode-custom-data';
5
- export * from './helpers/vue-compat';
1
+ export * from './helpers';
package/dist/index.mjs CHANGED
@@ -1,5 +1 @@
1
- export * from "./helpers/component-meta.mjs";
2
- export * from "./helpers/lib-entries.mjs";
3
- export * from "./helpers/package-json.mjs";
4
- export * from "./helpers/vscode-custom-data.mjs";
5
- export * from "./helpers/vue-compat.mjs";
1
+ export * from "./helpers/index.mjs";
package/dist/key.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import type { CliOptions as KeyOptions } from '@stacksjs/types';
2
+ export declare function invoke(options: KeyOptions): Promise<void>;
3
+ /**
4
+ * An alias of the invoke method.
5
+ * @param options
6
+ * @returns
7
+ */
8
+ export declare function key(options: KeyOptions): Promise<void>;
9
+ export declare function generate(options: KeyOptions): Promise<boolean>;
10
+ export declare function generateAppKey(): Promise<string>;