@stacksjs/actions 0.58.73 → 0.59.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.
Files changed (108) hide show
  1. package/dist/action.d.ts +36 -0
  2. package/dist/add.d.ts +6 -0
  3. package/dist/build/component-libs.d.ts +1 -0
  4. package/dist/build/core.d.ts +1 -0
  5. package/dist/build/stacks.d.ts +1 -0
  6. package/dist/build.d.ts +9 -0
  7. package/dist/bump.d.ts +1 -0
  8. package/dist/changelog.d.ts +1 -0
  9. package/dist/clean.d.ts +1 -0
  10. package/dist/commit.d.ts +3 -0
  11. package/dist/copy-types.d.ts +5 -0
  12. package/dist/database/seed.d.ts +1 -0
  13. package/dist/deploy/index.d.ts +1 -0
  14. package/dist/dev/components.d.ts +1 -0
  15. package/dist/dev/docs.d.ts +1 -0
  16. package/dist/dev/index.d.ts +10 -0
  17. package/dist/examples.d.ts +5 -0
  18. package/dist/fresh.d.ts +1 -0
  19. package/dist/generate/component-meta.d.ts +5 -0
  20. package/dist/generate/ide-helpers.d.ts +6 -0
  21. package/dist/generate/index.d.ts +13 -0
  22. package/dist/generate/lib-entries.d.ts +2 -0
  23. package/dist/generate/vscode-custom-data.d.ts +6 -0
  24. package/dist/helpers/component-meta.d.ts +22 -0
  25. package/dist/helpers/lib-entries.d.ts +13 -0
  26. package/dist/helpers/package-json.d.ts +3 -0
  27. package/dist/helpers/utils.d.ts +18 -0
  28. package/dist/helpers/vscode-custom-data.d.ts +2 -0
  29. package/dist/index.d.ts +7 -0
  30. package/dist/key-generate.d.ts +1 -0
  31. package/dist/lint/fix.d.ts +1 -0
  32. package/dist/lint/index.d.ts +1 -0
  33. package/dist/make.d.ts +20 -0
  34. package/dist/prepublish.d.ts +1 -0
  35. package/dist/release.d.ts +2 -0
  36. package/dist/test/coverage.d.ts +1 -0
  37. package/dist/test/feature.d.ts +1 -0
  38. package/dist/test/ui.d.ts +1 -0
  39. package/dist/test/unit.d.ts +1 -0
  40. package/dist/test.d.ts +1 -0
  41. package/dist/tinker.d.ts +1 -0
  42. package/dist/typecheck.d.ts +1 -0
  43. package/dist/types.d.ts +3 -0
  44. package/dist/upgrade/dependencies.d.ts +1 -0
  45. package/dist/upgrade/framework.d.ts +1 -0
  46. package/dist/upgrade/index.d.ts +1 -0
  47. package/dist/upgrade.d.ts +4 -0
  48. package/package.json +5 -3
  49. package/src/bump.ts +8 -3
  50. package/src/check/ports.ts +11 -8
  51. package/src/deploy/index.ts +2 -6
  52. package/src/dev/index.ts +1 -1
  53. package/src/find-projects.ts +1 -1
  54. package/src/generate/index.ts +1 -1
  55. package/src/helpers/utils.ts +10 -14
  56. package/src/index.ts +1 -2
  57. package/src/lint/fix.ts +1 -0
  58. package/src/upgrade/shell.ts +5 -5
  59. package/dist/src/add.js +0 -29
  60. package/dist/src/build/component-libs.js +0 -6
  61. package/dist/src/build/core.js +0 -21
  62. package/dist/src/build/stacks.js +0 -8
  63. package/dist/src/build.js +0 -219
  64. package/dist/src/bump.js +0 -14
  65. package/dist/src/changelog.js +0 -17
  66. package/dist/src/clean.js +0 -6
  67. package/dist/src/commit.js +0 -17
  68. package/dist/src/copy-types.js +0 -14
  69. package/dist/src/database/seed.js +0 -1
  70. package/dist/src/deploy/index.js +0 -31
  71. package/dist/src/dev/components.js +0 -11
  72. package/dist/src/dev/docs.js +0 -7
  73. package/dist/src/dev/index.js +0 -92
  74. package/dist/src/examples.js +0 -43
  75. package/dist/src/fresh.js +0 -18
  76. package/dist/src/generate/component-meta.js +0 -59
  77. package/dist/src/generate/ide-helpers.js +0 -91
  78. package/dist/src/generate/index.js +0 -154
  79. package/dist/src/generate/lib-entries.js +0 -170
  80. package/dist/src/generate/vscode-custom-data.js +0 -91
  81. package/dist/src/helpers/component-meta.js +0 -50
  82. package/dist/src/helpers/index.js +0 -48
  83. package/dist/src/helpers/lib-entries.js +0 -161
  84. package/dist/src/helpers/package-json.js +0 -136
  85. package/dist/src/helpers/utils.js +0 -48
  86. package/dist/src/helpers/vscode-custom-data.js +0 -83
  87. package/dist/src/index.js +0 -590
  88. package/dist/src/key-generate.js +0 -10
  89. package/dist/src/lint/fix.js +0 -12
  90. package/dist/src/lint/index.js +0 -17
  91. package/dist/src/make.js +0 -291
  92. package/dist/src/prepublish.js +0 -14
  93. package/dist/src/release.js +0 -559
  94. package/dist/src/test/coverage.js +0 -6
  95. package/dist/src/test/feature.js +0 -6
  96. package/dist/src/test/ui.js +0 -6
  97. package/dist/src/test/unit.js +0 -6
  98. package/dist/src/test.js +0 -6
  99. package/dist/src/tinker.js +0 -5
  100. package/dist/src/typecheck.js +0 -6
  101. package/dist/src/types.js +0 -21
  102. package/dist/src/upgrade/dependencies.js +0 -6
  103. package/dist/src/upgrade/framework.js +0 -1
  104. package/dist/src/upgrade/index.js +0 -58
  105. package/dist/src/upgrade.js +0 -47
  106. package/src/generate/caddyfile.ts +0 -44
  107. package/src/helpers/index.ts +0 -1
  108. package/src/start-caddy.ts +0 -13
@@ -1,21 +0,0 @@
1
- // @bun
2
- // src/build/core.ts
3
- import process from "process";
4
- import {glob} from "@stacksjs/storage";
5
- import {dim, italic, log} from "@stacksjs/cli";
6
- import {corePath} from "@stacksjs/path";
7
- import {ExitCode} from "@stacksjs/types";
8
- var {$ } = globalThis.Bun;
9
- log.info("Building core packages");
10
- var dirs = (await glob([corePath("*")], { onlyDirectories: true })).sort();
11
- if (dirs.length === 0) {
12
- log.info("No core packages found");
13
- process.exit(ExitCode.FatalError);
14
- }
15
- for (const folder of dirs) {
16
- log.info(`\uD83C\uDFD7\uFE0F Building ${italic(dim(folder))}`);
17
- $.cwd(folder);
18
- await $`bun run build`;
19
- log.success(`${italic(dim(folder))} built`);
20
- console.log(``);
21
- }
@@ -1,8 +0,0 @@
1
- // @bun
2
- // src/build/stacks.ts
3
- import {frameworkPath} from "@stacksjs/path";
4
- import {runCommands} from "@stacksjs/cli";
5
- await runCommands([
6
- "bun build:cli",
7
- "bun build:core"
8
- ], { verbose: true, cwd: frameworkPath() });
package/dist/src/build.js DELETED
@@ -1,219 +0,0 @@
1
- // @bun
2
- // src/helpers/utils.ts
3
- import * as storage from "@stacksjs/storage";
4
- import {buddyOptions, runCommand, runCommands} 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
- async function runAction(action, options) {
9
- const opts = buddyOptions();
10
- const path = p.relativeActionsPath(`${action}.ts`);
11
- const cmd = `bun --bun ${path} ${opts}`.trimEnd();
12
- const optionsWithCwd = {
13
- cwd: options?.cwd || p.projectPath(),
14
- ...options
15
- };
16
- log.debug("runAction:", cmd);
17
- log.debug("action options:", optionsWithCwd);
18
- if (!hasAction(action))
19
- return err(handleError(`The specified action "${action}" does not exist`));
20
- return await runCommand(cmd, optionsWithCwd);
21
- }
22
- async function runActions(actions, options) {
23
- log.debug("runActions:", actions);
24
- log.debug("actions options:", options);
25
- if (!actions.length)
26
- return err("No actions were specified");
27
- for (const action of actions) {
28
- if (!hasAction(action))
29
- return err(`The specified action "${action}" does not exist`);
30
- }
31
- const opts = buddyOptions();
32
- const o = {
33
- cwd: options?.cwd || p.projectPath(),
34
- ...options
35
- };
36
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
37
- return await runCommands(commands, o);
38
- }
39
- function hasAction(action) {
40
- if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
41
- return true;
42
- return storage.isFile(p.actionsPath(`${action}.ts`));
43
- }
44
- // src/generate/index.ts
45
- import process from "process";
46
- import {log as log2} from "@stacksjs/logging";
47
- import {Action, NpmScript} from "@stacksjs/enums";
48
- import {runCommand as runCommand2} from "@stacksjs/cli";
49
- import {runNpmScript} from "@stacksjs/utils";
50
- import {frameworkPath, projectPath as projectPath2} from "@stacksjs/path";
51
- async function invoke(options) {
52
- if (options?.types)
53
- await generateTypes(options);
54
- else if (options?.entries)
55
- await generateLibEntries(options);
56
- else if (options?.webTypes)
57
- await generateWebTypes(options);
58
- else if (options?.customData)
59
- await generateVsCodeCustomData(options);
60
- else if (options?.ideHelpers)
61
- await generateIdeHelpers(options);
62
- else if (options?.componentMeta)
63
- await generateComponentMeta(options);
64
- else if (options?.coreSymlink)
65
- await generateCoreSymlink();
66
- }
67
- function generate(options) {
68
- return invoke(options);
69
- }
70
- async function generateLibEntries(options) {
71
- const result = await runAction(Action.GenerateLibraryEntries, {
72
- ...options,
73
- cwd: projectPath2()
74
- });
75
- if (result.isErr()) {
76
- log2.error("There was an error generating your library entry points", result.error);
77
- process.exit();
78
- }
79
- log2.success("Library entry points generated successfully");
80
- }
81
- async function generateWebTypes(options) {
82
- const result = await runNpmScript(NpmScript.GenerateWebTypes, options);
83
- if (result.isErr()) {
84
- log2.error("There was an error generating the web-types.json file.", result.error);
85
- process.exit();
86
- }
87
- log2.success("Successfully generated the web-types.json file");
88
- }
89
- async function generateVsCodeCustomData(options) {
90
- const result = await runNpmScript(NpmScript.GenerateVsCodeCustomData, {
91
- cwd: frameworkPath(),
92
- ...options
93
- });
94
- if (result.isErr()) {
95
- log2.error("There was an error generating the custom-elements.json file.", result.error);
96
- process.exit();
97
- }
98
- await runAction(Action.LintFix, { verbose: true });
99
- log2.success("Successfully generated the custom-elements.json file");
100
- }
101
- async function generateIdeHelpers(options) {
102
- const result = await runNpmScript(NpmScript.GenerateIdeHelpers, options);
103
- if (result.isErr()) {
104
- log2.error("There was an error generating IDE helpers.", result.error);
105
- process.exit();
106
- }
107
- await runAction(Action.LintFix, { verbose: true });
108
- log2.success("Successfully generated IDE helpers");
109
- }
110
- async function generateComponentMeta(options) {
111
- const result = await runNpmScript(NpmScript.GenerateComponentMeta, options);
112
- if (result.isErr()) {
113
- log2.error("There was an error generating your component meta information.", result.error);
114
- process.exit();
115
- }
116
- await runAction(Action.LintFix, { verbose: true });
117
- log2.success("Successfully generated component meta information");
118
- }
119
- async function generateTypes(options) {
120
- const result = await runNpmScript(NpmScript.GenerateTypes, {
121
- cwd: frameworkPath(),
122
- ...options
123
- });
124
- if (result.isErr()) {
125
- log2.error("There was an error generating your types.", result.error);
126
- process.exit();
127
- }
128
- log2.success("Types were generated successfully");
129
- }
130
- function generateMigrations() {
131
- log2.success("Successfully updated migrations");
132
- }
133
- function generatePkgxConfig() {
134
- log2.success("Successfully generated `./pkgx.yaml` based on your config");
135
- }
136
- async function generateSeeder() {
137
- }
138
- async function generateCoreSymlink() {
139
- await runCommand2(`ln -s ${frameworkPath()} ${projectPath2(".stacks")}`);
140
- }
141
-
142
- // src/build.ts
143
- import {log as log3} from "@stacksjs/logging";
144
- import {hasComponents, hasFunctions} from "@stacksjs/storage";
145
- import {runNpmScript as runNpmScript2} from "@stacksjs/utils";
146
- import {NpmScript as NpmScript2} from "@stacksjs/enums";
147
- async function invoke2(options) {
148
- if (options.components)
149
- await componentLibraries(options);
150
- else if (options.vueComponents)
151
- await vueComponentLibrary(options);
152
- else if (options.webComponents || options.elements)
153
- await webComponentLibrary(options);
154
- else if (options.functions)
155
- await functionsLibrary(options);
156
- else if (options.docs)
157
- await docs(options);
158
- else if (options.stacks)
159
- await stacks(options);
160
- await generateTypes();
161
- }
162
- async function build(options) {
163
- return invoke2(options);
164
- }
165
- async function componentLibraries(options) {
166
- await runNpmScript2(NpmScript2.GenerateEntries, options);
167
- await vueComponentLibrary(options);
168
- await webComponentLibrary(options);
169
- }
170
- async function vueComponentLibrary(options) {
171
- if (hasComponents()) {
172
- log3.info("Building your component library...");
173
- await runNpmScript2(NpmScript2.BuildComponents, options);
174
- log3.success("Your component library was built successfully");
175
- } else {
176
- log3.warn("No components found.");
177
- log3.info("Before you can build components,");
178
- log3.info("you need to have created some in the ./components folder.");
179
- }
180
- }
181
- async function webComponentLibrary(options) {
182
- log3.info("Building your component library for production use & npm/CDN distribution...");
183
- if (hasComponents()) {
184
- await runNpmScript2(NpmScript2.BuildWebComponents, options);
185
- log3.success("Your Web Component library was built successfully");
186
- } else {
187
- log3.info("No components found.");
188
- }
189
- }
190
- async function docs(options) {
191
- log3.info("Building the documentation site...");
192
- await runNpmScript2(NpmScript2.BuildDocs, options);
193
- log3.success("Docs built successfully");
194
- }
195
- async function stacks(options) {
196
- log3.info("Building the Stacks Framework...");
197
- await runNpmScript2(NpmScript2.BuildStacks, options);
198
- log3.success("Stacks built successfully");
199
- }
200
- async function functionsLibrary(options) {
201
- if (hasFunctions()) {
202
- log3.info("Building your functions library for production usages...");
203
- log3.info("Production usages include: manual npm distribution and/or CDN distribution");
204
- await runNpmScript2(NpmScript2.BuildFunctions, options);
205
- log3.success("Functions library built successfully");
206
- } else {
207
- log3.info("No functions found");
208
- }
209
- }
210
- export {
211
- webComponentLibrary,
212
- vueComponentLibrary,
213
- stacks,
214
- invoke2 as invoke,
215
- functionsLibrary,
216
- docs,
217
- componentLibraries,
218
- build
219
- };
package/dist/src/bump.js DELETED
@@ -1,14 +0,0 @@
1
- // @bun
2
- // src/bump.ts
3
- import {parseOptions, runCommand} from "@stacksjs/cli";
4
- import {path as p} from "@stacksjs/path";
5
- var options = parseOptions();
6
- var changelogCommand = options?.dryRun ? "buddy changelog --quiet --dry-run" : "buddy changelog --quiet";
7
- await runCommand(changelogCommand, {
8
- cwd: p.projectPath()
9
- });
10
- var bumpCommand = options?.dryRun ? "bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --no-push" : "bunx bumpp ./package.json ./core/**/package.json ./ide/vscode/package.json --all";
11
- await runCommand(bumpCommand, {
12
- cwd: p.frameworkPath(),
13
- stdin: "inherit"
14
- });
@@ -1,17 +0,0 @@
1
- // @bun
2
- // src/changelog.ts
3
- import {execSync, log, parseOptions, runCommand} from "@stacksjs/cli";
4
- import {projectPath} from "@stacksjs/path";
5
- log.debug("Generating changelog");
6
- var fromRevision = await execSync("git describe --abbrev=0 --tags HEAD^");
7
- log.debug("FromRevision", fromRevision);
8
- var toRevision = await execSync("git describe");
9
- log.debug("ToRevision", toRevision);
10
- var options = parseOptions();
11
- log.debug("Changelog Options", options);
12
- var command = options?.dryRun ? `bunx changelogen --no-output --from ${fromRevision} --to ${toRevision}` : `bunx changelogen --output CHANGELOG.md --from ${fromRevision} --to ${toRevision}`;
13
- await runCommand(command, {
14
- cwd: projectPath(),
15
- quiet: options?.quiet,
16
- verbose: options?.verbose
17
- });
package/dist/src/clean.js DELETED
@@ -1,6 +0,0 @@
1
- // @bun
2
- // src/clean.ts
3
- import {log} from "@stacksjs/logging";
4
- import {cleanProject} from "@stacksjs/utils";
5
- log.info("Running clean command...");
6
- await cleanProject();
@@ -1,17 +0,0 @@
1
- // @bun
2
- // src/commit.ts
3
- import {log} from "@stacksjs/logging";
4
- import {runNpmScript} from "@stacksjs/utils";
5
- import {NpmScript} from "@stacksjs/enums";
6
- async function invoke(options) {
7
- log.info("Committing...");
8
- await runNpmScript(NpmScript.Commit, options);
9
- log.success("Committed");
10
- }
11
- async function commit(options) {
12
- return invoke(options);
13
- }
14
- export {
15
- invoke,
16
- commit
17
- };
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env bun
2
- // @bun
3
-
4
- // src/copy-types.ts
5
- import {frameworkPath} from "@stacksjs/path";
6
- import {copyFolder} from "@stacksjs/storage";
7
- var destinations = [
8
- [frameworkPath("dist/types/components"), frameworkPath("components/vue/dist/types")],
9
- [frameworkPath("dist/types/components"), frameworkPath("components/web/dist/types")],
10
- [frameworkPath("dist/types/functions"), frameworkPath("functions/dist/types")]
11
- ];
12
- destinations.forEach(([src, dest]) => {
13
- copyFolder(src, dest);
14
- });
@@ -1 +0,0 @@
1
- // @bun
@@ -1,31 +0,0 @@
1
- // @bun
2
- // src/deploy/index.ts
3
- import process from "process";
4
- import {log, runCommand} from "@stacksjs/cli";
5
- import {config as config2} from "@stacksjs/config";
6
- import {path as p} from "@stacksjs/path";
7
- import {storage as storage2} from "@stacksjs/storage";
8
- await runCommand("bun run build", {
9
- cwd: p.frameworkPath()
10
- });
11
- if (storage2.hasFiles(p.projectPath("docs"))) {
12
- await runCommand("bun run build", {
13
- cwd: p.frameworkPath("docs")
14
- });
15
- }
16
- if (config2.app.docMode !== true) {
17
- await runCommand("bun run build", {
18
- cwd: p.frameworkPath("views")
19
- });
20
- }
21
- await runCommand("bun build.ts", {
22
- cwd: p.frameworkPath("server")
23
- });
24
- await runCommand("bun zip.ts", {
25
- cwd: p.cloudPath()
26
- });
27
- log.info("Preparing Deployment...");
28
- var profile = process.env.AWS_PROFILE || "stacks";
29
- await runCommand(`bunx cdk deploy --require-approval never --profile="${profile}"`, {
30
- cwd: p.frameworkCloudPath()
31
- });
@@ -1,11 +0,0 @@
1
- // @bun
2
- // src/dev/components.ts
3
- import {frameworkPath, vitePath} from "@stacksjs/path";
4
- import {parseOptions, runCommand} from "@stacksjs/cli";
5
- var options = parseOptions();
6
- if (options.verbose)
7
- console.log("dev components options", options);
8
- await runCommand(`bunx vite --config ${vitePath("src/components.ts")}`, {
9
- ...options,
10
- cwd: frameworkPath()
11
- });
@@ -1,7 +0,0 @@
1
- // @bun
2
- // src/dev/docs.ts
3
- import {runCommand} from "@stacksjs/cli";
4
- import {frameworkPath} from "@stacksjs/path";
5
- await runCommand("bun run dev", {
6
- cwd: frameworkPath("docs")
7
- });
@@ -1,92 +0,0 @@
1
- // @bun
2
- // src/helpers/utils.ts
3
- import * as storage from "@stacksjs/storage";
4
- import {buddyOptions, runCommand, runCommands} 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
- async function runAction(action, options) {
9
- const opts = buddyOptions();
10
- const path = p.relativeActionsPath(`${action}.ts`);
11
- const cmd = `bun --bun ${path} ${opts}`.trimEnd();
12
- const optionsWithCwd = {
13
- cwd: options?.cwd || p.projectPath(),
14
- ...options
15
- };
16
- log.debug("runAction:", cmd);
17
- log.debug("action options:", optionsWithCwd);
18
- if (!hasAction(action))
19
- return err(handleError(`The specified action "${action}" does not exist`));
20
- return await runCommand(cmd, optionsWithCwd);
21
- }
22
- async function runActions(actions, options) {
23
- log.debug("runActions:", actions);
24
- log.debug("actions options:", options);
25
- if (!actions.length)
26
- return err("No actions were specified");
27
- for (const action of actions) {
28
- if (!hasAction(action))
29
- return err(`The specified action "${action}" does not exist`);
30
- }
31
- const opts = buddyOptions();
32
- const o = {
33
- cwd: options?.cwd || p.projectPath(),
34
- ...options
35
- };
36
- const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`${action}.ts`)} ${opts}`);
37
- return await runCommands(commands, o);
38
- }
39
- function hasAction(action) {
40
- if (storage.isFile(p.functionsPath(`actions/${action}.ts`)))
41
- return true;
42
- return storage.isFile(p.actionsPath(`${action}.ts`));
43
- }
44
- // src/dev/index.ts
45
- import {log as log2} from "@stacksjs/logging";
46
- import {Action} from "@stacksjs/enums";
47
- async function runDevServer(options) {
48
- log2.info("Starting your Frontend Engine...");
49
- await runAction(Action.Dev, options);
50
- }
51
- async function runFrontendDevServer(options) {
52
- log2.info("Starting your UI Engine...");
53
- await runAction(Action.Dev, options);
54
- }
55
- async function runBackendDevServer(options) {
56
- runApiDevServer(options);
57
- }
58
- async function runApiDevServer(options) {
59
- log2.info("Starting your API...");
60
- await runAction(Action.DevApi, options);
61
- }
62
- async function runComponentsDevServer(options) {
63
- log2.info("Starting your Library Engine...");
64
- await runAction(Action.DevComponents, options);
65
- }
66
- async function runDashboardDevServer(options) {
67
- log2.info("Starting your Dashboard...");
68
- await runAction(Action.DevDashboard, options);
69
- }
70
- async function runSystemTrayDevServer(options) {
71
- log2.info("Starting your System Tray...");
72
- await runAction(Action.DevSystemTray, options);
73
- }
74
- async function runDesktopDevServer(options) {
75
- log2.info("Starting your Desktop Engine...");
76
- await runAction(Action.DevDesktop, options);
77
- }
78
- async function runDocsDevServer(options) {
79
- log2.info("Starting your Docs Engine...");
80
- await runAction(Action.DevDocs, options);
81
- }
82
- export {
83
- runSystemTrayDevServer,
84
- runFrontendDevServer,
85
- runDocsDevServer,
86
- runDevServer,
87
- runDesktopDevServer,
88
- runDashboardDevServer,
89
- runComponentsDevServer,
90
- runBackendDevServer,
91
- runApiDevServer
92
- };
@@ -1,43 +0,0 @@
1
- // @bun
2
- // src/examples.ts
3
- import process from "process";
4
- import {log} from "@stacksjs/logging";
5
- import {hasComponents} from "@stacksjs/storage";
6
- import {runNpmScript} from "@stacksjs/utils";
7
- import {ExitCode} from "@stacksjs/types";
8
- import {NpmScript} from "@stacksjs/enums";
9
- async function invoke(options) {
10
- if (options.components || options.vue)
11
- await componentExample(options);
12
- else if (options.webComponents || options.elements)
13
- await webComponentExample(options);
14
- else
15
- log.error("An unsupported option was used. Please try again, check the documentation & report the issue, if needed.");
16
- }
17
- async function examples(options) {
18
- return invoke(options);
19
- }
20
- async function componentExample(options) {
21
- if (hasComponents()) {
22
- await runNpmScript(NpmScript.ExampleVue, options);
23
- log.success("Your component library was built successfully");
24
- } else {
25
- log.info("No components found.");
26
- }
27
- }
28
- async function webComponentExample(options) {
29
- if (hasComponents()) {
30
- log.info("Building your Web Component library...");
31
- await runNpmScript(NpmScript.BuildWebComponents, options);
32
- log.success("Your Web Component library was built successfully");
33
- } else {
34
- log.info("No components found.");
35
- process.exit(ExitCode.FatalError);
36
- }
37
- }
38
- export {
39
- webComponentExample,
40
- invoke,
41
- examples,
42
- componentExample
43
- };
package/dist/src/fresh.js DELETED
@@ -1,18 +0,0 @@
1
- // @bun
2
- // src/fresh.ts
3
- import process from "process";
4
- import {ExitCode} from "@stacksjs/types";
5
- import {runCommand} from "@stacksjs/cli";
6
- import {logger} from "@stacksjs/logging";
7
- import {projectPath} from "@stacksjs/path";
8
- import {cleanProject} from "@stacksjs/utils";
9
- logger.log("Cleaning project...");
10
- await cleanProject();
11
- logger.log("Installing dependencies...");
12
- var result = await runCommand("bun install", {
13
- cwd: projectPath()
14
- });
15
- if (result.isErr()) {
16
- handleError(result.error);
17
- process.exit(ExitCode.FatalError);
18
- }
@@ -1,59 +0,0 @@
1
- #!/usr/bin/env bun
2
- // @bun
3
-
4
- // src/helpers/component-meta.ts
5
- import {frameworkPath, join, parse, projectPath} from "@stacksjs/path";
6
- import {existsSync, glob, mkdirSync, writeFileSync} from "@stacksjs/storage";
7
- import MarkdownIt from "markdown-it";
8
- import {createComponentMetaChecker} from "vue-component-meta";
9
- function generateComponentMeta() {
10
- const md = new MarkdownIt;
11
- const checkerOptions = {
12
- forceUseTs: true,
13
- schema: { ignore: ["MyIgnoredNestedProps"] },
14
- printer: { newLine: 1 }
15
- };
16
- const tsconfigChecker = createComponentMetaChecker(projectPath("tsconfig.json"), checkerOptions);
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 = glob.sync(["components/*.stx", "components/**/*.stx"], {
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
- }
50
-
51
- // src/generate/component-meta.ts
52
- import {log} from "@stacksjs/logging";
53
- import {hasComponents} from "@stacksjs/storage";
54
- log.info("Generating component meta...");
55
- if (hasComponents())
56
- generateComponentMeta();
57
- else
58
- log.info("No components found. Skipping component meta generation.");
59
- log.success("Generated component meta.");