@stacksjs/actions 0.37.3
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/LICENSE.md +21 -0
- package/README.md +59 -0
- package/dist/copy-types.d.ts +5 -0
- package/dist/copy-types.mjs +11 -0
- package/dist/generate/component-meta.d.ts +22 -0
- package/dist/generate/component-meta.mjs +49 -0
- package/dist/generate/index.d.ts +4 -0
- package/dist/generate/index.mjs +4 -0
- package/dist/generate/lib-entries.d.ts +7 -0
- package/dist/generate/lib-entries.mjs +79 -0
- package/dist/generate/package-json.d.ts +1 -0
- package/dist/generate/package-json.mjs +76 -0
- package/dist/generate/vscode-custom-data.d.ts +1 -0
- package/dist/generate/vscode-custom-data.mjs +22 -0
- package/dist/generate/vue-compat.d.ts +1 -0
- package/dist/generate/vue-compat.mjs +12 -0
- package/dist/generate-component-meta.d.ts +5 -0
- package/dist/generate-component-meta.mjs +11 -0
- package/dist/generate-ide-helpers.d.ts +6 -0
- package/dist/generate-ide-helpers.mjs +12 -0
- package/dist/generate-lib-entries.d.ts +2 -0
- package/dist/generate-lib-entries.mjs +17 -0
- package/dist/generate-package-json.d.ts +2 -0
- package/dist/generate-package-json.mjs +12 -0
- package/dist/generate-vscode-custom-data.d.ts +6 -0
- package/dist/generate-vscode-custom-data.mjs +11 -0
- package/dist/generate-vue-compat.d.ts +6 -0
- package/dist/generate-vue-compat.mjs +3 -0
- package/package.json +63 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Open Web Foundation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Stacks Actions
|
|
2
|
+
|
|
3
|
+
This package contains the Stacks Actions.
|
|
4
|
+
|
|
5
|
+
## โ๏ธ Features
|
|
6
|
+
|
|
7
|
+
wip
|
|
8
|
+
|
|
9
|
+
- โก๏ธ
|
|
10
|
+
|
|
11
|
+
wip
|
|
12
|
+
|
|
13
|
+
## ๐ค Usage
|
|
14
|
+
|
|
15
|
+
wip
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm i -D @stacksjs/actions
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Now, you can use it in your project:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import * as invoke from '@stacksjs/actions/generate'
|
|
25
|
+
|
|
26
|
+
// wip
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Learn more in the docs.
|
|
30
|
+
|
|
31
|
+
## ๐งช Testing
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm test
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## ๐ Changelog
|
|
38
|
+
|
|
39
|
+
Please see our [releases](https://github.com/stacksjs/stacksjs/releases) page for more information on what has changed recently.
|
|
40
|
+
|
|
41
|
+
## ๐ช๐ผ Contributing
|
|
42
|
+
|
|
43
|
+
Please see [CONTRIBUTING](../../.github/CONTRIBUTING.md) for details.
|
|
44
|
+
|
|
45
|
+
## ๐ Community
|
|
46
|
+
|
|
47
|
+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
|
|
48
|
+
|
|
49
|
+
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
|
|
50
|
+
|
|
51
|
+
For casual chit-chat with others using this package:
|
|
52
|
+
|
|
53
|
+
[Join the Open Web Discord Server](https://discord.ow3.org)
|
|
54
|
+
|
|
55
|
+
## ๐ License
|
|
56
|
+
|
|
57
|
+
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
|
|
58
|
+
|
|
59
|
+
Made with โค๏ธ
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { frameworkPath } from "@stacksjs/paths";
|
|
3
|
+
import { copyFolder } from "@stacksjs/fs";
|
|
4
|
+
const destinations = [
|
|
5
|
+
[frameworkPath("dist/types/components"), frameworkPath("vue-components/dist/types")],
|
|
6
|
+
[frameworkPath("dist/types/components"), frameworkPath("web-components/dist/types")],
|
|
7
|
+
[frameworkPath("dist/types/functions"), frameworkPath("functions/dist/types")]
|
|
8
|
+
];
|
|
9
|
+
destinations.forEach(([src, dest]) => {
|
|
10
|
+
copyFolder(src, dest);
|
|
11
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ComponentMeta } from 'vue-component-meta';
|
|
2
|
+
/**
|
|
3
|
+
* โน๏ธ Useful links
|
|
4
|
+
*
|
|
5
|
+
* vue-component-meta tests: https://github.com/johnsoncodehk/volar/blob/master/vue-language-tools/vue-component-meta/tests/index.spec.ts
|
|
6
|
+
* Discord thread about improving vue-component-meta: https://discord.com/channels/793943652350427136/1027819645677350912
|
|
7
|
+
* GitHub issue for improving vue-component-meta based on runtime/dynamic props: https://github.com/johnsoncodehk/volar/issues/1854
|
|
8
|
+
* Discord chat: https://discord.com/channels/793943652350427136/1027819645677350912
|
|
9
|
+
* original script: https://raw.githubusercontent.com/jd-solanki/anu/main/scripts/gen-component-meta.ts
|
|
10
|
+
*/
|
|
11
|
+
export interface ComponentApiProps {
|
|
12
|
+
name: ComponentMeta['props'][number]['name'];
|
|
13
|
+
description: ComponentMeta['props'][number]['description'];
|
|
14
|
+
type: ComponentMeta['props'][number]['type'];
|
|
15
|
+
default: ComponentMeta['props'][number]['default'];
|
|
16
|
+
}
|
|
17
|
+
export interface ComponentApi {
|
|
18
|
+
props: ComponentApiProps[];
|
|
19
|
+
events: ComponentMeta['events'];
|
|
20
|
+
slots: ComponentMeta['slots'];
|
|
21
|
+
}
|
|
22
|
+
export declare function generateComponentMeta(): Promise<void>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import fg from "fast-glob";
|
|
3
|
+
import MarkdownIt from "markdown-it";
|
|
4
|
+
import { createComponentMetaChecker } from "vue-component-meta";
|
|
5
|
+
import { frameworkPath, join, parse, projectPath } from "@stacksjs/paths";
|
|
6
|
+
const md = new MarkdownIt();
|
|
7
|
+
export async function generateComponentMeta() {
|
|
8
|
+
const checkerOptions = {
|
|
9
|
+
forceUseTs: true,
|
|
10
|
+
schema: { ignore: ["MyIgnoredNestedProps"] },
|
|
11
|
+
printer: { newLine: 1 }
|
|
12
|
+
};
|
|
13
|
+
const tsconfigChecker = createComponentMetaChecker(
|
|
14
|
+
projectPath("tsconfig.json"),
|
|
15
|
+
checkerOptions
|
|
16
|
+
);
|
|
17
|
+
const filterMeta = (meta) => {
|
|
18
|
+
const props = [];
|
|
19
|
+
meta.props.forEach((prop) => {
|
|
20
|
+
if (prop.global)
|
|
21
|
+
return;
|
|
22
|
+
const { name, description, required, type, default: defaultValue } = prop;
|
|
23
|
+
props.push({
|
|
24
|
+
name: `${name}${required ? "" : "?"}`,
|
|
25
|
+
description: md.render(description),
|
|
26
|
+
type,
|
|
27
|
+
default: defaultValue || "unknown"
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
props,
|
|
32
|
+
events: meta.events,
|
|
33
|
+
slots: meta.slots
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const components = fg.sync(["components/*.vue", "components/**/*.vue"], {
|
|
37
|
+
cwd: projectPath(),
|
|
38
|
+
absolute: true
|
|
39
|
+
});
|
|
40
|
+
components.forEach((componentPath) => {
|
|
41
|
+
const componentExportName = parse(componentPath).name;
|
|
42
|
+
const meta = filterMeta(tsconfigChecker.getComponentMeta(componentPath, componentExportName));
|
|
43
|
+
const metaDirPath = frameworkPath("component-meta");
|
|
44
|
+
if (!existsSync(metaDirPath))
|
|
45
|
+
mkdirSync(metaDirPath);
|
|
46
|
+
const metaJsonFilePath = join(metaDirPath, `${componentExportName}.json`);
|
|
47
|
+
writeFileSync(metaJsonFilePath, JSON.stringify(meta, null, 4));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import consola from "consola";
|
|
2
|
+
import { kebabCase } from "@stacksjs/strings";
|
|
3
|
+
import { libraryEntryPath } from "@stacksjs/paths";
|
|
4
|
+
import { writeTextFile } from "@stacksjs/fs";
|
|
5
|
+
import { determineResetPreset } from "@stacksjs/helpers";
|
|
6
|
+
import { ExitCode } from "@stacksjs/types";
|
|
7
|
+
import { library } from "../../../../config";
|
|
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
|
+
try {
|
|
16
|
+
await writeTextFile({
|
|
17
|
+
path: libraryEntryPath(type),
|
|
18
|
+
data: generateEntryPointData(type)
|
|
19
|
+
});
|
|
20
|
+
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.");
|
|
26
|
+
} catch (err) {
|
|
27
|
+
consola.error(err);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function generateEntryPointData(type) {
|
|
31
|
+
let arr = [];
|
|
32
|
+
if (type === "functions") {
|
|
33
|
+
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.");
|
|
35
|
+
process.exit(ExitCode.FatalError);
|
|
36
|
+
}
|
|
37
|
+
for (const fx of library.functions.functions) {
|
|
38
|
+
if (Array.isArray(fx))
|
|
39
|
+
arr.push(`export * as ${fx[1]} from '../../../functions/${fx[0]}'`);
|
|
40
|
+
else
|
|
41
|
+
arr.push(`export * from '../../../functions/${fx}'`);
|
|
42
|
+
}
|
|
43
|
+
return arr.join("\r\n");
|
|
44
|
+
}
|
|
45
|
+
if (type === "vue-components") {
|
|
46
|
+
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.");
|
|
48
|
+
process.exit(ExitCode.FatalError);
|
|
49
|
+
}
|
|
50
|
+
arr = determineResetPreset();
|
|
51
|
+
for (const component of library.vueComponents.tags.map((tag) => tag.name)) {
|
|
52
|
+
if (Array.isArray(component))
|
|
53
|
+
arr.push(`export { default as ${component[1]} } from '../../../components/${component[0]}.vue'`);
|
|
54
|
+
else
|
|
55
|
+
arr.push(`export { default as ${component} } from '../../../components/${component}.vue'`);
|
|
56
|
+
}
|
|
57
|
+
return arr.join("\r\n");
|
|
58
|
+
}
|
|
59
|
+
arr = determineResetPreset();
|
|
60
|
+
const imports = [...arr, "import { defineCustomElement } from 'vue'"];
|
|
61
|
+
const declarations = [];
|
|
62
|
+
const definitions = [];
|
|
63
|
+
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.");
|
|
65
|
+
process.exit(ExitCode.FatalError);
|
|
66
|
+
}
|
|
67
|
+
for (const component of library.webComponents.tags.map((tag) => tag.name)) {
|
|
68
|
+
if (Array.isArray(component)) {
|
|
69
|
+
imports.push(`import ${component[1]} from '../../../components/${component[0]}.vue'`);
|
|
70
|
+
declarations.push(`const ${component[1]}CustomElement = defineCustomElement(${component[1]})`);
|
|
71
|
+
definitions.push(`customElements.define('${kebabCase(component[1])}', ${component[1]}CustomElement)`);
|
|
72
|
+
} else {
|
|
73
|
+
imports.push(`import ${component} from '../../../components/${component}.vue'`);
|
|
74
|
+
declarations.push(`const ${component}CustomElement = defineCustomElement(${component})`);
|
|
75
|
+
definitions.push(`customElements.define('${kebabCase(component)}', ${component}CustomElement)`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return [...imports, ...declarations, ...definitions].join("\r\n");
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generatePackageJson(type: 'vue-components' | 'web-components' | 'functions'): Promise<void>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import consola from "consola";
|
|
2
|
+
import { writeTextFile } from "@stacksjs/fs";
|
|
3
|
+
import { packageJsonPath } from "@stacksjs/paths";
|
|
4
|
+
import { packageManager } from "../../package.json";
|
|
5
|
+
import { library } from "../../../../config";
|
|
6
|
+
export async function generatePackageJson(type) {
|
|
7
|
+
let name, description, directory, keywords, config;
|
|
8
|
+
if (type === "vue-components") {
|
|
9
|
+
name = library.vueComponents.name;
|
|
10
|
+
description = library.vueComponents.description;
|
|
11
|
+
directory = "components";
|
|
12
|
+
keywords = library.vueComponents.keywords;
|
|
13
|
+
config = "vue-components";
|
|
14
|
+
} else if (type === "web-components") {
|
|
15
|
+
name = library.webComponents.name;
|
|
16
|
+
description = library.webComponents.description;
|
|
17
|
+
directory = "components";
|
|
18
|
+
keywords = library.webComponents.keywords;
|
|
19
|
+
config = "web-components";
|
|
20
|
+
} else if (type === "functions") {
|
|
21
|
+
name = library.functions.name;
|
|
22
|
+
description = library.functions.description;
|
|
23
|
+
directory = "functions";
|
|
24
|
+
keywords = library.functions.keywords;
|
|
25
|
+
config = "functions";
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
await writeTextFile({
|
|
29
|
+
path: packageJsonPath(type),
|
|
30
|
+
data: `{
|
|
31
|
+
"name": "${name}",
|
|
32
|
+
"type": "module",
|
|
33
|
+
"version": "",
|
|
34
|
+
"packageManager": "${packageManager}",
|
|
35
|
+
"description": "${description}",
|
|
36
|
+
"author": "${library.author}",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"homepage": "https://github.com/${library.repository}/tree/main/${directory}#readme",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/${library.repository}.git",
|
|
42
|
+
"directory": "${directory}"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/${library.repository}/issues"
|
|
46
|
+
},
|
|
47
|
+
"keywords": ${JSON.stringify(keywords)},
|
|
48
|
+
"contributors": ${JSON.stringify(library.contributors)},
|
|
49
|
+
"exports": {
|
|
50
|
+
".": {
|
|
51
|
+
"types": "./dist/index.d.ts",
|
|
52
|
+
"require": "./dist/index.cjs",
|
|
53
|
+
"import": "./dist/index.js"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"main": "dist/index.cjs",
|
|
57
|
+
"module": "dist/index.js",
|
|
58
|
+
"types": "dist/index.d.ts",
|
|
59
|
+
"files": [
|
|
60
|
+
"dist"
|
|
61
|
+
],
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "vite build -c ../build/${config}.ts",
|
|
64
|
+
"prepublishOnly": "pnpm run build"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"stacks": "workspace:*"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
`
|
|
71
|
+
});
|
|
72
|
+
consola.success(`Created the ${type} package.json.`);
|
|
73
|
+
} catch (err) {
|
|
74
|
+
consola.error(err);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateVsCodeCustomData(): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import consola from "consola";
|
|
2
|
+
import { customElementsDataPath } from "@stacksjs/paths";
|
|
3
|
+
import { writeTextFile } from "@stacksjs/fs";
|
|
4
|
+
import { library } from "../../../../config";
|
|
5
|
+
export async function generateVsCodeCustomData() {
|
|
6
|
+
try {
|
|
7
|
+
await writeTextFile({
|
|
8
|
+
path: customElementsDataPath(),
|
|
9
|
+
data: generateComponentInfoData()
|
|
10
|
+
});
|
|
11
|
+
} catch (err) {
|
|
12
|
+
consola.error(err);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function generateComponentInfoData() {
|
|
16
|
+
const componentsData = JSON.stringify(library.vueComponents.tags);
|
|
17
|
+
return `{
|
|
18
|
+
"version": 1.1,
|
|
19
|
+
"tags": ${componentsData}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateVueCompat(paths: string[]): Promise<void>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import fg from "fast-glob";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
export async function generateVueCompat(paths) {
|
|
4
|
+
const files = await fg(paths, {
|
|
5
|
+
onlyFiles: true
|
|
6
|
+
});
|
|
7
|
+
for (const f of files) {
|
|
8
|
+
const raw = await fs.readFile(f, "utf-8");
|
|
9
|
+
const changed = raw.replace(/"@vue\/composition-api"/g, "'vue-demi'").replace(/"vue"/g, "'vue-demi'").replace(/'vue'/g, "'vue-demi'");
|
|
10
|
+
await fs.writeFile(f, changed, "utf-8");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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();
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
11
|
+
}
|
|
12
|
+
generate();
|
|
@@ -0,0 +1,17 @@
|
|
|
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.");
|
|
16
|
+
}
|
|
17
|
+
generate();
|
|
@@ -0,0 +1,12 @@
|
|
|
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");
|
|
11
|
+
}
|
|
12
|
+
generate();
|
|
@@ -0,0 +1,11 @@
|
|
|
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();
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stacksjs/actions",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.37.3",
|
|
5
|
+
"packageManager": "pnpm@7.13.6",
|
|
6
|
+
"description": "The Stacks actions.",
|
|
7
|
+
"author": "Chris Breuer",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
10
|
+
"homepage": "https://github.com/stacksjs/stacks/tree/main/.stacks/core/actions#readme",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
14
|
+
"directory": "./.stacks/core/actions"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/stacksjs/stacks/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"actions",
|
|
21
|
+
"stacks",
|
|
22
|
+
"framework",
|
|
23
|
+
"typescript",
|
|
24
|
+
"javascript",
|
|
25
|
+
"vite",
|
|
26
|
+
"nitro",
|
|
27
|
+
"vue",
|
|
28
|
+
"components",
|
|
29
|
+
"library"
|
|
30
|
+
],
|
|
31
|
+
"contributors": [
|
|
32
|
+
"Chris Breuer <chris@ow3.org>"
|
|
33
|
+
],
|
|
34
|
+
"files": [
|
|
35
|
+
"dist"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=v18.10.0",
|
|
39
|
+
"pnpm": ">=7.13.6"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@stacksjs/fs": "0.37.3",
|
|
43
|
+
"@stacksjs/helpers": "0.37.3",
|
|
44
|
+
"@stacksjs/paths": "0.37.3",
|
|
45
|
+
"@stacksjs/strings": "0.37.3",
|
|
46
|
+
"@stacksjs/types": "0.37.3",
|
|
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",
|
|
52
|
+
"markdown-it": "^13.0.1",
|
|
53
|
+
"vue-component-meta": "^1.0.8"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"mkdist": "^0.3.13"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "mkdist -d",
|
|
60
|
+
"dev": "mkdist -d",
|
|
61
|
+
"typecheck": "tsc --noEmit"
|
|
62
|
+
}
|
|
63
|
+
}
|