@stacksjs/actions 0.62.0 → 0.63.0
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/dist/add.js +3 -0
- package/dist/add.js.map +10 -0
- package/dist/build/component-libs.js +3 -0
- package/dist/build/component-libs.js.map +10 -0
- package/dist/build/core.js +3 -0
- package/dist/build/core.js.map +10 -0
- package/dist/build/stacks.js +3 -0
- package/dist/build/stacks.js.map +10 -0
- package/dist/build.js +6 -4
- package/dist/build.js.map +14 -0
- package/dist/bump.js +7 -4
- package/dist/bump.js.map +10 -0
- package/dist/changelog.js +3 -0
- package/dist/changelog.js.map +10 -0
- package/dist/clean.js +3 -0
- package/dist/clean.js.map +10 -0
- package/dist/commit.js +3 -0
- package/dist/commit.js.map +10 -0
- package/dist/copy-types.js +3 -0
- package/dist/copy-types.js.map +10 -0
- package/dist/database/seed.js +3 -0
- package/dist/database/seed.js.map +10 -0
- package/dist/deploy/index.js +14 -5
- package/dist/deploy/index.js.map +10 -0
- package/dist/dev/components.js +3 -0
- package/dist/dev/components.js.map +10 -0
- package/dist/dev/docs.js +3 -0
- package/dist/dev/docs.js.map +10 -0
- package/dist/dev/index.js +4 -2
- package/dist/dev/index.js.map +11 -0
- package/dist/examples.js +3 -0
- package/dist/examples.js.map +10 -0
- package/dist/fresh.js +3 -0
- package/dist/fresh.js.map +10 -0
- package/dist/generate/component-meta.js +3 -0
- package/dist/generate/component-meta.js.map +11 -0
- package/dist/generate/ide-helpers.js +5 -2
- package/dist/generate/ide-helpers.js.map +12 -0
- package/dist/generate/index.js +6 -4
- package/dist/generate/index.js.map +13 -0
- package/dist/generate/lib-entries.js +3 -0
- package/dist/generate/lib-entries.js.map +12 -0
- package/dist/generate/vscode-custom-data.js +5 -2
- package/dist/generate/vscode-custom-data.js.map +12 -0
- package/dist/helpers/component-meta.js +3 -0
- package/dist/helpers/component-meta.js.map +10 -0
- package/dist/helpers/lib-entries.js +3 -0
- package/dist/helpers/lib-entries.js.map +11 -0
- package/dist/helpers/package-json.js +3 -0
- package/dist/helpers/package-json.js.map +11 -0
- package/dist/helpers/utils.js +4 -2
- package/dist/helpers/utils.js.map +10 -0
- package/dist/helpers/vscode-custom-data.js +5 -2
- package/dist/helpers/vscode-custom-data.js.map +11 -0
- package/dist/index.js +21 -5
- package/dist/index.js.map +18 -0
- package/dist/key-generate.js +3 -0
- package/dist/key-generate.js.map +10 -0
- package/dist/lint/fix.js +3 -0
- package/dist/lint/fix.js.map +10 -0
- package/dist/lint/index.js +3 -0
- package/dist/lint/index.js.map +10 -0
- package/dist/make.js +3 -0
- package/dist/make.js.map +10 -0
- package/dist/prepublish.js +3 -0
- package/dist/prepublish.js.map +10 -0
- package/dist/release.js +21 -5
- package/dist/release.js.map +19 -0
- package/dist/test/coverage.js +3 -0
- package/dist/test/coverage.js.map +10 -0
- package/dist/test/feature.js +3 -0
- package/dist/test/feature.js.map +10 -0
- package/dist/test/ui.js +3 -0
- package/dist/test/ui.js.map +10 -0
- package/dist/test/unit.js +3 -0
- package/dist/test/unit.js.map +10 -0
- package/dist/test.js +3 -0
- package/dist/test.js.map +10 -0
- package/dist/typecheck.js +3 -0
- package/dist/typecheck.js.map +10 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +10 -0
- package/dist/upgrade/dependencies.js +3 -0
- package/dist/upgrade/dependencies.js.map +9 -0
- package/dist/upgrade/framework.js +3 -0
- package/dist/upgrade/framework.js.map +9 -0
- package/dist/upgrade/index.js +4 -2
- package/dist/upgrade/index.js.map +11 -0
- package/dist/upgrade.js +4 -1
- package/dist/upgrade.js.map +10 -0
- package/package.json +3 -3
- package/src/action.ts +15 -1
- package/src/build/server.ts +1 -1
- package/src/bump.ts +5 -5
- package/src/cdn/invalidate-cache.ts +1 -1
- package/src/deploy/index.ts +14 -6
- package/src/files/watch.ts +8 -0
- package/src/helpers/utils.ts +2 -3
- package/src/orm/generate-model.ts +384 -144
package/dist/add.js
CHANGED
package/dist/add.js.map
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/add.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { installPackage } from '@stacksjs/cli'\nimport type { AddOptions } from '@stacksjs/types'\n\nexport async function invoke(options: AddOptions) {\n if (options?.table) await addTable()\n\n if (options?.calendar) await addCalendar()\n}\n\nexport async function add(options: AddOptions) {\n return invoke(options)\n}\n\nexport async function addTable() {\n await installPackage('@stacksjs/table')\n}\n\nexport async function addCalendar() {\n await installPackage('@stacksjs/calendar')\n}\n\nexport async function installPackages(names: string[]) {\n for (const name of names) await installPackage(name)\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AAGA,eAAsB,MAAM,CAAC,SAAqB;AAChD,MAAI,SAAS;AAAO,UAAM,SAAS;AAEnC,MAAI,SAAS;AAAU,UAAM,YAAY;AAAA;AAG3C,eAAsB,GAAG,CAAC,SAAqB;AAC7C,SAAO,OAAO,OAAO;AAAA;AAGvB,eAAsB,QAAQ,GAAG;AAC/B,QAAM,eAAe,iBAAiB;AAAA;AAGxC,eAAsB,WAAW,GAAG;AAClC,QAAM,eAAe,oBAAoB;AAAA;AAG3C,eAAsB,eAAe,CAAC,OAAiB;AACrD,aAAW,QAAQ;AAAO,UAAM,eAAe,IAAI;AAAA;",
|
|
8
|
+
"debugId": "8F533580CF27EAB864756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/build/component-libs.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { runCommand } from '@stacksjs/cli'\nimport { NpmScript } from '@stacksjs/enums'\nimport { frameworkPath } from '@stacksjs/path'\n\nawait runCommand(NpmScript.BuildComponents, {\n cwd: frameworkPath(),\n verbose: true,\n})\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AACA;AAEA,MAAM,WAAW,UAAU,iBAAiB;AAAA,EAC1C,KAAK,cAAc;AAAA,EACnB,SAAS;AACX,CAAC;",
|
|
8
|
+
"debugId": "38B638493EAC7E6864756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/build/core.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/build/core.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import process from 'node:process'\nimport { dim, italic, log } from '@stacksjs/cli'\nimport { corePath } from '@stacksjs/path'\nimport { glob } from '@stacksjs/storage'\nimport { ExitCode } from '@stacksjs/types'\nimport { $ } from 'bun'\n\nlog.info('Building core packages')\n\nconst dirs = (await glob([corePath('*')], { onlyDirectories: true })).sort()\n\nif (dirs.length === 0) {\n log.info('No core packages found')\n process.exit(ExitCode.FatalError)\n}\n\nfor (const folder of dirs) {\n log.info(`🏗️ Building ${italic(dim(folder))}`)\n\n $.cwd(folder)\n await $`bun run build`\n log.success(`${italic(dim(folder))} built`)\n\n console.log(``)\n}\n\n// dirs.forEach(async (folder) => {\n// log.info(`🏗️ Building ${italic(dim(folder))}`)\n\n// $.cwd(folder)\n// const text = await $`bun run build`.text()\n// console.log(text)\n// })\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAI,KAAK,wBAAwB;AAEjC,IAAM,QAAQ,MAAM,KAAK,CAAC,SAAS,GAAG,CAAC,GAAG,EAAE,iBAAiB,KAAK,CAAC,GAAG,KAAK;AAE3E,IAAI,KAAK,WAAW,GAAG;AACrB,MAAI,KAAK,wBAAwB;AACjC,UAAQ,KAAK,SAAS,UAAU;AAClC;AAEA,WAAW,UAAU,MAAM;AACzB,MAAI,KAAK,gCAAgB,OAAO,IAAI,MAAM,CAAC,GAAG;AAE9C,IAAE,IAAI,MAAM;AACZ,QAAM;AACN,MAAI,QAAQ,GAAG,OAAO,IAAI,MAAM,CAAC,SAAS;AAE1C,UAAQ,IAAI,EAAE;AAChB;",
|
|
8
|
+
"debugId": "62E0C8AEAB2E928E64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/build/stacks.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/build/stacks.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { runCommands } from '@stacksjs/cli'\nimport { frameworkPath } from '@stacksjs/path'\n\nawait runCommands(\n [\n 'bun build:cli', // command to build the Buddy CLI\n 'bun build:core', // command to build the Stacks Core\n ],\n { verbose: true, cwd: frameworkPath() },\n)\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AAEA,MAAM,YACJ;AAAA,EACE;AAAA,EACA;AACF,GACA,EAAE,SAAS,MAAM,KAAK,cAAc,EAAE,CACxC;",
|
|
8
|
+
"debugId": "62D1B5EB37D2A4D664756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/build.js
CHANGED
|
@@ -5,9 +5,8 @@ import {err} from "@stacksjs/error-handling";
|
|
|
5
5
|
import {log} from "@stacksjs/logging";
|
|
6
6
|
import * as p from "@stacksjs/path";
|
|
7
7
|
import {glob} from "@stacksjs/storage";
|
|
8
|
-
var {Glob } = globalThis.Bun;
|
|
9
8
|
async function runAction(action, options) {
|
|
10
|
-
const glob2 = new Glob("**/*.ts");
|
|
9
|
+
const glob2 = new Bun.Glob("**/*.ts");
|
|
11
10
|
const scanOptions = { cwd: p.userActionsPath(), onlyFiles: true };
|
|
12
11
|
for await (const file of glob2.scan(scanOptions)) {
|
|
13
12
|
log.debug("file", file);
|
|
@@ -136,14 +135,14 @@ async function generateWebTypes() {
|
|
|
136
135
|
log2.info("Generating web-types.json...");
|
|
137
136
|
log2.info("This feature is not yet implemented.");
|
|
138
137
|
}
|
|
139
|
-
|
|
138
|
+
function generateComponentInfoData() {
|
|
140
139
|
const componentsData = JSON.stringify(library_default.vueComponents?.tags);
|
|
141
140
|
return `{
|
|
142
141
|
"version": 1.1,
|
|
143
142
|
"tags": ${componentsData}
|
|
144
143
|
}
|
|
145
144
|
`;
|
|
146
|
-
}
|
|
145
|
+
}
|
|
147
146
|
|
|
148
147
|
// src/generate/index.ts
|
|
149
148
|
import process from "process";
|
|
@@ -315,3 +314,6 @@ export {
|
|
|
315
314
|
componentLibraries,
|
|
316
315
|
build
|
|
317
316
|
};
|
|
317
|
+
|
|
318
|
+
//# debugId=C384F61FB581145264756E2164756E21
|
|
319
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/helpers/utils.ts", "../src/helpers/vscode-custom-data.ts", "../../../../../config/library.ts", "../src/generate/index.ts", "../src/build.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { Action as ActionType } from '@stacksjs/actions'\nimport { buddyOptions, runCommand, runCommands } from '@stacksjs/cli'\nimport { err } from '@stacksjs/error-handling'\nimport { log } from '@stacksjs/logging'\nimport * as p from '@stacksjs/path'\nimport { glob } from '@stacksjs/storage'\nimport type { ActionOptions } from '@stacksjs/types'\n\ntype ActionPath = string // TODO: narrow this by automating its generation\ntype ActionName = string // TODO: narrow this by automating its generation\ntype Action = ActionPath | ActionName | string\n\n/**\n * Run an Action the Stacks way.\n *\n * @param action The action to invoke.\n * @param options The options to pass to the command.\n * @returns The result of the command.\n */\nexport async function runAction(action: Action, options?: ActionOptions) {\n // check if action is a file anywhere in ./app/Actions/**/*.ts\n // if it is, return and await the action\n const glob = new Bun.Glob('**/*.ts')\n const scanOptions = { cwd: p.userActionsPath(), onlyFiles: true }\n\n for await (const file of glob.scan(scanOptions)) {\n log.debug('file', file)\n if (file === `${action}.ts` || file.endsWith(`${action}.ts`))\n return ((await import(/* @vite-ignore */ p.userActionsPath(file))).default as ActionType).handle()\n\n // if a custom model name is used, we need to check for it\n const a = await import(/* @vite-ignore */ p.userActionsPath(file))\n if (a.name === action) return await a.handle()\n }\n\n // or else, just run the action normally by assuming the action is core Action, stored in p.actionsPath\n const opts = buddyOptions()\n const path = p.relativeActionsPath(`src/${action}.ts`)\n const cmd = `bun --bun ${path} ${opts}`.trimEnd()\n const optionsWithCwd = {\n cwd: options?.cwd || p.projectPath(),\n ...options,\n }\n\n log.debug('runAction:', cmd)\n log.debug('action options:', optionsWithCwd)\n\n return await runCommand(cmd, optionsWithCwd)\n}\n\n/**\n * Run Actions the Stacks way.\n *\n * @param actions The actions to invoke.\n * @param options The options to pass to the command.\n * @returns The result of the command.\n */\nexport async function runActions(actions: Action[], options?: ActionOptions) {\n log.debug('runActions:', actions, options)\n\n if (!actions.length) return err('No actions were specified')\n\n for (const action of actions) {\n log.debug(`running action \"${action}\"`)\n if (!hasAction(action)) return err(`The specified action \"${action}\" does not exist`)\n }\n\n const opts = buddyOptions()\n\n const o = {\n cwd: options?.cwd || p.projectPath(),\n ...options,\n }\n\n const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`src/${action}.ts`)} ${opts}`)\n\n log.debug('commands:', commands)\n\n return await runCommands(commands, o)\n}\n\n// looks in most common locations\nexport function hasAction(action: Action) {\n // Define patterns specifically for user actions\n const userActionPatterns = [\n `${action}.ts`,\n `${action}`,\n `Dashboard/${action}.ts`,\n `Dashboard/${action}`,\n `Buddy/${action}.ts`,\n `Buddy/${action}`,\n ]\n\n // Define patterns specifically for core actions\n const actionPatterns = [`src/${action}.ts`, `src/${action}`, `${action}.ts`, `${action}`]\n\n // Check user actions path with its specific patterns\n const userActionFiles = glob.sync(userActionPatterns.map((pattern) => p.userActionsPath(pattern)))\n\n // Check actions path with its specific patterns\n const actionFiles = glob.sync(actionPatterns.map((pattern) => p.actionsPath(pattern)))\n\n return userActionFiles.length > 0 || actionFiles.length > 0\n\n // TODO: need to loop through all user actions and check whether the name is a valid action name match\n\n // return false\n}\n",
|
|
6
|
+
"import { log } from '@stacksjs/logging'\nimport { customElementsDataPath } from '@stacksjs/path'\nimport { writeTextFile } from '@stacksjs/storage'\nimport library from '~/config/library'\n\nexport async function generateVsCodeCustomData() {\n try {\n log.info('Generating custom-elements.json...')\n // the version does not have to be set here,\n // it will be set automatically by the release script\n await writeTextFile({\n path: customElementsDataPath(),\n data: generateComponentInfoData(),\n })\n log.success('Generated custom-elements.json for IDEs.')\n } catch (err) {\n log.error('There was an error generating the custom-elements.json file.', err)\n }\n}\n\nexport async function generateWebTypes() {\n log.info('Generating web-types.json...')\n log.info('This feature is not yet implemented.')\n}\n\nfunction generateComponentInfoData() {\n const componentsData = JSON.stringify(library.vueComponents?.tags)\n\n return `{\n \"version\": 1.1,\n \"tags\": ${componentsData}\n}\n`\n}\n",
|
|
7
|
+
"import type { LibraryConfig } from '@stacksjs/types'\n\n/**\n * **Library Configuration**\n *\n * This configuration defines all of your library options. Because Stacks is fully-typed, you\n * may hover any of the options below and the definitions will be provided. In case you\n * have any questions, feel free to reach out via Discord or GitHub Discussions.\n */\nexport default {\n name: 'hello-world',\n owner: '@stacksjs', // you may or may not add the @ prefix here (it is added automatically)\n repository: 'stacksjs/stacks',\n license: 'MIT',\n author: 'Chris Breuer',\n contributors: ['Chris Breuer <chris@stacksjs.org>'],\n defaultLanguage: 'en',\n releaseable: true,\n\n vueComponents: {\n name: 'hello-world-vue',\n description: 'Your Vue component library description',\n keywords: ['component', 'library', 'vue', 'vite', 'typescript', 'javascript'],\n tags: [\n {\n name: ['HelloWorld', 'AppHelloWorld'],\n description: 'The Hello World custom element, built via this framework.',\n attributes: [\n {\n name: 'greeting',\n description: 'The greeting.',\n },\n ],\n },\n ],\n },\n\n webComponents: {\n name: 'hello-world-elements',\n description: 'Your framework agnostic web component library description.',\n keywords: ['custom-elements', 'web-components', 'library', 'framework-agnostic', 'typescript', 'javascript'],\n tags: [\n {\n name: ['HelloWorld', 'AppHelloWorld'],\n description: 'The Hello World custom element, built via this framework.',\n attributes: [\n {\n name: 'greeting',\n description: 'The greeting.',\n },\n ],\n },\n ],\n },\n\n functions: {\n name: 'hello-world-fx',\n description: 'Your function library description.',\n keywords: ['functions', 'composables', 'library', 'typescript', 'javascript'],\n shouldGenerateSourcemap: false,\n files: ['counter', 'dark'],\n },\n} satisfies LibraryConfig\n",
|
|
8
|
+
"import process from 'node:process'\nimport { runCommand } from '@stacksjs/cli'\nimport { Action, NpmScript } from '@stacksjs/enums'\nimport { log } from '@stacksjs/logging'\nimport { frameworkPath, projectPath } from '@stacksjs/path'\nimport type { GeneratorOptions } from '@stacksjs/types'\nimport { runNpmScript } from '@stacksjs/utils'\nimport { runAction } from '../helpers'\nimport { generateVsCodeCustomData as genVsCodeCustomData } from '../helpers/vscode-custom-data'\n\n// import { files } from '@stacksjs/storage'\n\nexport async function invoke(options?: GeneratorOptions) {\n if (options?.types) await generateTypes(options)\n else if (options?.entries) await generateLibEntries(options)\n else if (options?.webTypes) await generateWebTypes(options)\n else if (options?.customData) await generateVsCodeCustomData(options)\n else if (options?.ideHelpers) await generateIdeHelpers(options)\n else if (options?.componentMeta) await generateComponentMeta(options)\n else if (options?.coreSymlink) await generateCoreSymlink()\n}\n\nexport function generate(options: GeneratorOptions) {\n return invoke(options)\n}\n\nexport async function generateLibEntries(options: GeneratorOptions) {\n const result = await runAction(Action.GenerateLibraryEntries, {\n ...options,\n cwd: projectPath(),\n })\n\n if (result.isErr()) {\n log.error('There was an error generating your library entry points', result.error)\n process.exit()\n }\n\n log.success('Library entry points generated successfully')\n}\n\nexport async function generateWebTypes(options?: GeneratorOptions) {\n const result = await runNpmScript(NpmScript.GenerateWebTypes, options)\n\n if (result.isErr()) {\n log.error('There was an error generating the web-types.json file.', result.error)\n process.exit()\n }\n\n log.success('Successfully generated the web-types.json file')\n}\n\nexport async function generateVsCodeCustomData(options?: GeneratorOptions) {\n const result = await genVsCodeCustomData()\n\n if (result.isErr()) {\n log.error('There was an error generating the custom-elements.json file.', result.error)\n process.exit()\n }\n\n await runAction(Action.LintFix, { verbose: true }) // because the generated json file needs to be linted\n\n log.success('Successfully generated the custom-elements.json file')\n}\n\nexport async function generateIdeHelpers(options?: GeneratorOptions) {\n const result = await runNpmScript(NpmScript.GenerateIdeHelpers, options)\n\n if (result.isErr()) {\n log.error('There was an error generating IDE helpers.', result.error)\n process.exit()\n }\n\n await runAction(Action.LintFix, { verbose: true }) // the generated json file needs to be linted\n log.success('Successfully generated IDE helpers')\n}\n\nexport async function generateComponentMeta(options?: GeneratorOptions) {\n const result = await genVsCodeCustomData()\n\n if (result.isErr()) {\n log.error('There was an error generating your component meta information.', result.error)\n process.exit()\n }\n\n await runAction(Action.LintFix, { verbose: true }) // the generated json file needs to be linted\n log.success('Successfully generated component meta information')\n}\n\nexport async function generateTypes(options?: GeneratorOptions) {\n const result = await runNpmScript(NpmScript.GenerateTypes, {\n cwd: frameworkPath(),\n ...options,\n })\n\n if (result.isErr()) {\n log.error('There was an error generating your types.', result.error)\n process.exit()\n }\n\n log.success('Types were generated successfully')\n}\n\nexport function generatePkgxConfig() {\n // write the yaml string to a file in your project root\n // files.put(projectPath('./pkgx.yaml'), yamlStr)\n\n log.success('Successfully generated `./pkgx.yaml` based on your config')\n}\n\nexport async function generateSeeder() {\n // await seed()\n}\n\nexport async function generateCoreSymlink() {\n await runCommand(`ln -s ${frameworkPath()} ${projectPath('.stacks')}`)\n}\n",
|
|
9
|
+
"import { NpmScript } from '@stacksjs/enums'\nimport { log } from '@stacksjs/logging'\nimport { hasComponents, hasFunctions } from '@stacksjs/storage'\nimport type { BuildOptions } from '@stacksjs/types'\nimport { runNpmScript } from '@stacksjs/utils'\nimport { generateTypes } from './generate'\n\nexport async function invoke(options: BuildOptions) {\n if (options.components) await componentLibraries(options)\n else if (options.vueComponents) await vueComponentLibrary(options)\n else if (options.webComponents || options.elements) await webComponentLibrary(options)\n else if (options.functions) await functionsLibrary(options)\n else if (options.docs) await docs(options)\n else if (options.stacks) await stacks(options)\n\n await generateTypes()\n}\n\nexport async function build(options: BuildOptions) {\n return invoke(options)\n}\n\nexport async function componentLibraries(options: BuildOptions) {\n await runNpmScript(NpmScript.GenerateEntries, options)\n await vueComponentLibrary(options)\n await webComponentLibrary(options)\n}\n\nexport async function vueComponentLibrary(options: BuildOptions) {\n if (hasComponents()) {\n log.info('Building your component library...')\n await runNpmScript(NpmScript.BuildComponents, options)\n log.success('Your component library was built successfully')\n } else {\n // todo: throw custom error here\n log.warn('No components found.')\n log.info('Before you can build components,')\n log.info('you need to have created some in the ./components folder.')\n }\n}\n\nexport async function webComponentLibrary(options: BuildOptions) {\n log.info('Building your component library for production use & npm/CDN distribution...')\n\n if (hasComponents()) {\n await runNpmScript(NpmScript.BuildWebComponents, options)\n log.success('Your Web Component library was built successfully')\n } else {\n // todo: throw custom error here\n log.info('No components found.')\n }\n}\n\nexport async function docs(options: BuildOptions) {\n log.info('Building the documentation site...')\n await runNpmScript(NpmScript.BuildDocs, options)\n log.success('Docs built successfully')\n}\n\nexport async function stacks(options: BuildOptions) {\n log.info('Building the Stacks Framework...')\n await runNpmScript(NpmScript.BuildStacks, options)\n log.success('Stacks built successfully')\n}\n\nexport async function functionsLibrary(options: BuildOptions) {\n if (hasFunctions()) {\n log.info('Building your functions library for production usages...')\n log.info('Production usages include: manual npm distribution and/or CDN distribution')\n await runNpmScript(NpmScript.BuildFunctions, options)\n log.success('Functions library built successfully')\n } else {\n log.info('No functions found')\n }\n}\n"
|
|
10
|
+
],
|
|
11
|
+
"mappings": ";;AACA;AACA;AACA;AACA;AACA;AAcA,eAAsB,SAAS,CAAC,QAAgB,SAAyB;AAGvE,QAAM,QAAO,IAAI,IAAI,KAAK,SAAS;AACnC,QAAM,cAAc,EAAE,KAAO,kBAAgB,GAAG,WAAW,KAAK;AAEhE,mBAAiB,QAAQ,MAAK,KAAK,WAAW,GAAG;AAC/C,QAAI,MAAM,QAAQ,IAAI;AACtB,QAAI,S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,EACjE,OAAO;AAEL,SAAI,KAAK,sBAAsB;AAAA;AAAA;AAInC,eAAsB,IAAI,CAAC,SAAuB;AAChD,OAAI,KAAK,oCAAoC;AAC7C,QAAM,cAAa,WAAU,WAAW,OAAO;AAC/C,OAAI,QAAQ,yBAAyB;AAAA;AAGvC,eAAsB,MAAM,CAAC,SAAuB;AAClD,OAAI,KAAK,kCAAkC;AAC3C,QAAM,cAAa,WAAU,aAAa,OAAO;AACjD,OAAI,QAAQ,2BAA2B;AAAA;AAGzC,eAAsB,gBAAgB,CAAC,SAAuB;AAC5D,MAAI,aAAa,GAAG;AAClB,SAAI,KAAK,0DAA0D;AACnE,SAAI,KAAK,4EAA4E;AACrF,UAAM,cAAa,WAAU,gBAAgB,OAAO;AACpD,SAAI,QAAQ,sCAAsC;AAAA,EACpD,OAAO;AACL,SAAI,KAAK,oBAAoB;AAAA;AAAA;",
|
|
12
|
+
"debugId": "C384F61FB581145264756E2164756E21",
|
|
13
|
+
"names": []
|
|
14
|
+
}
|
package/dist/bump.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/bump.ts
|
|
3
|
-
import {parseOptions, runCommand} from "@stacksjs/cli";
|
|
3
|
+
import {log, parseOptions, runCommand} from "@stacksjs/cli";
|
|
4
4
|
import {path as p} from "@stacksjs/path";
|
|
5
5
|
var options = parseOptions();
|
|
6
6
|
var changelogCommand = options?.dryRun ? "buddy changelog --quiet --dry-run" : "buddy changelog --quiet";
|
|
7
|
-
var bumpCommand = options?.dryRun ? `bunx bumpp ./package.json ./**/package.json ../ide/vscode/package.json --no-push --execute "../scripts/lint"` : `bunx bumpp ./package.json ./**/package.json ../ide/vscode/package.json --all --execute "../scripts/lint"`;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
var bumpCommand = options?.dryRun ? `bunx bumpp ./package.json ./**/package.json ../package.json ../ide/vscode/package.json ../views/** ../cloud/package.json ../server/package.json ../orm/package.json ../docs/package.json ../api/package.json ../email/package.json ../system-tray/package.json --no-push --execute "../scripts/lint"` : `bunx bumpp ./package.json ./**/package.json ../package.json ../ide/vscode/package.json ../views/** ../cloud/package.json ../server/package.json ../orm/package.json ../docs/package.json ../api/package.json ../email/package.json ../system-tray/package.json --all --execute "../scripts/lint"`;
|
|
8
|
+
log.debug(`Running: ${bumpCommand}`);
|
|
9
|
+
log.debug(`In frameworkPath: ${p.frameworkPath()}`);
|
|
10
10
|
await runCommand(bumpCommand, {
|
|
11
11
|
cwd: p.frameworkPath("core"),
|
|
12
12
|
stdin: "inherit"
|
|
@@ -15,3 +15,6 @@ await runCommand(changelogCommand, {
|
|
|
15
15
|
cwd: p.projectPath(),
|
|
16
16
|
stdin: "inherit"
|
|
17
17
|
});
|
|
18
|
+
|
|
19
|
+
//# debugId=F20CE1E0EAEE5B8564756E2164756E21
|
|
20
|
+
//# sourceMappingURL=bump.js.map
|
package/dist/bump.js.map
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/bump.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { log, parseOptions, runCommand } from '@stacksjs/cli'\nimport { path as p } from '@stacksjs/path'\n\nconst options = parseOptions()\nconst changelogCommand = options?.dryRun ? 'buddy changelog --quiet --dry-run' : 'buddy changelog --quiet'\nconst bumpCommand = options?.dryRun\n ? `bunx bumpp ./package.json ./**/package.json ../package.json ../ide/vscode/package.json ../views/** ../cloud/package.json ../server/package.json ../orm/package.json ../docs/package.json ../api/package.json ../email/package.json ../system-tray/package.json --no-push --execute \"../scripts/lint\"`\n : `bunx bumpp ./package.json ./**/package.json ../package.json ../ide/vscode/package.json ../views/** ../cloud/package.json ../server/package.json ../orm/package.json ../docs/package.json ../api/package.json ../email/package.json ../system-tray/package.json --all --execute \"../scripts/lint\"`\n\nlog.debug(`Running: ${bumpCommand}`)\nlog.debug(`In frameworkPath: ${p.frameworkPath()}`)\n\nawait runCommand(bumpCommand, {\n cwd: p.frameworkPath('core'),\n stdin: 'inherit',\n})\n\nawait runCommand(changelogCommand, {\n cwd: p.projectPath(),\n stdin: 'inherit',\n})\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA,gBAAS;AAET,IAAM,UAAU,aAAa;AAC7B,IAAM,mBAAmB,SAAS,SAAS,sCAAsC;AACjF,IAAM,cAAc,SAAS,SACzB,ySACA;AAEJ,IAAI,MAAM,YAAY,aAAa;AACnC,IAAI,MAAM,qBAAqB,EAAE,cAAc,GAAG;AAElD,MAAM,WAAW,aAAa;AAAA,EAC5B,KAAK,EAAE,cAAc,MAAM;AAAA,EAC3B,OAAO;AACT,CAAC;AAED,MAAM,WAAW,kBAAkB;AAAA,EACjC,KAAK,EAAE,YAAY;AAAA,EACnB,OAAO;AACT,CAAC;",
|
|
8
|
+
"debugId": "F20CE1E0EAEE5B8564756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/changelog.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/changelog.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { execSync, log, parseOptions, runCommand } from '@stacksjs/cli'\nimport { projectPath } from '@stacksjs/path'\n\n// when log.debug is used, only log to file in production\nlog.debug('Generating changelog')\nconst fromRevision = await execSync('git describe --abbrev=0 --tags HEAD^')\nlog.debug('FromRevision', fromRevision)\nconst toRevision = await execSync('git describe')\nlog.debug('ToRevision', toRevision)\nconst options = parseOptions()\nlog.debug('Changelog Options', options)\n\nconst command = options?.dryRun\n ? `bunx changelogen --no-output --from ${fromRevision} --to ${toRevision}`\n : `bunx changelogen --output CHANGELOG.md --from ${fromRevision} --to ${toRevision}`\n\nawait runCommand(command, {\n cwd: projectPath(),\n quiet: options?.quiet,\n verbose: options?.verbose,\n})\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AAGA,IAAI,MAAM,sBAAsB;AAChC,IAAM,eAAe,MAAM,SAAS,sCAAsC;AAC1E,IAAI,MAAM,gBAAgB,YAAY;AACtC,IAAM,aAAa,MAAM,SAAS,cAAc;AAChD,IAAI,MAAM,cAAc,UAAU;AAClC,IAAM,UAAU,aAAa;AAC7B,IAAI,MAAM,qBAAqB,OAAO;AAEtC,IAAM,UAAU,SAAS,SACrB,uCAAuC,qBAAqB,eAC5D,iDAAiD,qBAAqB;AAE1E,MAAM,WAAW,SAAS;AAAA,EACxB,KAAK,YAAY;AAAA,EACjB,OAAO,SAAS;AAAA,EAChB,SAAS,SAAS;AACpB,CAAC;",
|
|
8
|
+
"debugId": "47C92BDB74836F8D64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/clean.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/clean.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { log } from '@stacksjs/logging'\nimport { cleanProject } from '@stacksjs/utils'\n\nlog.info('Running clean command...')\n\nawait cleanProject()\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AAEA,IAAI,KAAK,0BAA0B;AAEnC,MAAM,aAAa;",
|
|
8
|
+
"debugId": "9402DDDF447C82DF64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/commit.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/commit.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { NpmScript } from '@stacksjs/enums'\nimport { log } from '@stacksjs/logging'\nimport type { CleanOptions } from '@stacksjs/types'\nimport { runNpmScript } from '@stacksjs/utils'\n\nexport async function invoke(options: CleanOptions) {\n log.info('Committing...')\n await runNpmScript(NpmScript.Commit, options)\n log.success('Committed')\n}\n\nexport async function commit(options: CleanOptions) {\n return invoke(options)\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AAEA;AAEA,eAAsB,MAAM,CAAC,SAAuB;AAClD,MAAI,KAAK,eAAe;AACxB,QAAM,aAAa,UAAU,QAAQ,OAAO;AAC5C,MAAI,QAAQ,WAAW;AAAA;AAGzB,eAAsB,MAAM,CAAC,SAAuB;AAClD,SAAO,OAAO,OAAO;AAAA;",
|
|
8
|
+
"debugId": "DD93C9540AFF946A64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/copy-types.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/copy-types.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"#!/usr/bin/env bun\n\n/**\n * This action copies all the generated types.\n */\n\nimport { frameworkPath } from '@stacksjs/path'\nimport { copyFolder } from '@stacksjs/storage'\n\n// relative to scripts directory\nconst destinations = [\n [frameworkPath('dist/types/components'), frameworkPath('components/vue/dist/types')],\n [frameworkPath('dist/types/components'), frameworkPath('components/web/dist/types')],\n [frameworkPath('dist/types/functions'), frameworkPath('functions/dist/types')],\n]\n\ndestinations.forEach(([src, dest]) => {\n // const srcPath = resolve(__filename, '..', src)\n // const destPath = resolve(__filename, '..', dest)\n\n copyFolder(src as string, dest as string)\n})\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;AAMA;AACA;AAGA,IAAM,eAAe;AAAA,EACnB,CAAC,cAAc,uBAAuB,GAAG,cAAc,2BAA2B,CAAC;AAAA,EACnF,CAAC,cAAc,uBAAuB,GAAG,cAAc,2BAA2B,CAAC;AAAA,EACnF,CAAC,cAAc,sBAAsB,GAAG,cAAc,sBAAsB,CAAC;AAC/E;AAEA,aAAa,QAAQ,EAAE,KAAK,UAAU;AAIpC,aAAW,KAAe,IAAc;AAAA,CACzC;",
|
|
8
|
+
"debugId": "74A00EA4C351117664756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/database/seed.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/database/seed.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import process from 'node:process'\nimport { log } from '@stacksjs/cli'\nimport { seed } from '@stacksjs/database'\n\nlog.info('Seeding database...')\nawait seed()\n\nprocess.exit(0)\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AACA;AAEA,IAAI,KAAK,qBAAqB;AAC9B,MAAM,KAAK;AAEX,QAAQ,KAAK,CAAC;",
|
|
8
|
+
"debugId": "42F7701765B8E4F464756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/deploy/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {config as config2} from "@stacksjs/config";
|
|
|
6
6
|
import {path as p} from "@stacksjs/path";
|
|
7
7
|
import {storage as storage2} from "@stacksjs/storage";
|
|
8
8
|
await runCommand("bun run build", {
|
|
9
|
-
cwd: p.
|
|
9
|
+
cwd: p.frameworkPath()
|
|
10
10
|
});
|
|
11
11
|
if (storage2.hasFiles(p.projectPath("docs"))) {
|
|
12
12
|
await runCommand("bun run build", {
|
|
@@ -15,17 +15,26 @@ if (storage2.hasFiles(p.projectPath("docs"))) {
|
|
|
15
15
|
}
|
|
16
16
|
if (config2.app.docMode !== true) {
|
|
17
17
|
await runCommand("bun run build", {
|
|
18
|
-
cwd: p.frameworkPath("views")
|
|
18
|
+
cwd: p.frameworkPath("views/web")
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
await runCommand("bun build.ts", {
|
|
22
|
-
cwd: p.
|
|
22
|
+
cwd: p.frameworkCloudPath()
|
|
23
23
|
});
|
|
24
24
|
await runCommand("bun zip.ts", {
|
|
25
25
|
cwd: p.cloudPath()
|
|
26
26
|
});
|
|
27
27
|
log.info("Preparing Deployment...");
|
|
28
|
-
var profile = process.env.AWS_PROFILE
|
|
29
|
-
await runCommand(`
|
|
28
|
+
var profile = process.env.AWS_PROFILE ?? "stacks";
|
|
29
|
+
var result = await runCommand(`npx cdk deploy --require-approval never --profile="${profile}"`, {
|
|
30
30
|
cwd: p.frameworkCloudPath()
|
|
31
31
|
});
|
|
32
|
+
if (result.isErr()) {
|
|
33
|
+
log.error(result.error);
|
|
34
|
+
process.exit(ExitCode.FatalError);
|
|
35
|
+
}
|
|
36
|
+
var t = result.value;
|
|
37
|
+
var x = await t.exited;
|
|
38
|
+
|
|
39
|
+
//# debugId=35A70A0D1EE8BB5164756E2164756E21
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/deploy/index.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import process from 'node:process'\nimport { log, runCommand } from '@stacksjs/cli'\nimport { config } from '@stacksjs/config'\nimport { path as p } from '@stacksjs/path'\nimport { storage } from '@stacksjs/storage'\nimport type { Subprocess } from '@stacksjs/types'\n\nawait runCommand('bun run build', {\n cwd: p.frameworkPath(),\n})\n\nif (storage.hasFiles(p.projectPath('docs'))) {\n await runCommand('bun run build', {\n cwd: p.frameworkPath('docs'),\n })\n}\n\nif (config.app.docMode !== true) {\n // when in docMode, we can disregard building views\n await runCommand('bun run build', {\n cwd: p.frameworkPath('views/web'),\n })\n}\n\n// await runCommand('bun run build-edge', {\n// cwd: p.corePath('cloud'),\n// })\n\nawait runCommand('bun build.ts', {\n cwd: p.frameworkCloudPath(),\n})\n\nawait runCommand('bun zip.ts', {\n cwd: p.cloudPath(),\n})\n\nlog.info('Preparing Deployment...')\n\nconst profile = process.env.AWS_PROFILE ?? 'stacks'\n\nconst result = await runCommand(`npx cdk deploy --require-approval never --profile=\"${profile}\"`, {\n cwd: p.frameworkCloudPath(),\n})\n\nif (result.isErr()) {\n log.error(result.error)\n process.exit(ExitCode.FatalError)\n}\n\nconst t = result.value as Subprocess\nconst x = await t.exited\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AACA,kBAAS;AACT,gBAAS;AACT,mBAAS;AAGT,MAAM,WAAW,iBAAiB;AAAA,EAChC,KAAK,EAAE,cAAc;AACvB,CAAC;AAED,IAAI,SAAQ,SAAS,EAAE,YAAY,MAAM,CAAC,GAAG;AAC3C,QAAM,WAAW,iBAAiB;AAAA,IAChC,KAAK,EAAE,cAAc,MAAM;AAAA,EAC7B,CAAC;AACH;AAEA,IAAI,QAAO,IAAI,YAAY,MAAM;AAE/B,QAAM,WAAW,iBAAiB;AAAA,IAChC,KAAK,EAAE,cAAc,WAAW;AAAA,EAClC,CAAC;AACH;AAMA,MAAM,WAAW,gBAAgB;AAAA,EAC/B,KAAK,EAAE,mBAAmB;AAC5B,CAAC;AAED,MAAM,WAAW,cAAc;AAAA,EAC7B,KAAK,EAAE,UAAU;AACnB,CAAC;AAED,IAAI,KAAK,yBAAyB;AAElC,IAAM,UAAU,QAAQ,IAAI,eAAe;AAE3C,IAAM,SAAS,MAAM,WAAW,sDAAsD,YAAY;AAAA,EAChG,KAAK,EAAE,mBAAmB;AAC5B,CAAC;AAED,IAAI,OAAO,MAAM,GAAG;AAClB,MAAI,MAAM,OAAO,KAAK;AACtB,UAAQ,KAAK,SAAS,UAAU;AAClC;AAEA,IAAM,IAAI,OAAO;AACjB,IAAM,IAAI,MAAM,EAAE;",
|
|
8
|
+
"debugId": "35A70A0D1EE8BB5164756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/dev/components.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/dev/components.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { parseOptions, runCommand } from '@stacksjs/cli'\nimport { frameworkPath, viteConfigPath } from '@stacksjs/path'\nimport type { DeployOptions } from '@stacksjs/types'\n\nconst options: DeployOptions = parseOptions()\n\nif (options.verbose) console.log('dev components options', options)\n\nawait runCommand(`bunx vite --config ${viteConfigPath('src/components.ts')}`, {\n ...options,\n cwd: frameworkPath(),\n})\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AAGA,IAAM,UAAyB,aAAa;AAE5C,IAAI,QAAQ;AAAS,UAAQ,IAAI,0BAA0B,OAAO;AAElE,MAAM,WAAW,sBAAsB,eAAe,mBAAmB,KAAK;AAAA,KACzE;AAAA,EACH,KAAK,cAAc;AACrB,CAAC;",
|
|
8
|
+
"debugId": "79306B0D89A10E0764756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/dev/docs.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/dev/docs.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { runCommand } from '@stacksjs/cli'\nimport { frameworkPath } from '@stacksjs/path'\n\nawait runCommand('bun run dev', {\n cwd: frameworkPath('docs'),\n // verbose: true,\n})\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AAEA,MAAM,WAAW,eAAe;AAAA,EAC9B,KAAK,cAAc,MAAM;AAE3B,CAAC;",
|
|
8
|
+
"debugId": "93A07B0BD512AB3B64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/dev/index.js
CHANGED
|
@@ -5,9 +5,8 @@ import {err} from "@stacksjs/error-handling";
|
|
|
5
5
|
import {log} from "@stacksjs/logging";
|
|
6
6
|
import * as p from "@stacksjs/path";
|
|
7
7
|
import {glob} from "@stacksjs/storage";
|
|
8
|
-
var {Glob } = globalThis.Bun;
|
|
9
8
|
async function runAction(action, options) {
|
|
10
|
-
const glob2 = new Glob("**/*.ts");
|
|
9
|
+
const glob2 = new Bun.Glob("**/*.ts");
|
|
11
10
|
const scanOptions = { cwd: p.userActionsPath(), onlyFiles: true };
|
|
12
11
|
for await (const file of glob2.scan(scanOptions)) {
|
|
13
12
|
log.debug("file", file);
|
|
@@ -110,3 +109,6 @@ export {
|
|
|
110
109
|
runBackendDevServer,
|
|
111
110
|
runApiDevServer
|
|
112
111
|
};
|
|
112
|
+
|
|
113
|
+
//# debugId=8144C64A7D1A45DF64756E2164756E21
|
|
114
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/helpers/utils.ts", "../src/dev/index.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { Action as ActionType } from '@stacksjs/actions'\nimport { buddyOptions, runCommand, runCommands } from '@stacksjs/cli'\nimport { err } from '@stacksjs/error-handling'\nimport { log } from '@stacksjs/logging'\nimport * as p from '@stacksjs/path'\nimport { glob } from '@stacksjs/storage'\nimport type { ActionOptions } from '@stacksjs/types'\n\ntype ActionPath = string // TODO: narrow this by automating its generation\ntype ActionName = string // TODO: narrow this by automating its generation\ntype Action = ActionPath | ActionName | string\n\n/**\n * Run an Action the Stacks way.\n *\n * @param action The action to invoke.\n * @param options The options to pass to the command.\n * @returns The result of the command.\n */\nexport async function runAction(action: Action, options?: ActionOptions) {\n // check if action is a file anywhere in ./app/Actions/**/*.ts\n // if it is, return and await the action\n const glob = new Bun.Glob('**/*.ts')\n const scanOptions = { cwd: p.userActionsPath(), onlyFiles: true }\n\n for await (const file of glob.scan(scanOptions)) {\n log.debug('file', file)\n if (file === `${action}.ts` || file.endsWith(`${action}.ts`))\n return ((await import(/* @vite-ignore */ p.userActionsPath(file))).default as ActionType).handle()\n\n // if a custom model name is used, we need to check for it\n const a = await import(/* @vite-ignore */ p.userActionsPath(file))\n if (a.name === action) return await a.handle()\n }\n\n // or else, just run the action normally by assuming the action is core Action, stored in p.actionsPath\n const opts = buddyOptions()\n const path = p.relativeActionsPath(`src/${action}.ts`)\n const cmd = `bun --bun ${path} ${opts}`.trimEnd()\n const optionsWithCwd = {\n cwd: options?.cwd || p.projectPath(),\n ...options,\n }\n\n log.debug('runAction:', cmd)\n log.debug('action options:', optionsWithCwd)\n\n return await runCommand(cmd, optionsWithCwd)\n}\n\n/**\n * Run Actions the Stacks way.\n *\n * @param actions The actions to invoke.\n * @param options The options to pass to the command.\n * @returns The result of the command.\n */\nexport async function runActions(actions: Action[], options?: ActionOptions) {\n log.debug('runActions:', actions, options)\n\n if (!actions.length) return err('No actions were specified')\n\n for (const action of actions) {\n log.debug(`running action \"${action}\"`)\n if (!hasAction(action)) return err(`The specified action \"${action}\" does not exist`)\n }\n\n const opts = buddyOptions()\n\n const o = {\n cwd: options?.cwd || p.projectPath(),\n ...options,\n }\n\n const commands = actions.map((action) => `bun --bun ${p.relativeActionsPath(`src/${action}.ts`)} ${opts}`)\n\n log.debug('commands:', commands)\n\n return await runCommands(commands, o)\n}\n\n// looks in most common locations\nexport function hasAction(action: Action) {\n // Define patterns specifically for user actions\n const userActionPatterns = [\n `${action}.ts`,\n `${action}`,\n `Dashboard/${action}.ts`,\n `Dashboard/${action}`,\n `Buddy/${action}.ts`,\n `Buddy/${action}`,\n ]\n\n // Define patterns specifically for core actions\n const actionPatterns = [`src/${action}.ts`, `src/${action}`, `${action}.ts`, `${action}`]\n\n // Check user actions path with its specific patterns\n const userActionFiles = glob.sync(userActionPatterns.map((pattern) => p.userActionsPath(pattern)))\n\n // Check actions path with its specific patterns\n const actionFiles = glob.sync(actionPatterns.map((pattern) => p.actionsPath(pattern)))\n\n return userActionFiles.length > 0 || actionFiles.length > 0\n\n // TODO: need to loop through all user actions and check whether the name is a valid action name match\n\n // return false\n}\n",
|
|
6
|
+
"import { Action } from '@stacksjs/enums'\nimport { log } from '@stacksjs/logging'\nimport type { DevOptions } from '@stacksjs/types'\nimport { runAction } from '../helpers'\n\nexport async function runDevServer(options: DevOptions) {\n log.info('Starting your Frontend Engine...')\n await runAction(Action.Dev, options)\n}\n\nexport async function runFrontendDevServer(options: DevOptions) {\n log.info('Starting your UI Engine...')\n await runAction(Action.Dev, options)\n}\n\nexport async function runBackendDevServer(options: DevOptions) {\n runApiDevServer(options)\n}\n\nexport async function runApiDevServer(options: DevOptions) {\n log.info('Starting your API...')\n await runAction(Action.DevApi, options)\n}\n\nexport async function runComponentsDevServer(options: DevOptions) {\n log.info('Starting your Library Engine...')\n await runAction(Action.DevComponents, options)\n}\n\nexport async function runDashboardDevServer(options: DevOptions) {\n log.info('Starting your Dashboard...')\n await runAction(Action.DevDashboard, options)\n}\n\nexport async function runSystemTrayDevServer(options: DevOptions) {\n log.info('Starting your System Tray...')\n await runAction(Action.DevSystemTray, options)\n}\n\nexport async function runDesktopDevServer(options: DevOptions) {\n log.info('Starting your Desktop Engine...')\n await runAction(Action.DevDesktop, options)\n}\n\nexport async function runDocsDevServer(options: DevOptions) {\n log.info('Starting your Docs Engine...')\n await runAction(Action.DevDocs, options)\n}\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";;AACA;AACA;AACA;AACA;AACA;AAcA,eAAsB,SAAS,CAAC,QAAgB,SAAyB;AAGvE,QAAM,QAAO,IAAI,IAAI,KAAK,SAAS;AACnC,QAAM,cAAc,EAAE,KAAO,kBAAgB,GAAG,WAAW,KAAK;AAEhE,mBAAiB,QAAQ,MAAK,KAAK,WAAW,GAAG;AAC/C,QAAI,MAAM,QAAQ,IAAI;AACtB,QAAI,SAAS,GAAG,eAAe,KAAK,SAAS,GAAG,WAAW;AACzD,cAAS,MAAgC,OAAE,kBAAgB,IAAI,IAAI,QAAuB,OAAO;AAGnG,UAAM,IAAI,MAAgC,OAAE,kBAAgB,IAAI;AAChE,QAAI,EAAE,SAAS;AAAQ,aAAO,MAAM,EAAE,OAAO;AAAA,EAC/C;AAGA,QAAM,OAAO,aAAa;AAC1B,QAAM,OAAS,sBAAoB,OAAO,WAAW;AACrD,QAAM,MAAM,aAAa,Q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;AACtD,OAAI,KAAK,kCAAkC;AAC3C,QAAM,UAAU,OAAO,KAAK,OAAO;AAAA;AAGrC,eAAsB,oBAAoB,CAAC,SAAqB;AAC9D,OAAI,KAAK,4BAA4B;AACrC,QAAM,UAAU,OAAO,KAAK,OAAO;AAAA;AAGrC,eAAsB,mBAAmB,CAAC,SAAqB;AAC7D,kBAAgB,OAAO;AAAA;AAGzB,eAAsB,eAAe,CAAC,SAAqB;AACzD,OAAI,KAAK,sBAAsB;AAC/B,QAAM,UAAU,OAAO,QAAQ,OAAO;AAAA;AAGxC,eAAsB,sBAAsB,CAAC,SAAqB;AAChE,OAAI,KAAK,iCAAiC;AAC1C,QAAM,UAAU,OAAO,eAAe,OAAO;AAAA;AAG/C,eAAsB,qBAAqB,CAAC,SAAqB;AAC/D,OAAI,KAAK,4BAA4B;AACrC,QAAM,UAAU,OAAO,cAAc,OAAO;AAAA;AAG9C,eAAsB,sBAAsB,CAAC,SAAqB;AAChE,OAAI,KAAK,8BAA8B;AACvC,QAAM,UAAU,OAAO,eAAe,OAAO;AAAA;AAG/C,eAAsB,mBAAmB,CAAC,SAAqB;AAC7D,OAAI,KAAK,iCAAiC;AAC1C,QAAM,UAAU,OAAO,YAAY,OAAO;AAAA;AAG5C,eAAsB,gBAAgB,CAAC,SAAqB;AAC1D,OAAI,KAAK,8BAA8B;AACvC,QAAM,UAAU,OAAO,SAAS,OAAO;AAAA;",
|
|
9
|
+
"debugId": "8144C64A7D1A45DF64756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
package/dist/examples.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/examples.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import process from 'node:process'\nimport { NpmScript } from '@stacksjs/enums'\nimport { log } from '@stacksjs/logging'\nimport { hasComponents } from '@stacksjs/storage'\nimport type { ExamplesOptions } from '@stacksjs/types'\nimport { ExitCode } from '@stacksjs/types'\nimport { runNpmScript } from '@stacksjs/utils'\n\nexport async function invoke(options: ExamplesOptions) {\n if (options.components || options.vue) await componentExample(options)\n else if (options.webComponents || options.elements) await webComponentExample(options)\n else\n log.error(\n 'An unsupported option was used. Please try again, check the documentation & report the issue, if needed.',\n )\n}\n\nexport async function examples(options: ExamplesOptions) {\n return invoke(options)\n}\n\nexport async function componentExample(options: ExamplesOptions) {\n if (hasComponents()) {\n await runNpmScript(NpmScript.ExampleVue, options)\n log.success('Your component library was built successfully')\n } else {\n log.info('No components found.')\n // todo: throw custom error here\n }\n}\n\nexport async function webComponentExample(options: ExamplesOptions) {\n if (hasComponents()) {\n log.info('Building your Web Component library...')\n await runNpmScript(NpmScript.BuildWebComponents, options)\n log.success('Your Web Component library was built successfully')\n } else {\n log.info('No components found.')\n // todo: throw custom error here\n process.exit(ExitCode.FatalError)\n }\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AACA;AACA;AAEA;AACA;AAEA,eAAsB,MAAM,CAAC,SAA0B;AACrD,MAAI,QAAQ,cAAc,QAAQ;AAAK,UAAM,iBAAiB,OAAO;AAAA,WAC5D,QAAQ,iBAAiB,QAAQ;AAAU,UAAM,oBAAoB,OAAO;AAAA;AAEnF,QAAI,MACF,0GACF;AAAA;AAGJ,eAAsB,QAAQ,CAAC,SAA0B;AACvD,SAAO,OAAO,OAAO;AAAA;AAGvB,eAAsB,gBAAgB,CAAC,SAA0B;AAC/D,MAAI,cAAc,GAAG;AACnB,UAAM,aAAa,UAAU,YAAY,OAAO;AAChD,QAAI,QAAQ,+CAA+C;AAAA,EAC7D,OAAO;AACL,QAAI,KAAK,sBAAsB;AAAA;AAAA;AAKnC,eAAsB,mBAAmB,CAAC,SAA0B;AAClE,MAAI,cAAc,GAAG;AACnB,QAAI,KAAK,wCAAwC;AACjD,UAAM,aAAa,UAAU,oBAAoB,OAAO;AACxD,QAAI,QAAQ,mDAAmD;AAAA,EACjE,OAAO;AACL,QAAI,KAAK,sBAAsB;AAE/B,YAAQ,KAAK,SAAS,UAAU;AAAA;AAAA;",
|
|
8
|
+
"debugId": "B6C2150FA2AC171564756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/fresh.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/fresh.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import process from 'node:process'\nimport { runCommand } from '@stacksjs/cli'\nimport { handleError } from '@stacksjs/error-handling'\nimport { logger } from '@stacksjs/logging'\nimport { projectPath } from '@stacksjs/path'\nimport { ExitCode } from '@stacksjs/types'\nimport { cleanProject } from '@stacksjs/utils'\n\nlogger.log('Cleaning project...')\nawait cleanProject()\n\nlogger.log('Installing dependencies...')\n\nconst result = await runCommand('bun install', {\n cwd: projectPath(),\n})\n\nif (result.isErr()) {\n handleError(result.error)\n process.exit(ExitCode.FatalError)\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,IAAI,qBAAqB;AAChC,MAAM,aAAa;AAEnB,OAAO,IAAI,4BAA4B;AAEvC,IAAM,SAAS,MAAM,WAAW,eAAe;AAAA,EAC7C,KAAK,YAAY;AACnB,CAAC;AAED,IAAI,OAAO,MAAM,GAAG;AAClB,cAAY,OAAO,KAAK;AACxB,UAAQ,KAAK,SAAS,UAAU;AAClC;",
|
|
8
|
+
"debugId": "A0033E6425F79A3764756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/helpers/component-meta.ts", "../src/generate/component-meta.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { path, frameworkPath, join, projectPath } from '@stacksjs/path'\nimport { existsSync, glob, mkdirSync, writeFileSync } from '@stacksjs/storage'\nimport MarkdownIt from 'markdown-it'\nimport { type ComponentMeta, type MetaCheckerOptions, createComponentMetaChecker } from 'vue-component-meta'\n\n/**\n * ℹ️ Useful Links\n *\n * vue-component-meta tests: https://github.com/johnsoncodehk/volar/blob/master/vue-language-tools/vue-component-meta/tests/index.spec.ts\n * Discord thread about improving vue-component-meta: https://discord.com/channels/793943652350427136/1027819645677350912\n * GitHub issue for improving vue-component-meta based on runtime/dynamic props: https://github.com/johnsoncodehk/volar/issues/1854\n * Discord chat: https://discord.com/channels/793943652350427136/1027819645677350912\n * original script: https://raw.githubusercontent.com/jd-solanki/anu/main/scripts/gen-component-meta.ts\n */\n\nexport function generateComponentMeta() {\n const md = new MarkdownIt()\n const checkerOptions: MetaCheckerOptions = {\n forceUseTs: true,\n schema: { ignore: ['MyIgnoredNestedProps'] },\n printer: { newLine: 1 },\n }\n\n const tsconfigChecker = createComponentMetaChecker(projectPath('tsconfig.json'), checkerOptions)\n\n const filterMeta = (meta: ComponentMeta): ComponentApi => {\n // const clonedMeta: ComponentMeta = JSON.parse(JSON.stringify(meta))\n\n // Exclude global props\n const props: ComponentApiProps[] = []\n meta.props.forEach((prop) => {\n if (prop?.global) return\n\n const { name, description, required, type, default: defaultValue } = prop\n\n props.push({\n name: `${name}${required ? '' : '?'}`,\n description: md.render(description),\n\n // required,\n\n type,\n default: defaultValue || 'unknown',\n })\n })\n\n return {\n props,\n events: meta.events,\n slots: meta.slots,\n }\n }\n\n const components = glob.sync(['components/*.stx', 'components/**/*.stx', 'components/*.vue', 'components/**/*.vue'], {\n cwd: projectPath(),\n absolute: true,\n })\n\n components.forEach((componentPath) => {\n // Thanks: https://futurestud.io/tutorials/node-js-get-a-file-name-with-or-without-extension\n const componentExportName = path.parse(componentPath).name\n const meta = filterMeta(tsconfigChecker.getComponentMeta(componentPath, componentExportName))\n\n const metaDirPath = frameworkPath('component-meta')\n\n // if meta dir doesn't exist create\n\n if (!existsSync(metaDirPath)) mkdirSync(metaDirPath)\n\n const metaJsonFilePath = join(metaDirPath, `${componentExportName}.json`)\n writeFileSync(metaJsonFilePath, JSON.stringify(meta, null, 4))\n })\n}\n\nexport interface ComponentApiProps {\n name: ComponentMeta['props'][number]['name']\n description: ComponentMeta['props'][number]['description']\n\n // required: ComponentMeta['props'][number]['required']\n type: ComponentMeta['props'][number]['type']\n default: ComponentMeta['props'][number]['default']\n}\n\nexport interface ComponentApi {\n props: ComponentApiProps[]\n events: ComponentMeta['events']\n slots: ComponentMeta['slots']\n}\n",
|
|
6
|
+
"#!/usr/bin/env bun\n\n/**\n * This action generates the component meta.\n */\n\nimport { log } from '@stacksjs/logging'\nimport { hasComponents } from '@stacksjs/storage'\nimport { generateComponentMeta } from '../helpers/component-meta'\n\nlog.info('Generating component meta...')\n\nif (hasComponents()) generateComponentMeta()\nelse log.info('No components found. Skipping component meta generation.')\n\nlog.success('Generated component meta.')\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";;;;AAAA,gBAAS;AACT;AACA;AACA;AAYO,SAAS,qBAAqB,GAAG;AACtC,QAAM,KAAK,IAAI;AACf,QAAM,iBAAqC;AAAA,IACzC,YAAY;AAAA,IACZ,QAAQ,EAAE,QAAQ,CAAC,sBAAsB,EAAE;AAAA,IAC3C,SAAS,EAAE,SAAS,EAAE;AAAA,EACxB;AAEA,QAAM,kBAAkB,2BAA2B,YAAY,eAAe,GAAG,cAAc;AAE/F,QAAM,aAAa,CAAC,SAAsC;AAIxD,UAAM,QAA6B,CAAC;AACpC,SAAK,MAAM,QAAQ,CAAC,SAAS;AAC3B,UAAI,MAAM;AAAQ;AAElB,cAAQ,MAAM,aAAa,UAAU,MAAM,SAAS,iBAAiB;AAErE,YAAM,KAAK;AAAA,QACT,MAAM,GAAG,OAAO,WAAW,KAAK;AAAA,QAChC,aAAa,GAAG,OAAO,WAAW;AAAA,QAIlC;AAAA,QACA,SAAS,gBAAgB;AAAA,MAC3B,CAAC;AAAA,KACF;AAED,WAAO;AAAA,MACL;AAAA,MACA,QAAQ,KAAK;AAAA,MACb,OAAO,KAAK;AAAA,IACd;AAAA;AAGF,QAAM,aAAa,KAAK,KAAK,CAAC,oBAAoB,uBAAuB,oBAAoB,qBAAqB,GAAG;AAAA,IACnH,KAAK,YAAY;AAAA,IACjB,UAAU;AAAA,EACZ,CAAC;AAED,aAAW,QAAQ,CAAC,kBAAkB;AAEpC,UAAM,sBAAsB,MAAK,MAAM,aAAa,EAAE;AACtD,UAAM,OAAO,WAAW,gBAAgB,iBAAiB,eAAe,mBAAmB,CAAC;AAE5F,UAAM,cAAc,cAAc,gBAAgB;AAIlD,SAAK,WAAW,WAAW;AAAG,gBAAU,WAAW;AAEnD,UAAM,mBAAmB,KAAK,aAAa,GAAG,0BAA0B;AACxE,kBAAc,kBAAkB,KAAK,UAAU,MAAM,MAAM,CAAC,CAAC;AAAA,GAC9D;AAAA;;;ACjEH;AACA;AAGA,IAAI,KAAK,8BAA8B;AAEvC,IAAI,cAAc;AAAG,wBAAsB;AAAA;AACtC,MAAI,KAAK,0DAA0D;AAExE,IAAI,QAAQ,2BAA2B;",
|
|
9
|
+
"debugId": "17775BD7AC8A4A6264756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -76,14 +76,14 @@ async function generateWebTypes() {
|
|
|
76
76
|
log.info("Generating web-types.json...");
|
|
77
77
|
log.info("This feature is not yet implemented.");
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
function generateComponentInfoData() {
|
|
80
80
|
const componentsData = JSON.stringify(library_default.vueComponents?.tags);
|
|
81
81
|
return `{
|
|
82
82
|
"version": 1.1,
|
|
83
83
|
"tags": ${componentsData}
|
|
84
84
|
}
|
|
85
85
|
`;
|
|
86
|
-
}
|
|
86
|
+
}
|
|
87
87
|
|
|
88
88
|
// src/generate/ide-helpers.ts
|
|
89
89
|
import {log as log2} from "@stacksjs/logging";
|
|
@@ -94,3 +94,6 @@ if (hasComponents()) {
|
|
|
94
94
|
} else {
|
|
95
95
|
log2.info("No components found. Skipping IDE helper generation.");
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
//# debugId=1F402858DE70B6C464756E2164756E21
|
|
99
|
+
//# sourceMappingURL=ide-helpers.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/helpers/vscode-custom-data.ts", "../../../../../config/library.ts", "../src/generate/ide-helpers.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { log } from '@stacksjs/logging'\nimport { customElementsDataPath } from '@stacksjs/path'\nimport { writeTextFile } from '@stacksjs/storage'\nimport library from '~/config/library'\n\nexport async function generateVsCodeCustomData() {\n try {\n log.info('Generating custom-elements.json...')\n // the version does not have to be set here,\n // it will be set automatically by the release script\n await writeTextFile({\n path: customElementsDataPath(),\n data: generateComponentInfoData(),\n })\n log.success('Generated custom-elements.json for IDEs.')\n } catch (err) {\n log.error('There was an error generating the custom-elements.json file.', err)\n }\n}\n\nexport async function generateWebTypes() {\n log.info('Generating web-types.json...')\n log.info('This feature is not yet implemented.')\n}\n\nfunction generateComponentInfoData() {\n const componentsData = JSON.stringify(library.vueComponents?.tags)\n\n return `{\n \"version\": 1.1,\n \"tags\": ${componentsData}\n}\n`\n}\n",
|
|
6
|
+
"import type { LibraryConfig } from '@stacksjs/types'\n\n/**\n * **Library Configuration**\n *\n * This configuration defines all of your library options. Because Stacks is fully-typed, you\n * may hover any of the options below and the definitions will be provided. In case you\n * have any questions, feel free to reach out via Discord or GitHub Discussions.\n */\nexport default {\n name: 'hello-world',\n owner: '@stacksjs', // you may or may not add the @ prefix here (it is added automatically)\n repository: 'stacksjs/stacks',\n license: 'MIT',\n author: 'Chris Breuer',\n contributors: ['Chris Breuer <chris@stacksjs.org>'],\n defaultLanguage: 'en',\n releaseable: true,\n\n vueComponents: {\n name: 'hello-world-vue',\n description: 'Your Vue component library description',\n keywords: ['component', 'library', 'vue', 'vite', 'typescript', 'javascript'],\n tags: [\n {\n name: ['HelloWorld', 'AppHelloWorld'],\n description: 'The Hello World custom element, built via this framework.',\n attributes: [\n {\n name: 'greeting',\n description: 'The greeting.',\n },\n ],\n },\n ],\n },\n\n webComponents: {\n name: 'hello-world-elements',\n description: 'Your framework agnostic web component library description.',\n keywords: ['custom-elements', 'web-components', 'library', 'framework-agnostic', 'typescript', 'javascript'],\n tags: [\n {\n name: ['HelloWorld', 'AppHelloWorld'],\n description: 'The Hello World custom element, built via this framework.',\n attributes: [\n {\n name: 'greeting',\n description: 'The greeting.',\n },\n ],\n },\n ],\n },\n\n functions: {\n name: 'hello-world-fx',\n description: 'Your function library description.',\n keywords: ['functions', 'composables', 'library', 'typescript', 'javascript'],\n shouldGenerateSourcemap: false,\n files: ['counter', 'dark'],\n },\n} satisfies LibraryConfig\n",
|
|
7
|
+
"#!/usr/bin/env bun\n\n/**\n * This action generates the web-types.json & custom-elements.json\n * files for the components.\n */\n\nimport { log } from '@stacksjs/logging'\nimport { hasComponents } from '@stacksjs/storage'\nimport { generateVsCodeCustomData, generateWebTypes } from '../helpers/vscode-custom-data'\n\nif (hasComponents()) {\n await generateWebTypes()\n await generateVsCodeCustomData()\n} else {\n log.info('No components found. Skipping IDE helper generation.')\n}\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";;;;AAAA;AACA;AACA;;;ACOA,IAAe;AAAA,EACb,MAAM;AAAA,EACN,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,cAAc,CAAC,mCAAmC;AAAA,EAClD,iBAAiB;AAAA,EACjB,aAAa;AAAA,EAEb,eAAe;AAAA,IACb,MAAM;AAAA,IACN,aAAa;AAAA,IACb,UAAU,CAAC,aAAa,WAAW,OAAO,QAAQ,cAAc,YAAY;AAAA,IAC5E,MAAM;AAAA,MACJ;AAAA,QACE,MAAM,CAAC,cAAc,eAAe;AAAA,QACpC,aAAa;AAAA,QACb,YAAY;AAAA,UACV;AAA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