@stacksjs/actions 0.57.4 → 0.58.20

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 (158) hide show
  1. package/README.md +4 -4
  2. package/dist/src/add.js +29 -0
  3. package/dist/src/build/component-libs.js +6 -0
  4. package/dist/src/build/core.js +25 -0
  5. package/dist/src/build/stacks.js +8 -0
  6. package/dist/src/build.js +226 -0
  7. package/dist/src/bump.js +8 -0
  8. package/dist/src/changelog.js +9 -0
  9. package/dist/src/clean.js +6 -0
  10. package/dist/src/commit.js +17 -0
  11. package/dist/{copy-types.mjs → src/copy-types.js} +7 -4
  12. package/dist/src/database/seed.js +4 -0
  13. package/dist/src/deploy/index.js +31 -0
  14. package/dist/src/dev/components.js +11 -0
  15. package/dist/src/dev/docs.js +7 -0
  16. package/dist/src/dev/index.js +90 -0
  17. package/dist/{examples.mjs → src/examples.js} +18 -8
  18. package/dist/src/fresh.js +18 -0
  19. package/dist/src/generate/component-meta.js +57 -0
  20. package/dist/src/generate/ide-helpers.js +83 -0
  21. package/dist/src/generate/index.js +161 -0
  22. package/dist/src/generate/lib-entries.js +168 -0
  23. package/dist/src/generate/vscode-custom-data.js +82 -0
  24. package/dist/src/generate/vue-compat.js +18 -0
  25. package/dist/{helpers/component-meta.mjs → src/helpers/component-meta.js} +13 -13
  26. package/dist/src/helpers/index.js +56 -0
  27. package/dist/src/helpers/lib-entries.js +160 -0
  28. package/dist/src/helpers/package-json.js +135 -0
  29. package/dist/src/helpers/utils.js +56 -0
  30. package/dist/src/helpers/vscode-custom-data.js +75 -0
  31. package/dist/src/helpers/vue-compat.js +16 -0
  32. package/dist/src/index.js +577 -0
  33. package/dist/src/key-generate.js +10 -0
  34. package/dist/src/lint/fix.js +8 -0
  35. package/dist/src/lint/index.js +21 -0
  36. package/dist/{make.mjs → src/make.js} +71 -49
  37. package/dist/src/prepublish.js +14 -0
  38. package/dist/src/release.js +545 -0
  39. package/dist/src/test/coverage.js +6 -0
  40. package/dist/src/test/feature.js +6 -0
  41. package/dist/src/test/ui.js +6 -0
  42. package/dist/src/test/unit.js +6 -0
  43. package/dist/src/test.js +6 -0
  44. package/dist/src/tinker.js +5 -0
  45. package/dist/src/typecheck.js +6 -0
  46. package/dist/src/types.js +21 -0
  47. package/dist/src/upgrade/dependencies.js +6 -0
  48. package/dist/src/upgrade/framework.js +1 -0
  49. package/dist/src/upgrade/index.js +1 -0
  50. package/dist/src/upgrade.js +39 -0
  51. package/package.json +53 -239
  52. package/LICENSE.md +0 -21
  53. package/dist/add.d.ts +0 -11
  54. package/dist/add.mjs +0 -20
  55. package/dist/build/component-libs.d.ts +0 -1
  56. package/dist/build/component-libs.mjs +0 -4
  57. package/dist/build/core.d.ts +0 -1
  58. package/dist/build/core.mjs +0 -6
  59. package/dist/build/stacks.d.ts +0 -1
  60. package/dist/build/stacks.mjs +0 -12
  61. package/dist/build.d.ts +0 -14
  62. package/dist/build.mjs +0 -68
  63. package/dist/bump.d.ts +0 -1
  64. package/dist/bump.mjs +0 -6
  65. package/dist/changelog.d.ts +0 -1
  66. package/dist/changelog.mjs +0 -6
  67. package/dist/clean.d.ts +0 -1
  68. package/dist/clean.mjs +0 -10
  69. package/dist/commit.d.ts +0 -8
  70. package/dist/commit.mjs +0 -11
  71. package/dist/copy-types.d.ts +0 -5
  72. package/dist/deploy/domains.d.ts +0 -1
  73. package/dist/deploy/domains.mjs +0 -7
  74. package/dist/deploy/index.d.ts +0 -1
  75. package/dist/deploy/index.mjs +0 -3
  76. package/dist/dev/components.d.ts +0 -1
  77. package/dist/dev/components.mjs +0 -4
  78. package/dist/dev/docs.d.ts +0 -1
  79. package/dist/dev/docs.mjs +0 -4
  80. package/dist/dev/index.d.ts +0 -5
  81. package/dist/dev/index.mjs +0 -20
  82. package/dist/examples.d.ts +0 -10
  83. package/dist/fresh.d.ts +0 -1
  84. package/dist/fresh.mjs +0 -6
  85. package/dist/generate/component-meta.d.ts +0 -5
  86. package/dist/generate/component-meta.mjs +0 -8
  87. package/dist/generate/ide-helpers.d.ts +0 -6
  88. package/dist/generate/ide-helpers.mjs +0 -9
  89. package/dist/generate/index.d.ts +0 -17
  90. package/dist/generate/index.mjs +0 -93
  91. package/dist/generate/lib-entries.d.ts +0 -2
  92. package/dist/generate/lib-entries.mjs +0 -14
  93. package/dist/generate/settings.d.ts +0 -1
  94. package/dist/generate/settings.mjs +0 -1
  95. package/dist/generate/vscode-custom-data.d.ts +0 -6
  96. package/dist/generate/vscode-custom-data.mjs +0 -8
  97. package/dist/generate/vue-compat.d.ts +0 -6
  98. package/dist/generate/vue-compat.mjs +0 -3
  99. package/dist/helpers/component-meta.d.ts +0 -22
  100. package/dist/helpers/index.d.ts +0 -6
  101. package/dist/helpers/index.mjs +0 -6
  102. package/dist/helpers/lib-entries.d.ts +0 -13
  103. package/dist/helpers/lib-entries.mjs +0 -101
  104. package/dist/helpers/package-json.d.ts +0 -3
  105. package/dist/helpers/package-json.mjs +0 -82
  106. package/dist/helpers/utils.d.ts +0 -19
  107. package/dist/helpers/utils.mjs +0 -40
  108. package/dist/helpers/vscode-custom-data.d.ts +0 -1
  109. package/dist/helpers/vscode-custom-data.mjs +0 -22
  110. package/dist/helpers/vue-compat.d.ts +0 -1
  111. package/dist/helpers/vue-compat.mjs +0 -12
  112. package/dist/index.d.ts +0 -1
  113. package/dist/index.mjs +0 -1
  114. package/dist/key-generate.d.ts +0 -1
  115. package/dist/key-generate.mjs +0 -8
  116. package/dist/lint/fix.d.ts +0 -1
  117. package/dist/lint/fix.mjs +0 -4
  118. package/dist/lint/index.d.ts +0 -1
  119. package/dist/lint/index.mjs +0 -14
  120. package/dist/make.d.ts +0 -25
  121. package/dist/migrate.d.ts +0 -1
  122. package/dist/migrate.mjs +0 -2
  123. package/dist/preinstall.d.ts +0 -8
  124. package/dist/preinstall.mjs +0 -17
  125. package/dist/prepublish.d.ts +0 -1
  126. package/dist/prepublish.mjs +0 -11
  127. package/dist/release.d.ts +0 -2
  128. package/dist/release.mjs +0 -16
  129. package/dist/seed.d.ts +0 -1
  130. package/dist/seed.mjs +0 -2
  131. package/dist/test/coverage.d.ts +0 -1
  132. package/dist/test/coverage.mjs +0 -4
  133. package/dist/test/feature.d.ts +0 -1
  134. package/dist/test/feature.mjs +0 -4
  135. package/dist/test/ui.d.ts +0 -1
  136. package/dist/test/ui.mjs +0 -4
  137. package/dist/test/unit.d.ts +0 -1
  138. package/dist/test/unit.mjs +0 -4
  139. package/dist/test.d.ts +0 -1
  140. package/dist/test.mjs +0 -4
  141. package/dist/tinker.d.ts +0 -1
  142. package/dist/tinker.mjs +0 -3
  143. package/dist/typecheck.d.ts +0 -1
  144. package/dist/typecheck.mjs +0 -4
  145. package/dist/types.d.ts +0 -8
  146. package/dist/types.mjs +0 -14
  147. package/dist/upgrade/dependencies.d.ts +0 -0
  148. package/dist/upgrade/dependencies.mjs +0 -0
  149. package/dist/upgrade/framework.d.ts +0 -0
  150. package/dist/upgrade/framework.mjs +0 -0
  151. package/dist/upgrade/index.d.ts +0 -0
  152. package/dist/upgrade/index.mjs +0 -0
  153. package/dist/upgrade/node.d.ts +0 -0
  154. package/dist/upgrade/node.mjs +0 -0
  155. package/dist/upgrade/package-manager.d.ts +0 -0
  156. package/dist/upgrade/package-manager.mjs +0 -0
  157. package/dist/upgrade.d.ts +0 -5
  158. package/dist/upgrade.mjs +0 -55
@@ -0,0 +1,160 @@
1
+ // @bun
2
+ // src/helpers/lib-entries.ts
3
+ import process from "process";
4
+ import {log} from "@stacksjs/logging";
5
+ import {kebabCase} from "@stacksjs/strings";
6
+ import {componentsPath, functionsPath, libraryEntryPath} from "@stacksjs/path";
7
+ import {writeTextFile} from "@stacksjs/storage";
8
+ import {determineResetPreset} from "@stacksjs/utils";
9
+ import {ExitCode} from "@stacksjs/types";
10
+
11
+ // /Users/chrisbreuer/Code/stacks/config/library.ts
12
+ var library_default = {
13
+ name: "hello-world",
14
+ owner: "@stacksjs",
15
+ repository: "stacksjs/stacks",
16
+ license: "MIT",
17
+ author: "Chris Breuer",
18
+ contributors: ["Chris Breuer <chris@stacksjs.org>"],
19
+ defaultLanguage: "en",
20
+ vueComponents: {
21
+ name: "hello-world-vue",
22
+ description: "Your Vue component library description",
23
+ keywords: ["component", "library", "vue", "vite", "typescript", "javascript"],
24
+ tags: [{
25
+ name: ["HelloWorld", "AppHelloWorld"],
26
+ description: "The Hello World custom element, built via this framework.",
27
+ attributes: [{
28
+ name: "greeting",
29
+ description: "The greeting."
30
+ }]
31
+ }]
32
+ },
33
+ webComponents: {
34
+ name: "hello-world-elements",
35
+ description: "Your framework agnostic web component library description.",
36
+ keywords: ["custom-elements", "web-components", "library", "framework-agnostic", "typescript", "javascript"],
37
+ tags: [{
38
+ name: ["HelloWorld", "AppHelloWorld"],
39
+ description: "The Hello World custom element, built via this framework.",
40
+ attributes: [{
41
+ name: "greeting",
42
+ description: "The greeting."
43
+ }]
44
+ }]
45
+ },
46
+ functions: {
47
+ name: "hello-world-fx",
48
+ description: "Your function library description.",
49
+ keywords: ["functions", "composables", "library", "typescript", "javascript"],
50
+ shouldGenerateSourcemap: false,
51
+ functions: [
52
+ "counter",
53
+ "dark"
54
+ ]
55
+ }
56
+ };
57
+
58
+ // src/helpers/lib-entries.ts
59
+ async function generateLibEntry(type) {
60
+ await createLibraryEntryPoint(type);
61
+ }
62
+ async function createLibraryEntryPoint(type) {
63
+ if (type === "vue-components")
64
+ await createVueLibraryEntryPoint();
65
+ if (type === "web-components")
66
+ await createWebComponentLibraryEntryPoint();
67
+ if (type === "functions")
68
+ await createFunctionLibraryEntryPoint();
69
+ }
70
+ async function createVueLibraryEntryPoint(type = "vue-components") {
71
+ log.info("Creating the Vue component library entry point...");
72
+ await writeTextFile({
73
+ path: libraryEntryPath(type),
74
+ data: generateEntryPointData(type)
75
+ }).catch((err) => {
76
+ log.error("There was an error generating the Vue component library entry point.", err);
77
+ process.exit(ExitCode.FatalError);
78
+ });
79
+ log.success("Created the Vue component library entry point");
80
+ }
81
+ async function createWebComponentLibraryEntryPoint(type = "web-components") {
82
+ log.info("Creating the Web Component library entry point...");
83
+ await writeTextFile({
84
+ path: libraryEntryPath(type),
85
+ data: generateEntryPointData(type)
86
+ }).catch((err) => {
87
+ log.error("There was an error generating the Web Component library entry point", err);
88
+ process.exit(ExitCode.FatalError);
89
+ });
90
+ log.success("Created Web Component library entry point");
91
+ }
92
+ async function createFunctionLibraryEntryPoint(type = "functions") {
93
+ log.info("Creating the Function library entry point...");
94
+ await writeTextFile({
95
+ path: libraryEntryPath(type),
96
+ data: generateEntryPointData(type)
97
+ }).catch((err) => {
98
+ log.error("There was an error generating Function library entry point", err);
99
+ process.exit(ExitCode.FatalError);
100
+ });
101
+ log.success("Created Functions library entry point");
102
+ }
103
+ function generateEntryPointData(type) {
104
+ let arr = [];
105
+ if (type === "functions") {
106
+ if (!library_default.functions?.functions) {
107
+ log.error(new Error("There are no functions defined to be built. Please check your config/library.ts file for potential adjustments"));
108
+ process.exit();
109
+ }
110
+ for (const fx of library_default.functions?.functions) {
111
+ if (Array.isArray(fx))
112
+ arr.push(`export * as ${fx[1]} from '${functionsPath(fx[0])}'`);
113
+ else
114
+ arr.push(`export * from '${functionsPath(fx)}'`);
115
+ }
116
+ return arr.join("\r\n");
117
+ }
118
+ if (type === "vue-components") {
119
+ if (!library_default.vueComponents?.tags) {
120
+ log.error(new Error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments"));
121
+ process.exit();
122
+ }
123
+ arr = determineResetPreset();
124
+ for (const component of library_default.vueComponents?.tags.map((tag) => tag.name)) {
125
+ if (Array.isArray(component))
126
+ arr.push(`export { default as ${component[1]} } from '${componentsPath(component[0])}.stx'`);
127
+ else
128
+ arr.push(`export { default as ${component} } from '${componentsPath(component)}.stx'`);
129
+ }
130
+ return arr.join("\r\n");
131
+ }
132
+ arr = determineResetPreset();
133
+ const imports = [...arr, "import { defineCustomElement } from \'vue\'"];
134
+ const declarations = [];
135
+ const definitions = [];
136
+ if (!library_default.webComponents?.tags) {
137
+ log.error(new Error("There are no components defined to be built. Please check your config/library.ts file for potential adjustments"));
138
+ process.exit();
139
+ }
140
+ for (const component of library_default.webComponents?.tags.map((tag) => tag.name)) {
141
+ if (Array.isArray(component)) {
142
+ imports.push(`import ${component[1]} from '${componentsPath(component[0])}.stx'`);
143
+ declarations.push(`const ${component[1]}CustomElement = defineCustomElement(${component[1]})`);
144
+ definitions.push(`customElements.define('${kebabCase(component[1])}', ${component[1]}CustomElement)`);
145
+ } else {
146
+ imports.push(`import ${component} from '${componentsPath(component)}.stx'`);
147
+ declarations.push(`const ${component}CustomElement = defineCustomElement(${component})`);
148
+ definitions.push(`customElements.define('${kebabCase(component)}', ${component}CustomElement)`);
149
+ }
150
+ }
151
+ return [...imports, ...declarations, ...definitions].join("\r\n");
152
+ }
153
+ export {
154
+ generateLibEntry,
155
+ generateEntryPointData,
156
+ createWebComponentLibraryEntryPoint,
157
+ createVueLibraryEntryPoint,
158
+ createLibraryEntryPoint,
159
+ createFunctionLibraryEntryPoint
160
+ };
@@ -0,0 +1,135 @@
1
+ // @bun
2
+ // src/helpers/package-json.ts
3
+ import {log} from "@stacksjs/logging";
4
+ import {writeTextFile} from "@stacksjs/storage";
5
+ import {packageJsonPath} from "@stacksjs/path";
6
+
7
+ // /Users/chrisbreuer/Code/stacks/config/library.ts
8
+ var library_default = {
9
+ name: "hello-world",
10
+ owner: "@stacksjs",
11
+ repository: "stacksjs/stacks",
12
+ license: "MIT",
13
+ author: "Chris Breuer",
14
+ contributors: ["Chris Breuer <chris@stacksjs.org>"],
15
+ defaultLanguage: "en",
16
+ vueComponents: {
17
+ name: "hello-world-vue",
18
+ description: "Your Vue component library description",
19
+ keywords: ["component", "library", "vue", "vite", "typescript", "javascript"],
20
+ tags: [{
21
+ name: ["HelloWorld", "AppHelloWorld"],
22
+ description: "The Hello World custom element, built via this framework.",
23
+ attributes: [{
24
+ name: "greeting",
25
+ description: "The greeting."
26
+ }]
27
+ }]
28
+ },
29
+ webComponents: {
30
+ name: "hello-world-elements",
31
+ description: "Your framework agnostic web component library description.",
32
+ keywords: ["custom-elements", "web-components", "library", "framework-agnostic", "typescript", "javascript"],
33
+ tags: [{
34
+ name: ["HelloWorld", "AppHelloWorld"],
35
+ description: "The Hello World custom element, built via this framework.",
36
+ attributes: [{
37
+ name: "greeting",
38
+ description: "The greeting."
39
+ }]
40
+ }]
41
+ },
42
+ functions: {
43
+ name: "hello-world-fx",
44
+ description: "Your function library description.",
45
+ keywords: ["functions", "composables", "library", "typescript", "javascript"],
46
+ shouldGenerateSourcemap: false,
47
+ functions: [
48
+ "counter",
49
+ "dark"
50
+ ]
51
+ }
52
+ };
53
+
54
+ // src/helpers/package-json.ts
55
+ async function generatePackageJson(type) {
56
+ let name, description, directory, keywords, config, prettyName;
57
+ if (type === "vue-components") {
58
+ name = library_default.vueComponents?.name;
59
+ description = library_default.vueComponents?.description;
60
+ directory = "components";
61
+ keywords = library_default.vueComponents?.keywords;
62
+ config = "vue-components";
63
+ } else if (type === "web-components") {
64
+ name = library_default.webComponents?.name;
65
+ description = library_default.webComponents?.description;
66
+ directory = "components";
67
+ keywords = library_default.webComponents?.keywords;
68
+ config = "web-components";
69
+ } else if (type === "functions") {
70
+ name = library_default.functions?.name;
71
+ description = library_default.functions?.description;
72
+ directory = "functions";
73
+ keywords = library_default.functions?.keywords;
74
+ config = "functions";
75
+ }
76
+ try {
77
+ await writeTextFile({
78
+ path: packageJsonPath(type),
79
+ data: `{
80
+ "name": "${name}",
81
+ "type": "module",
82
+ "version": "",
83
+ "packageManager": "bun",
84
+ "description": "${description}",
85
+ "author": "${library_default.author}",
86
+ "license": "MIT",
87
+ "homepage": "https://github.com/${library_default.repository}/tree/main/${directory}#readme",
88
+ "repository": {
89
+ "type": "git",
90
+ "url": "git+https://github.com/${library_default.repository}.git",
91
+ "directory": "${directory}"
92
+ },
93
+ "bugs": {
94
+ "url": "https://github.com/${library_default.repository}/issues"
95
+ },
96
+ "keywords": ${JSON.stringify(keywords)},
97
+ "contributors": ${JSON.stringify(library_default.contributors)},
98
+ "exports": {
99
+ ".": {
100
+ "types": "./dist/index.d.ts",
101
+ "require": "./dist/index.cjs",
102
+ "import": "./dist/index.js"
103
+ }
104
+ },
105
+ "main": "dist/index.cjs",
106
+ "module": "dist/index.js",
107
+ "types": "dist/index.d.ts",
108
+ "files": [
109
+ "dist",
110
+ "README.md"
111
+ ],
112
+ "scripts": {
113
+ "build": "vite build -c ../build/${config}.ts",
114
+ "prepublishOnly": "bun --bun run build"
115
+ },
116
+ "devDependencies": {
117
+ "stacks": "workspace:*"
118
+ }
119
+ }
120
+ `
121
+ });
122
+ if (type === "vue-components")
123
+ prettyName = "Vue Component library";
124
+ else if (type === "web-components")
125
+ prettyName = "Web Component library";
126
+ else if (type === "functions")
127
+ prettyName = "Function Library";
128
+ log.success(`Created the ${prettyName} package.json file`);
129
+ } catch (err) {
130
+ log.error(`There was an error creating the ${prettyName} package.json`, err);
131
+ }
132
+ }
133
+ export {
134
+ generatePackageJson
135
+ };
@@ -0,0 +1,56 @@
1
+ // @bun
2
+ // src/helpers/utils.ts
3
+ import * as storage from "@stacksjs/storage";
4
+ import {italic, runCommand, runCommands, underline} from "@stacksjs/cli";
5
+ import {log} from "@stacksjs/logging";
6
+ import * as p from "@stacksjs/path";
7
+ import {err, handleError} from "@stacksjs/error-handling";
8
+ var parseOptions = function(options) {
9
+ if (!options)
10
+ return "";
11
+ const parsedOptions = Object.entries(options).map(([key, value]) => {
12
+ if (key.length === 1)
13
+ return `-${key}=${value}`;
14
+ if (typeof value === "boolean" && value)
15
+ return `--${key}`;
16
+ return `--${key}=${typeof value === "string" && value.includes(" ") ? `"${value}"` : value}`;
17
+ });
18
+ return parsedOptions.filter(Boolean).join(" ").replace("----=", "");
19
+ };
20
+ async function runAction(action, options) {
21
+ if (!hasAction(action))
22
+ return err(handleError(`The specified action "${action}" does not exist`));
23
+ const opts = parseOptions(options);
24
+ const path = p.relativeActionsPath(`${action}.ts`);
25
+ const cmd = `bun --bun ${`${path} ${opts}`}`;
26
+ const o = {
27
+ cwd: options?.cwd || p.projectPath(),
28
+ ...options
29
+ };
30
+ if (options?.verbose) {
31
+ log.debug("Running cmd:", underline(italic(cmd)));
32
+ log.debug("Running action:", underline(italic(`./actions/${action}.ts`)));
33
+ log.debug("with action options of:", o);
34
+ }
35
+ return await runCommand(cmd, o);
36
+ }
37
+ async function runActions(actions, options) {
38
+ if (!actions.length)
39
+ return err("No actions were specified");
40
+ for (const action of actions) {
41
+ if (!hasAction(action))
42
+ return err(`The specified action "${action}" does not exist`);
43
+ }
44
+ const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)}`);
45
+ return await runCommands(commands, options);
46
+ }
47
+ function hasAction(action) {
48
+ if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
49
+ return true;
50
+ return storage.isFile(p.actionsPath(`${action}.ts`));
51
+ }
52
+ export {
53
+ runActions,
54
+ runAction,
55
+ hasAction
56
+ };
@@ -0,0 +1,75 @@
1
+ // @bun
2
+ // src/helpers/vscode-custom-data.ts
3
+ import {log} from "@stacksjs/logging";
4
+ import {customElementsDataPath} from "@stacksjs/path";
5
+ import {writeTextFile} from "@stacksjs/storage";
6
+
7
+ // /Users/chrisbreuer/Code/stacks/config/library.ts
8
+ var library_default = {
9
+ name: "hello-world",
10
+ owner: "@stacksjs",
11
+ repository: "stacksjs/stacks",
12
+ license: "MIT",
13
+ author: "Chris Breuer",
14
+ contributors: ["Chris Breuer <chris@stacksjs.org>"],
15
+ defaultLanguage: "en",
16
+ vueComponents: {
17
+ name: "hello-world-vue",
18
+ description: "Your Vue component library description",
19
+ keywords: ["component", "library", "vue", "vite", "typescript", "javascript"],
20
+ tags: [{
21
+ name: ["HelloWorld", "AppHelloWorld"],
22
+ description: "The Hello World custom element, built via this framework.",
23
+ attributes: [{
24
+ name: "greeting",
25
+ description: "The greeting."
26
+ }]
27
+ }]
28
+ },
29
+ webComponents: {
30
+ name: "hello-world-elements",
31
+ description: "Your framework agnostic web component library description.",
32
+ keywords: ["custom-elements", "web-components", "library", "framework-agnostic", "typescript", "javascript"],
33
+ tags: [{
34
+ name: ["HelloWorld", "AppHelloWorld"],
35
+ description: "The Hello World custom element, built via this framework.",
36
+ attributes: [{
37
+ name: "greeting",
38
+ description: "The greeting."
39
+ }]
40
+ }]
41
+ },
42
+ functions: {
43
+ name: "hello-world-fx",
44
+ description: "Your function library description.",
45
+ keywords: ["functions", "composables", "library", "typescript", "javascript"],
46
+ shouldGenerateSourcemap: false,
47
+ functions: [
48
+ "counter",
49
+ "dark"
50
+ ]
51
+ }
52
+ };
53
+
54
+ // src/helpers/vscode-custom-data.ts
55
+ async function generateVsCodeCustomData() {
56
+ try {
57
+ await writeTextFile({
58
+ path: customElementsDataPath(),
59
+ data: generateComponentInfoData()
60
+ });
61
+ } catch (err) {
62
+ log.error("There was an error generating the VS Code custom data file.", err);
63
+ }
64
+ }
65
+ var generateComponentInfoData = function() {
66
+ const componentsData = JSON.stringify(library_default.vueComponents?.tags);
67
+ return `{
68
+ "version": 1.1,
69
+ "tags": ${componentsData}
70
+ }
71
+ `;
72
+ };
73
+ export {
74
+ generateVsCodeCustomData
75
+ };
@@ -0,0 +1,16 @@
1
+ // @bun
2
+ // src/helpers/vue-compat.ts
3
+ import {fs, glob} from "@stacksjs/storage";
4
+ async function generateVueCompat(paths) {
5
+ const files = await glob(paths, {
6
+ onlyFiles: true
7
+ });
8
+ for (const f of files) {
9
+ const raw = await fs.readFile(f, "utf-8");
10
+ const changed = raw.replace(/"@vue\/composition-api"/g, "\'vue-demi\'").replace(/"vue"/g, "\'vue-demi\'").replace(/'vue'/g, "\'vue-demi\'");
11
+ await fs.writeFile(f, changed, "utf-8");
12
+ }
13
+ }
14
+ export {
15
+ generateVueCompat
16
+ };