@stacksjs/actions 0.37.9 → 0.38.2

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/README.md CHANGED
@@ -21,7 +21,7 @@ pnpm i -D @stacksjs/actions
21
21
  Now, you can use it in your project:
22
22
 
23
23
  ```js
24
- import * as invoke from '@stacksjs/actions/generate'
24
+ import actions from '@stacksjs/actions'
25
25
 
26
26
  // wip
27
27
  ```
@@ -36,7 +36,7 @@ pnpm test
36
36
 
37
37
  ## 📈 Changelog
38
38
 
39
- Please see our [releases](https://github.com/stacksjs/stacksjs/releases) page for more information on what has changed recently.
39
+ Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
40
40
 
41
41
  ## 💪🏼 Contributing
42
42
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { frameworkPath } from "@stacksjs/paths";
3
- import { copyFolder } from "@stacksjs/fs";
2
+ import { frameworkPath } from "@stacksjs/path";
3
+ import { copyFolder } from "@stacksjs/storage";
4
4
  const destinations = [
5
- [frameworkPath("dist/types/components"), frameworkPath("vue-components/dist/types")],
6
- [frameworkPath("dist/types/components"), frameworkPath("web-components/dist/types")],
5
+ [frameworkPath("dist/types/components"), frameworkPath("components/vue/dist/types")],
6
+ [frameworkPath("dist/types/components"), frameworkPath("components/web/dist/types")],
7
7
  [frameworkPath("dist/types/functions"), frameworkPath("functions/dist/types")]
8
8
  ];
9
9
  destinations.forEach(([src, dest]) => {
@@ -1,11 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import consola from "consola";
3
- import { hasComponents } from "@stacksjs/fs";
4
- import { generateComponentMeta } from "./generate/component-meta.mjs";
5
- async function generate() {
6
- if (hasComponents())
7
- await generateComponentMeta();
8
- else
9
- consola.info("No components found. Skipping component meta generation.");
10
- }
11
- generate();
2
+ import { log } from "@stacksjs/logging";
3
+ import { hasComponents } from "@stacksjs/storage";
4
+ import { generateComponentMeta } from "./helpers/component-meta.mjs";
5
+ if (hasComponents())
6
+ await generateComponentMeta();
7
+ else
8
+ log.info("No components found. Skipping component meta generation.");
@@ -1,12 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import consola from "consola";
3
- import { hasComponents } from "@stacksjs/fs";
4
- import { generateVsCodeCustomData } from "./generate/vscode-custom-data.mjs";
5
- async function generate() {
6
- if (hasComponents()) {
7
- await generateVsCodeCustomData();
8
- } else {
9
- consola.info("No components found. Skipping IDE helper generation.");
10
- }
2
+ import { log } from "@stacksjs/logging";
3
+ import { hasComponents } from "@stacksjs/storage";
4
+ import { generateVsCodeCustomData } from "./helpers/vscode-custom-data.mjs";
5
+ if (hasComponents()) {
6
+ await generateVsCodeCustomData();
7
+ } else {
8
+ log.info("No components found. Skipping IDE helper generation.");
11
9
  }
12
- generate();
@@ -1,17 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import consola from "consola";
3
- import { hasComponents, hasFunctions } from "@stacksjs/fs";
4
- import { generateLibEntry } from "./generate/lib-entries.mjs";
5
- async function generate() {
6
- if (hasComponents()) {
7
- await generateLibEntry("vue-components");
8
- await generateLibEntry("web-components");
9
- } else {
10
- consola.info("No components found. Skipping building component entry points.");
11
- }
12
- if (hasFunctions())
13
- await generateLibEntry("functions");
14
- else
15
- consola.info("No functions found. Skipping building function entry point.");
2
+ import { log } from "@stacksjs/logging";
3
+ import { hasComponents, hasFunctions } from "@stacksjs/storage";
4
+ import { generateLibEntry } from "./helpers/lib-entries.mjs";
5
+ if (hasComponents()) {
6
+ await generateLibEntry("vue-components");
7
+ await generateLibEntry("web-components");
8
+ } else {
9
+ log.info("No components found. Skipping building component entry points.");
16
10
  }
17
- generate();
11
+ if (hasFunctions())
12
+ await generateLibEntry("functions");
13
+ else
14
+ log.info("No functions found. Skipping building function entry point.");
@@ -1,12 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { hasComponents, hasFunctions } from "@stacksjs/fs";
3
- import { generatePackageJson } from "./generate/package-json.mjs";
4
- async function generate() {
5
- if (hasComponents()) {
6
- await generatePackageJson("vue-components");
7
- await generatePackageJson("web-components");
8
- }
9
- if (hasFunctions())
10
- await generatePackageJson("functions");
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");
11
7
  }
12
- generate();
8
+ if (hasFunctions())
9
+ await generatePackageJson("functions");
@@ -1,11 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import consola from "consola";
3
- import { hasComponents } from "@stacksjs/fs";
4
- import { generateVsCodeCustomData } from "./generate/vscode-custom-data.mjs";
5
- async function generate() {
6
- if (hasComponents())
7
- await generateVsCodeCustomData();
8
- else
9
- consola.info("No components found. Skipping VS Code custom data generation.");
10
- }
11
- generate();
2
+ import { log } from "@stacksjs/logging";
3
+ import { hasComponents } from "@stacksjs/storage";
4
+ import { generateVsCodeCustomData } from "./helpers/vscode-custom-data.mjs";
5
+ if (hasComponents())
6
+ await generateVsCodeCustomData();
7
+ else
8
+ log.info("No components found. Skipping VS Code custom data generation.");
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { generateVueCompat } from "./generate/index.mjs";
3
- generateVueCompat(["wip"]);
2
+ import { generateVueCompat } from "./helpers/vue-compat.mjs";
3
+ await generateVueCompat(["wip"]);
@@ -1,6 +1,6 @@
1
1
  import { type ComponentMeta } from 'vue-component-meta';
2
2
  /**
3
- * ℹ️ Useful links
3
+ * ℹ️ Useful Links
4
4
  *
5
5
  * vue-component-meta tests: https://github.com/johnsoncodehk/volar/blob/master/vue-language-tools/vue-component-meta/tests/index.spec.ts
6
6
  * Discord thread about improving vue-component-meta: https://discord.com/channels/793943652350427136/1027819645677350912
@@ -8,6 +8,7 @@ import { type ComponentMeta } from 'vue-component-meta';
8
8
  * Discord chat: https://discord.com/channels/793943652350427136/1027819645677350912
9
9
  * original script: https://raw.githubusercontent.com/jd-solanki/anu/main/scripts/gen-component-meta.ts
10
10
  */
11
+ export declare function generateComponentMeta(): Promise<void>;
11
12
  export interface ComponentApiProps {
12
13
  name: ComponentMeta['props'][number]['name'];
13
14
  description: ComponentMeta['props'][number]['description'];
@@ -19,4 +20,3 @@ export interface ComponentApi {
19
20
  events: ComponentMeta['events'];
20
21
  slots: ComponentMeta['slots'];
21
22
  }
22
- export declare function generateComponentMeta(): Promise<void>;
@@ -2,9 +2,9 @@ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
2
2
  import fg from "fast-glob";
3
3
  import MarkdownIt from "markdown-it";
4
4
  import { createComponentMetaChecker } from "vue-component-meta";
5
- import { frameworkPath, join, parse, projectPath } from "@stacksjs/paths";
6
- const md = new MarkdownIt();
5
+ import { frameworkPath, join, parse, projectPath } from "@stacksjs/path";
7
6
  export async function generateComponentMeta() {
7
+ const md = new MarkdownIt();
8
8
  const checkerOptions = {
9
9
  forceUseTs: true,
10
10
  schema: { ignore: ["MyIgnoredNestedProps"] },
@@ -0,0 +1,12 @@
1
+ import { type LibEntryType } from '@stacksjs/types';
2
+ /**
3
+ * Based on the config values, this method
4
+ * will generate the library entry points.
5
+ *
6
+ * @param type string
7
+ */
8
+ export declare function generateLibEntry(type: LibEntryType): Promise<void>;
9
+ export declare function createVueLibraryEntryPoint(): Promise<void>;
10
+ export declare function createWebComponentLibraryEntryPoint(): Promise<void>;
11
+ export declare function createFunctionLibraryEntryPoint(): Promise<void>;
12
+ export declare function generateEntryPointData(type: 'vue-components' | 'web-components' | 'functions'): string;
@@ -1,37 +1,52 @@
1
- import consola from "consola";
1
+ import { log } from "@stacksjs/logging";
2
2
  import { kebabCase } from "@stacksjs/strings";
3
- import { libraryEntryPath } from "@stacksjs/paths";
4
- import { writeTextFile } from "@stacksjs/fs";
5
- import { determineResetPreset } from "@stacksjs/helpers";
3
+ import { libraryEntryPath } from "@stacksjs/path";
4
+ import { writeTextFile } from "@stacksjs/storage";
5
+ import { determineResetPreset } from "@stacksjs/utils";
6
6
  import { ExitCode } from "@stacksjs/types";
7
- import { library } from "../../../../config";
7
+ import { library } from "@stacksjs/config";
8
8
  export async function generateLibEntry(type) {
9
- if (type === "vue-components")
10
- consola.info("Creating the Vue component library entry point...");
11
- else if (type === "web-components")
12
- consola.info("Creating the Web Component library entry point...");
13
- else
14
- consola.info("Creating the function library entry point...");
15
9
  try {
16
- await writeTextFile({
17
- path: libraryEntryPath(type),
18
- data: generateEntryPointData(type)
19
- });
20
10
  if (type === "vue-components")
21
- consola.success("Created the Vue component library entry point.");
22
- else if (type === "web-components")
23
- consola.success("Created the Web Component library entry point.");
24
- else
25
- consola.success("Created the function library entry point.");
11
+ await createVueLibraryEntryPoint();
12
+ if (type === "web-components")
13
+ await createWebComponentLibraryEntryPoint();
14
+ if (type === "functions")
15
+ await createFunctionLibraryEntryPoint();
26
16
  } catch (err) {
27
- consola.error(err);
17
+ log.error(err);
18
+ process.exit(ExitCode.FatalError);
28
19
  }
29
20
  }
30
- function generateEntryPointData(type) {
21
+ export async function createVueLibraryEntryPoint() {
22
+ log.info("Creating the Vue component library entry point...");
23
+ await writeTextFile({
24
+ path: libraryEntryPath("vue-components"),
25
+ data: generateEntryPointData("vue-components")
26
+ });
27
+ log.success("Created the Vue component library entry point.");
28
+ }
29
+ export async function createWebComponentLibraryEntryPoint() {
30
+ log.info("Creating the Web Component library entry point...");
31
+ await writeTextFile({
32
+ path: libraryEntryPath("web-components"),
33
+ data: generateEntryPointData("web-components")
34
+ });
35
+ log.success("Created the Web Component library entry point.");
36
+ }
37
+ export async function createFunctionLibraryEntryPoint() {
38
+ log.info("Creating the Function library entry point...");
39
+ await writeTextFile({
40
+ path: libraryEntryPath("functions"),
41
+ data: generateEntryPointData("functions")
42
+ });
43
+ log.success("Created the Functions library entry point.");
44
+ }
45
+ export function generateEntryPointData(type) {
31
46
  let arr = [];
32
47
  if (type === "functions") {
33
48
  if (!library.functions.functions) {
34
- consola.error("There are no functions defined to be built. Please check your config/library.ts file for potential adjustments.");
49
+ log.error("There are no functions defined to be built. Please check your config/library.ts file for potential adjustments.");
35
50
  process.exit(ExitCode.FatalError);
36
51
  }
37
52
  for (const fx of library.functions.functions) {
@@ -44,7 +59,7 @@ function generateEntryPointData(type) {
44
59
  }
45
60
  if (type === "vue-components") {
46
61
  if (!library.vueComponents.tags) {
47
- consola.error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments.");
62
+ log.error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments.");
48
63
  process.exit(ExitCode.FatalError);
49
64
  }
50
65
  arr = determineResetPreset();
@@ -61,7 +76,7 @@ function generateEntryPointData(type) {
61
76
  const declarations = [];
62
77
  const definitions = [];
63
78
  if (!library.webComponents.tags) {
64
- consola.error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments.");
79
+ log.error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments.");
65
80
  process.exit(ExitCode.FatalError);
66
81
  }
67
82
  for (const component of library.webComponents.tags.map((tag) => tag.name)) {
File without changes
@@ -1,8 +1,8 @@
1
- import consola from "consola";
2
- import { writeTextFile } from "@stacksjs/fs";
3
- import { packageJsonPath } from "@stacksjs/paths";
1
+ import { log } from "@stacksjs/logging";
2
+ import { writeTextFile } from "@stacksjs/storage";
3
+ import { packageJsonPath } from "@stacksjs/path";
4
+ import { library } from "@stacksjs/config";
4
5
  import { packageManager } from "../../package.json";
5
- import { library } from "../../../../config";
6
6
  export async function generatePackageJson(type) {
7
7
  let name, description, directory, keywords, config;
8
8
  if (type === "vue-components") {
@@ -57,7 +57,8 @@ export async function generatePackageJson(type) {
57
57
  "module": "dist/index.js",
58
58
  "types": "dist/index.d.ts",
59
59
  "files": [
60
- "dist"
60
+ "dist",
61
+ "README.md"
61
62
  ],
62
63
  "scripts": {
63
64
  "build": "vite build -c ../build/${config}.ts",
@@ -69,8 +70,8 @@ export async function generatePackageJson(type) {
69
70
  }
70
71
  `
71
72
  });
72
- consola.success(`Created the ${type} package.json.`);
73
+ log.success(`Created the ${type} package.json.`);
73
74
  } catch (err) {
74
- consola.error(err);
75
+ log.error(err);
75
76
  }
76
77
  }
@@ -1,7 +1,7 @@
1
- import consola from "consola";
2
- import { customElementsDataPath } from "@stacksjs/paths";
3
- import { writeTextFile } from "@stacksjs/fs";
4
- import { library } from "../../../../config";
1
+ import { log } from "@stacksjs/logging";
2
+ import { customElementsDataPath } from "@stacksjs/path";
3
+ import { writeTextFile } from "@stacksjs/storage";
4
+ import { library } from "@stacksjs/config";
5
5
  export async function generateVsCodeCustomData() {
6
6
  try {
7
7
  await writeTextFile({
@@ -9,7 +9,7 @@ export async function generateVsCodeCustomData() {
9
9
  data: generateComponentInfoData()
10
10
  });
11
11
  } catch (err) {
12
- consola.error(err);
12
+ log.error(err);
13
13
  }
14
14
  }
15
15
  function generateComponentInfoData() {
File without changes
File without changes
@@ -0,0 +1,5 @@
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';
package/dist/index.mjs ADDED
@@ -0,0 +1,5 @@
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";
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
- "version": "0.37.9",
5
- "packageManager": "pnpm@7.14.0",
4
+ "version": "0.38.2",
5
+ "packageManager": "pnpm@7.15.0",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "license": "MIT",
@@ -32,28 +32,27 @@
32
32
  "Chris Breuer <chris@ow3.org>"
33
33
  ],
34
34
  "files": [
35
- "dist"
35
+ "dist",
36
+ "README.md"
36
37
  ],
37
38
  "engines": {
38
- "node": ">=v18.10.0",
39
- "pnpm": ">=7.14.0"
39
+ "node": ">=v18.12.1",
40
+ "pnpm": ">=7.15.0"
40
41
  },
41
- "dependencies": {
42
- "@stacksjs/fs": "0.37.9",
43
- "@stacksjs/helpers": "0.37.9",
44
- "@stacksjs/paths": "0.37.9",
45
- "@stacksjs/strings": "0.37.9",
46
- "@stacksjs/types": "0.37.9",
47
- "@types/fs-extra": "^9.0.13",
48
- "@vueuse/core": "^9.3.1",
49
- "consola": "^2.15.3",
50
- "fast-glob": "^3.2.12",
51
- "fs-extra": "^10.1.0",
42
+ "peerDependencies": {
43
+ "@stacksjs/config": "0.38.2",
44
+ "@stacksjs/logging": "0.38.2",
45
+ "@stacksjs/path": "0.38.2",
46
+ "@stacksjs/storage": "0.38.2",
47
+ "@stacksjs/strings": "0.38.2",
48
+ "@stacksjs/types": "0.38.2",
49
+ "@stacksjs/utils": "0.38.2",
52
50
  "markdown-it": "^13.0.1",
53
- "vue-component-meta": "^1.0.8"
51
+ "vue-component-meta": "^1.0.9"
54
52
  },
55
53
  "devDependencies": {
56
- "mkdist": "^0.3.13"
54
+ "mkdist": "^0.4.0",
55
+ "typescript": "^4.8.4"
57
56
  },
58
57
  "scripts": {
59
58
  "build": "mkdist -d",
@@ -1,4 +0,0 @@
1
- export * from './lib-entries';
2
- export * from './package-json';
3
- export * from './vue-compat';
4
- export * from './vscode-custom-data';
@@ -1,4 +0,0 @@
1
- export * from "./lib-entries.mjs";
2
- export * from "./package-json.mjs";
3
- export * from "./vue-compat.mjs";
4
- export * from "./vscode-custom-data.mjs";
@@ -1,7 +0,0 @@
1
- /**
2
- * Based on the config values, this method
3
- * will generate the library entry points.
4
- *
5
- * @param type string
6
- */
7
- export declare function generateLibEntry(type: 'vue-components' | 'web-components' | 'functions'): Promise<void>;