@stacksjs/actions 0.37.9 → 0.38.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/README.md +2 -2
- package/dist/copy-types.mjs +4 -4
- package/dist/generate-component-meta.mjs +7 -10
- package/dist/generate-ide-helpers.mjs +7 -10
- package/dist/generate-lib-entries.mjs +12 -15
- package/dist/generate-package-json.mjs +7 -10
- package/dist/generate-vscode-custom-data.mjs +7 -10
- package/dist/generate-vue-compat.mjs +2 -2
- package/dist/{generate → helpers}/component-meta.d.ts +2 -2
- package/dist/{generate → helpers}/component-meta.mjs +2 -2
- package/dist/helpers/lib-entries.d.ts +12 -0
- package/dist/{generate → helpers}/lib-entries.mjs +40 -25
- package/dist/{generate → helpers}/package-json.d.ts +0 -0
- package/dist/{generate → helpers}/package-json.mjs +8 -7
- package/dist/{generate → helpers}/vscode-custom-data.d.ts +0 -0
- package/dist/{generate → helpers}/vscode-custom-data.mjs +5 -5
- package/dist/{generate → helpers}/vue-compat.d.ts +0 -0
- package/dist/{generate → helpers}/vue-compat.mjs +0 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +5 -0
- package/package.json +17 -18
- package/dist/generate/index.d.ts +0 -4
- package/dist/generate/index.mjs +0 -4
- package/dist/generate/lib-entries.d.ts +0 -7
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
|
|
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/
|
|
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
|
|
package/dist/copy-types.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { frameworkPath } from "@stacksjs/
|
|
3
|
-
import { copyFolder } from "@stacksjs/
|
|
2
|
+
import { frameworkPath } from "@stacksjs/path";
|
|
3
|
+
import { copyFolder } from "@stacksjs/storage";
|
|
4
4
|
const destinations = [
|
|
5
|
-
[frameworkPath("dist/types/components"), frameworkPath("
|
|
6
|
-
[frameworkPath("dist/types/components"), frameworkPath("
|
|
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
|
|
3
|
-
import { hasComponents } from "@stacksjs/
|
|
4
|
-
import { generateComponentMeta } from "./
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
3
|
-
import { hasComponents } from "@stacksjs/
|
|
4
|
-
import { generateVsCodeCustomData } from "./
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
3
|
-
import { hasComponents, hasFunctions } from "@stacksjs/
|
|
4
|
-
import { generateLibEntry } from "./
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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/
|
|
3
|
-
import { generatePackageJson } from "./
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
8
|
+
if (hasFunctions())
|
|
9
|
+
await generatePackageJson("functions");
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import { hasComponents } from "@stacksjs/
|
|
4
|
-
import { generateVsCodeCustomData } from "./
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 "./
|
|
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
|
|
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/
|
|
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
|
|
1
|
+
import { log } from "@stacksjs/logging";
|
|
2
2
|
import { kebabCase } from "@stacksjs/strings";
|
|
3
|
-
import { libraryEntryPath } from "@stacksjs/
|
|
4
|
-
import { writeTextFile } from "@stacksjs/
|
|
5
|
-
import { determineResetPreset } from "@stacksjs/
|
|
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 "
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
await createVueLibraryEntryPoint();
|
|
12
|
+
if (type === "web-components")
|
|
13
|
+
await createWebComponentLibraryEntryPoint();
|
|
14
|
+
if (type === "functions")
|
|
15
|
+
await createFunctionLibraryEntryPoint();
|
|
26
16
|
} catch (err) {
|
|
27
|
-
|
|
17
|
+
log.error(err);
|
|
18
|
+
process.exit(ExitCode.FatalError);
|
|
28
19
|
}
|
|
29
20
|
}
|
|
30
|
-
function
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import { writeTextFile } from "@stacksjs/
|
|
3
|
-
import { packageJsonPath } from "@stacksjs/
|
|
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
|
-
|
|
73
|
+
log.success(`Created the ${type} package.json.`);
|
|
73
74
|
} catch (err) {
|
|
74
|
-
|
|
75
|
+
log.error(err);
|
|
75
76
|
}
|
|
76
77
|
}
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { customElementsDataPath } from "@stacksjs/
|
|
3
|
-
import { writeTextFile } from "@stacksjs/
|
|
4
|
-
import { library } from "
|
|
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
|
-
|
|
12
|
+
log.error(err);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
function generateComponentInfoData() {
|
|
File without changes
|
|
File without changes
|
package/dist/index.d.ts
ADDED
package/dist/index.mjs
ADDED
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@7.
|
|
4
|
+
"version": "0.38.1",
|
|
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.
|
|
39
|
-
"pnpm": ">=7.
|
|
39
|
+
"node": ">=v18.12.1",
|
|
40
|
+
"pnpm": ">=7.15.0"
|
|
40
41
|
},
|
|
41
|
-
"
|
|
42
|
-
"@stacksjs/
|
|
43
|
-
"@stacksjs/
|
|
44
|
-
"@stacksjs/
|
|
45
|
-
"@stacksjs/
|
|
46
|
-
"@stacksjs/
|
|
47
|
-
"@types
|
|
48
|
-
"@
|
|
49
|
-
"consola": "^2.15.3",
|
|
50
|
-
"fast-glob": "^3.2.12",
|
|
51
|
-
"fs-extra": "^10.1.0",
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@stacksjs/config": "0.38.1",
|
|
44
|
+
"@stacksjs/logging": "0.38.1",
|
|
45
|
+
"@stacksjs/path": "0.38.1",
|
|
46
|
+
"@stacksjs/storage": "0.38.1",
|
|
47
|
+
"@stacksjs/strings": "0.38.1",
|
|
48
|
+
"@stacksjs/types": "0.38.1",
|
|
49
|
+
"@stacksjs/utils": "0.38.1",
|
|
52
50
|
"markdown-it": "^13.0.1",
|
|
53
|
-
"vue-component-meta": "^1.0.
|
|
51
|
+
"vue-component-meta": "^1.0.9"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
|
-
"mkdist": "^0.
|
|
54
|
+
"mkdist": "^0.4.0",
|
|
55
|
+
"typescript": "^4.8.4"
|
|
57
56
|
},
|
|
58
57
|
"scripts": {
|
|
59
58
|
"build": "mkdist -d",
|
package/dist/generate/index.d.ts
DELETED
package/dist/generate/index.mjs
DELETED