@stacksjs/buddy 0.66.0 → 0.67.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.
Files changed (106) hide show
  1. package/dist/{chunk-3zx3yk1m.js → chunk-3whxjf1k.js} +1 -4
  2. package/dist/chunk-42swmjjw.js +2 -0
  3. package/dist/chunk-564c63vr.js +2 -0
  4. package/dist/chunk-5wxk7vka.js +1 -0
  5. package/dist/chunk-6cscdnf5.js +2 -0
  6. package/dist/chunk-898dh3kh.js +8 -0
  7. package/dist/chunk-9g2p5d3j.js +2 -0
  8. package/dist/chunk-bpa4071y.js +2 -0
  9. package/dist/chunk-cbtnhpqk.js +2 -0
  10. package/dist/chunk-f18wwa85.js +827 -0
  11. package/dist/chunk-g767h9jq.js +3 -0
  12. package/dist/chunk-hgzxtrgw.js +9 -0
  13. package/dist/chunk-hqv9y9k2.js +6 -0
  14. package/dist/chunk-jfs19hhz.js +2 -0
  15. package/dist/chunk-ncwfzcsm.js +2 -0
  16. package/dist/chunk-pfb4369d.js +2 -0
  17. package/dist/chunk-sgm5999j.js +12 -0
  18. package/dist/chunk-we57sm1m.js +2 -0
  19. package/dist/chunk-wps8bq6b.js +2 -0
  20. package/dist/chunk-y2g00ayp.js +2 -0
  21. package/dist/chunk-ycyg22fp.js +2 -0
  22. package/dist/cli.js +1 -4
  23. package/dist/index.js +1 -4
  24. package/dist/stacks +0 -0
  25. package/package.json +48 -49
  26. package/dist/chunk-3cfvbq6w.js +0 -5
  27. package/dist/chunk-3cfvbq6w.js.map +0 -32
  28. package/dist/chunk-3v3h2zkp.js +0 -5
  29. package/dist/chunk-3v3h2zkp.js.map +0 -46
  30. package/dist/chunk-3zx3yk1m.js.map +0 -15
  31. package/dist/chunk-8a487snn.js +0 -5
  32. package/dist/chunk-8a487snn.js.map +0 -9
  33. package/dist/chunk-9kkf5maz.js +0 -5
  34. package/dist/chunk-9kkf5maz.js.map +0 -23
  35. package/dist/chunk-9qba8jdt.js +0 -12
  36. package/dist/chunk-9qba8jdt.js.map +0 -11
  37. package/dist/chunk-cvpb67bs.js +0 -5
  38. package/dist/chunk-cvpb67bs.js.map +0 -10
  39. package/dist/chunk-eqwfdbyk.js +0 -5
  40. package/dist/chunk-eqwfdbyk.js.map +0 -17
  41. package/dist/chunk-f41k7dpa.js +0 -5
  42. package/dist/chunk-f41k7dpa.js.map +0 -11
  43. package/dist/chunk-fx1zxxxa.js +0 -9
  44. package/dist/chunk-fx1zxxxa.js.map +0 -13
  45. package/dist/chunk-get5gzkc.js +0 -11
  46. package/dist/chunk-get5gzkc.js.map +0 -10
  47. package/dist/chunk-m43npkjw.js +0 -5
  48. package/dist/chunk-m43npkjw.js.map +0 -12
  49. package/dist/chunk-mrrgcavv.js +0 -831
  50. package/dist/chunk-mrrgcavv.js.map +0 -240
  51. package/dist/chunk-n5y0mrsg.js +0 -15
  52. package/dist/chunk-n5y0mrsg.js.map +0 -173
  53. package/dist/chunk-qebxvzqz.js +0 -5
  54. package/dist/chunk-qebxvzqz.js.map +0 -26
  55. package/dist/chunk-qj2v5psd.js +0 -5
  56. package/dist/chunk-qj2v5psd.js.map +0 -20
  57. package/dist/chunk-rh4brnzh.js +0 -5
  58. package/dist/chunk-rh4brnzh.js.map +0 -16
  59. package/dist/chunk-w2vwjv6k.js +0 -6
  60. package/dist/chunk-w2vwjv6k.js.map +0 -57
  61. package/dist/chunk-w81rbh65.js +0 -5
  62. package/dist/chunk-w81rbh65.js.map +0 -10
  63. package/dist/chunk-wayp5kn2.js +0 -5
  64. package/dist/chunk-wayp5kn2.js.map +0 -22
  65. package/dist/chunk-x5c5ngpb.js +0 -4
  66. package/dist/chunk-x5c5ngpb.js.map +0 -23
  67. package/dist/cli.js.map +0 -10
  68. package/dist/index.js.map +0 -9
  69. package/src/cli.ts +0 -105
  70. package/src/commands/add.ts +0 -71
  71. package/src/commands/build.ts +0 -299
  72. package/src/commands/changelog.ts +0 -52
  73. package/src/commands/clean.ts +0 -46
  74. package/src/commands/cloud.ts +0 -553
  75. package/src/commands/commit.ts +0 -26
  76. package/src/commands/configure.ts +0 -84
  77. package/src/commands/create.ts +0 -143
  78. package/src/commands/deploy.ts +0 -194
  79. package/src/commands/dev.ts +0 -292
  80. package/src/commands/dns.ts +0 -86
  81. package/src/commands/domains.ts +0 -255
  82. package/src/commands/fresh.ts +0 -48
  83. package/src/commands/generate.ts +0 -202
  84. package/src/commands/http.ts +0 -57
  85. package/src/commands/index.ts +0 -33
  86. package/src/commands/install.ts +0 -30
  87. package/src/commands/key.ts +0 -36
  88. package/src/commands/lint.ts +0 -54
  89. package/src/commands/list.ts +0 -42
  90. package/src/commands/make.ts +0 -352
  91. package/src/commands/migrate.ts +0 -105
  92. package/src/commands/outdated.ts +0 -31
  93. package/src/commands/ports.ts +0 -188
  94. package/src/commands/prepublish.ts +0 -28
  95. package/src/commands/projects.ts +0 -54
  96. package/src/commands/release.ts +0 -47
  97. package/src/commands/route.ts +0 -39
  98. package/src/commands/seed.ts +0 -47
  99. package/src/commands/setup.ts +0 -145
  100. package/src/commands/test.ts +0 -214
  101. package/src/commands/tinker.ts +0 -42
  102. package/src/commands/types.ts +0 -35
  103. package/src/commands/upgrade.ts +0 -200
  104. package/src/commands/version.ts +0 -29
  105. package/src/custom-cli.ts +0 -35
  106. package/src/index.ts +0 -1
@@ -1,23 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/slurpFile.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js", "../../../../../node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js"],
4
- "sourcesContent": [
5
- "export const ENV_PROFILE = \"AWS_PROFILE\";\nexport const DEFAULT_PROFILE = \"default\";\nexport const getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;\n",
6
- "import { join } from \"path\";\nimport { getHomeDir } from \"./getHomeDir\";\nexport const ENV_CONFIG_PATH = \"AWS_CONFIG_FILE\";\nexport const getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join(getHomeDir(), \".aws\", \"config\");\n",
7
- "import { homedir } from \"os\";\nimport { sep } from \"path\";\nconst homeDirCache = {};\nconst getHomeDirCacheKey = () => {\n if (process && process.geteuid) {\n return `${process.geteuid()}`;\n }\n return \"DEFAULT\";\n};\nexport const getHomeDir = () => {\n const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${sep}` } = process.env;\n if (HOME)\n return HOME;\n if (USERPROFILE)\n return USERPROFILE;\n if (HOMEPATH)\n return `${HOMEDRIVE}${HOMEPATH}`;\n const homeDirCacheKey = getHomeDirCacheKey();\n if (!homeDirCache[homeDirCacheKey])\n homeDirCache[homeDirCacheKey] = homedir();\n return homeDirCache[homeDirCacheKey];\n};\n",
8
- "import { IniSectionType } from \"@smithy/types\";\nimport { CONFIG_PREFIX_SEPARATOR } from \"./loadSharedConfigFiles\";\nexport const getSsoSessionData = (data) => Object.entries(data)\n .filter(([key]) => key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR))\n .reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});\n",
9
- "import { join } from \"path\";\nimport { getConfigData } from \"./getConfigData\";\nimport { getConfigFilepath } from \"./getConfigFilepath\";\nimport { getCredentialsFilepath } from \"./getCredentialsFilepath\";\nimport { getHomeDir } from \"./getHomeDir\";\nimport { parseIni } from \"./parseIni\";\nimport { slurpFile } from \"./slurpFile\";\nconst swallowError = () => ({});\nexport const CONFIG_PREFIX_SEPARATOR = \".\";\nexport const loadSharedConfigFiles = async (init = {}) => {\n const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;\n const homeDir = getHomeDir();\n const relativeHomeDirPrefix = \"~/\";\n let resolvedFilepath = filepath;\n if (filepath.startsWith(relativeHomeDirPrefix)) {\n resolvedFilepath = join(homeDir, filepath.slice(2));\n }\n let resolvedConfigFilepath = configFilepath;\n if (configFilepath.startsWith(relativeHomeDirPrefix)) {\n resolvedConfigFilepath = join(homeDir, configFilepath.slice(2));\n }\n const parsedFiles = await Promise.all([\n slurpFile(resolvedConfigFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .then(getConfigData)\n .catch(swallowError),\n slurpFile(resolvedFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .catch(swallowError),\n ]);\n return {\n configFile: parsedFiles[0],\n credentialsFile: parsedFiles[1],\n };\n};\n",
10
- "import { IniSectionType } from \"@smithy/types\";\nimport { CONFIG_PREFIX_SEPARATOR } from \"./loadSharedConfigFiles\";\nexport const getConfigData = (data) => Object.entries(data)\n .filter(([key]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n if (indexOfSeparator === -1) {\n return false;\n }\n return Object.values(IniSectionType).includes(key.substring(0, indexOfSeparator));\n})\n .reduce((acc, [key, value]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n const updatedKey = key.substring(0, indexOfSeparator) === IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;\n acc[updatedKey] = value;\n return acc;\n}, {\n ...(data.default && { default: data.default }),\n});\n",
11
- "import { join } from \"path\";\nimport { getHomeDir } from \"./getHomeDir\";\nexport const ENV_CREDENTIALS_PATH = \"AWS_SHARED_CREDENTIALS_FILE\";\nexport const getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join(getHomeDir(), \".aws\", \"credentials\");\n",
12
- "import { IniSectionType } from \"@smithy/types\";\nimport { CONFIG_PREFIX_SEPARATOR } from \"./loadSharedConfigFiles\";\nconst prefixKeyRegex = /^([\\w-]+)\\s([\"'])?([\\w-@\\+\\.%:/]+)\\2$/;\nconst profileNameBlockList = [\"__proto__\", \"profile __proto__\"];\nexport const parseIni = (iniData) => {\n const map = {};\n let currentSection;\n let currentSubSection;\n for (const iniLine of iniData.split(/\\r?\\n/)) {\n const trimmedLine = iniLine.split(/(^|\\s)[;#]/)[0].trim();\n const isSection = trimmedLine[0] === \"[\" && trimmedLine[trimmedLine.length - 1] === \"]\";\n if (isSection) {\n currentSection = undefined;\n currentSubSection = undefined;\n const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);\n const matches = prefixKeyRegex.exec(sectionName);\n if (matches) {\n const [, prefix, , name] = matches;\n if (Object.values(IniSectionType).includes(prefix)) {\n currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);\n }\n }\n else {\n currentSection = sectionName;\n }\n if (profileNameBlockList.includes(sectionName)) {\n throw new Error(`Found invalid profile name \"${sectionName}\"`);\n }\n }\n else if (currentSection) {\n const indexOfEqualsSign = trimmedLine.indexOf(\"=\");\n if (![0, -1].includes(indexOfEqualsSign)) {\n const [name, value] = [\n trimmedLine.substring(0, indexOfEqualsSign).trim(),\n trimmedLine.substring(indexOfEqualsSign + 1).trim(),\n ];\n if (value === \"\") {\n currentSubSection = name;\n }\n else {\n if (currentSubSection && iniLine.trimStart() === iniLine) {\n currentSubSection = undefined;\n }\n map[currentSection] = map[currentSection] || {};\n const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;\n map[currentSection][key] = value;\n }\n }\n }\n }\n return map;\n};\n",
13
- "import { promises as fsPromises } from \"fs\";\nconst { readFile } = fsPromises;\nconst filePromisesHash = {};\nexport const slurpFile = (path, options) => {\n if (!filePromisesHash[path] || options?.ignoreCache) {\n filePromisesHash[path] = readFile(path, \"utf8\");\n }\n return filePromisesHash[path];\n};\n",
14
- "import { getConfigFilepath } from \"./getConfigFilepath\";\nimport { getSsoSessionData } from \"./getSsoSessionData\";\nimport { parseIni } from \"./parseIni\";\nimport { slurpFile } from \"./slurpFile\";\nconst swallowError = () => ({});\nexport const loadSsoSessionData = async (init = {}) => slurpFile(init.configFilepath ?? getConfigFilepath())\n .then(parseIni)\n .then(getSsoSessionData)\n .catch(swallowError);\n",
15
- "export const mergeConfigFiles = (...files) => {\n const merged = {};\n for (const file of files) {\n for (const [key, values] of Object.entries(file)) {\n if (merged[key] !== undefined) {\n Object.assign(merged[key], values);\n }\n else {\n merged[key] = values;\n }\n }\n }\n return merged;\n};\n",
16
- "import { loadSharedConfigFiles } from \"./loadSharedConfigFiles\";\nimport { mergeConfigFiles } from \"./mergeConfigFiles\";\nexport const parseKnownFiles = async (init) => {\n const parsedFiles = await loadSharedConfigFiles(init);\n return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);\n};\n",
17
- "import { createHash } from \"crypto\";\nimport { join } from \"path\";\nimport { getHomeDir } from \"./getHomeDir\";\nexport const getSSOTokenFilepath = (id) => {\n const hasher = createHash(\"sha1\");\n const cacheName = hasher.update(id).digest(\"hex\");\n return join(getHomeDir(), \".aws\", \"sso\", \"cache\", `${cacheName}.json`);\n};\n",
18
- "import { promises as fsPromises } from \"fs\";\nimport { getSSOTokenFilepath } from \"./getSSOTokenFilepath\";\nconst { readFile } = fsPromises;\nexport const getSSOTokenFromFile = async (id) => {\n const ss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AAW,OAAO,QAAQ,CAAI,EAC3C,GAAI,EAAO,KAAS,OAChB,OAAO,OAAO,EAAO,GAAM,CAAM,MAGjC,GAAO,GAAO,EAI1B,OAAO,GCVJ,IAAM,GAAkB,MAAO,IAAS,CAC3C,MAAM,EAAc,MAAM,EAAsB,CAAI,EACpD,OAAO,EAAiB,EAAY,WAAY,EAAY,eAAe,GCJ/E,qBAAS,eACT,eAAS,aAEF,IAAM,EAAsB,CAAC,IAAO,CAEvC,MAAM,EADS,EAAW,MAAM,EACP,OAAO,CAAE,EAAE,OAAO,KAAK,EAChD,OAAO,EAAK,EAAW,EAAG,OAAQ,MAAO,QAAS,GAAG,QAAgB,GCNzE,mBAAS,WAET,IAAQ,YAAa,EACR,GAAsB,MAAO,IAAO,CAC7C,MAAM,EAAmB,EAAoB,CAAE,EACzC,EAAe,MAAM,EAAS,EAAkB,MAAM,EAC5D,OAAO,KAAK,MAAM,CAAY",
21
- "debugId": "0BCFADA372B7509E64756E2164756E21",
22
- "names": []
23
- }
package/dist/cli.js.map DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/cli.ts"],
4
- "sourcesContent": [
5
- "import type { CAC } from '@stacksjs/cli'\nimport process from 'node:process'\nimport { runAction } from '@stacksjs/actions'\nimport { cli, log } from '@stacksjs/cli'\nimport { Action } from '@stacksjs/enums'\nimport { path as p } from '@stacksjs/path'\nimport { fs } from '@stacksjs/storage'\nimport { ensureProjectIsInitialized } from '@stacksjs/utils'\nimport * as cmd from './commands'\n\n// setup global error handlers\nprocess.on('uncaughtException', (error: Error) => {\n log.debug('Buddy uncaughtException')\n log.error(error)\n process.exit(1)\n})\n\nprocess.on('unhandledRejection', (error: Error) => {\n log.debug('Buddy unhandledRejection')\n log.error(error)\n process.exit(1)\n})\n\nasync function main() {\n const buddy = cli('buddy')\n\n // the following commands are not dependent on the project being initialized\n cmd.setup(buddy)\n cmd.key(buddy)\n\n // before running any commands, ensure the project is already initialized\n const isAppKeySet = await ensureProjectIsInitialized()\n if (isAppKeySet) {\n log.debug('Project is initialized')\n }\n else {\n log.info('Your `APP_KEY` is not yet set')\n log.info('Generating application key...')\n const result = await runAction(Action.KeyGenerate)\n\n if (result.isErr()) {\n log.error('Failed to set random application key.', result.error)\n process.exit()\n }\n }\n\n cmd.build(buddy)\n cmd.changelog(buddy)\n cmd.clean(buddy)\n cmd.cloud(buddy)\n cmd.commit(buddy)\n cmd.configure(buddy)\n cmd.dev(buddy)\n cmd.domains(buddy)\n cmd.deploy(buddy)\n cmd.dns(buddy)\n cmd.ports(buddy)\n cmd.projects(buddy)\n cmd.fresh(buddy)\n cmd.generate(buddy)\n cmd.http(buddy)\n cmd.install(buddy)\n cmd.lint(buddy)\n cmd.list(buddy)\n cmd.make(buddy)\n cmd.migrate(buddy)\n cmd.outdated(buddy)\n cmd.release(buddy)\n cmd.route(buddy)\n cmd.seed(buddy)\n cmd.setup(buddy)\n cmd.test(buddy)\n cmd.tinker(buddy)\n cmd.version(buddy)\n cmd.prepublish(buddy)\n cmd.upgrade(buddy)\n\n // dynamic imports\n await dynamicImports(buddy)\n\n buddy.help()\n buddy.parse()\n}\n\nawait main()\n\nasync function dynamicImports(buddy: CAC) {\n // dynamically import and register commands from ./app/Commands/*\n const commandsDir = p.appPath('Commands')\n const commandFiles = fs.readdirSync(commandsDir).filter((file: string) => file.endsWith('.ts'))\n\n for (const file of commandFiles) {\n const commandPath = `${commandsDir}/${file}`\n const dynamicImport = await import(commandPath)\n\n // Correctly use the default export function\n if (typeof dynamicImport.default === 'function')\n dynamicImport.default(buddy)\n else console.error(`Expected a default export function in ${file}, but got:`, dynamicImport.default)\n }\n\n const listenerImport = await import(p.listenersPath('Console.ts'))\n if (typeof listenerImport.default === 'function')\n listenerImport.default(buddy)\n}\n"
6
- ],
7
- "mappings": ";8kBACA,iBACA,cAAS,oBACT,QAAS,GAAK,gBACd,WAAS,kBACT,SAAS,iBACT,aAAS,0BACT,qCAAS,wBAgBT,eAAe,CAAI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AAa,SAAE,cAAc,YAAY,GAChE,UAAW,EAAe,UAAY,WACpC,EAAe,QAAQ,CAAK,EA5FhC,EAAQ,GAAG,oBAAqB,CAAC,IAAiB,CAChD,EAAI,MAAM,yBAAyB,EACnC,EAAI,MAAM,CAAK,EACf,EAAQ,KAAK,CAAC,EACf,EAED,EAAQ,GAAG,qBAAsB,CAAC,IAAiB,CACjD,EAAI,MAAM,0BAA0B,EACpC,EAAI,MAAM,CAAK,EACf,EAAQ,KAAK,CAAC,EACf,EA+DD,MAAM,EAAK",
8
- "debugId": "D6C317F38B22716E64756E2164756E21",
9
- "names": []
10
- }
package/dist/index.js.map DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [
5
- ],
6
- "mappings": "",
7
- "debugId": "82A1EEF47F56914E64756E2164756E21",
8
- "names": []
9
- }
package/src/cli.ts DELETED
@@ -1,105 +0,0 @@
1
- import type { CAC } from '@stacksjs/cli'
2
- import process from 'node:process'
3
- import { runAction } from '@stacksjs/actions'
4
- import { cli, log } from '@stacksjs/cli'
5
- import { Action } from '@stacksjs/enums'
6
- import { path as p } from '@stacksjs/path'
7
- import { fs } from '@stacksjs/storage'
8
- import { ensureProjectIsInitialized } from '@stacksjs/utils'
9
- import * as cmd from './commands'
10
-
11
- // setup global error handlers
12
- process.on('uncaughtException', (error: Error) => {
13
- log.debug('Buddy uncaughtException')
14
- log.error(error)
15
- process.exit(1)
16
- })
17
-
18
- process.on('unhandledRejection', (error: Error) => {
19
- log.debug('Buddy unhandledRejection')
20
- log.error(error)
21
- process.exit(1)
22
- })
23
-
24
- async function main() {
25
- const buddy = cli('buddy')
26
-
27
- // the following commands are not dependent on the project being initialized
28
- cmd.setup(buddy)
29
- cmd.key(buddy)
30
-
31
- // before running any commands, ensure the project is already initialized
32
- const isAppKeySet = await ensureProjectIsInitialized()
33
- if (isAppKeySet) {
34
- log.debug('Project is initialized')
35
- }
36
- else {
37
- log.info('Your `APP_KEY` is not yet set')
38
- log.info('Generating application key...')
39
- const result = await runAction(Action.KeyGenerate)
40
-
41
- if (result.isErr()) {
42
- log.error('Failed to set random application key.', result.error)
43
- process.exit()
44
- }
45
- }
46
-
47
- cmd.build(buddy)
48
- cmd.changelog(buddy)
49
- cmd.clean(buddy)
50
- cmd.cloud(buddy)
51
- cmd.commit(buddy)
52
- cmd.configure(buddy)
53
- cmd.dev(buddy)
54
- cmd.domains(buddy)
55
- cmd.deploy(buddy)
56
- cmd.dns(buddy)
57
- cmd.ports(buddy)
58
- cmd.projects(buddy)
59
- cmd.fresh(buddy)
60
- cmd.generate(buddy)
61
- cmd.http(buddy)
62
- cmd.install(buddy)
63
- cmd.lint(buddy)
64
- cmd.list(buddy)
65
- cmd.make(buddy)
66
- cmd.migrate(buddy)
67
- cmd.outdated(buddy)
68
- cmd.release(buddy)
69
- cmd.route(buddy)
70
- cmd.seed(buddy)
71
- cmd.setup(buddy)
72
- cmd.test(buddy)
73
- cmd.tinker(buddy)
74
- cmd.version(buddy)
75
- cmd.prepublish(buddy)
76
- cmd.upgrade(buddy)
77
-
78
- // dynamic imports
79
- await dynamicImports(buddy)
80
-
81
- buddy.help()
82
- buddy.parse()
83
- }
84
-
85
- await main()
86
-
87
- async function dynamicImports(buddy: CAC) {
88
- // dynamically import and register commands from ./app/Commands/*
89
- const commandsDir = p.appPath('Commands')
90
- const commandFiles = fs.readdirSync(commandsDir).filter((file: string) => file.endsWith('.ts'))
91
-
92
- for (const file of commandFiles) {
93
- const commandPath = `${commandsDir}/${file}`
94
- const dynamicImport = await import(commandPath)
95
-
96
- // Correctly use the default export function
97
- if (typeof dynamicImport.default === 'function')
98
- dynamicImport.default(buddy)
99
- else console.error(`Expected a default export function in ${file}, but got:`, dynamicImport.default)
100
- }
101
-
102
- const listenerImport = await import(p.listenersPath('Console.ts'))
103
- if (typeof listenerImport.default === 'function')
104
- listenerImport.default(buddy)
105
- }
@@ -1,71 +0,0 @@
1
- import type { AddOptions, BuildOptions, CLI } from '@stacksjs/types'
2
- import process from 'node:process'
3
- import { runAdd } from '@stacksjs/actions'
4
- import { log } from '@stacksjs/logging'
5
- import { ExitCode } from '@stacksjs/types'
6
-
7
- export function add(buddy: CLI): void {
8
- const descriptions = {
9
- add: 'Add a stack to your project (coming soon)',
10
- table: 'Add the Table Stack to your project',
11
- calendar: 'Add the Calendar Stack to your project',
12
- all: 'Add all stacks',
13
- select: 'Which stack/s are you trying to add?',
14
- project: 'Target a specific project',
15
- verbose: 'Enable verbose output',
16
- }
17
-
18
- buddy
19
- .command('add', descriptions.add)
20
- .option('-t, --table', descriptions.table, { default: false })
21
- .option('-c, --calendar', descriptions.calendar, { default: false })
22
- .option('-a, --all', descriptions.all, { default: false })
23
- .option('-p, --project [project]', descriptions.project, { default: false })
24
- .option('--verbose', descriptions.verbose, { default: false })
25
- .action(async (options: BuildOptions) => {
26
- log.debug('Running `buddy add`...', options)
27
-
28
- if (hasNoOptions(options)) {
29
- // const answers = await log.prompt(descriptions.select, {
30
- // type: 'multiselect',
31
- // options: [
32
- // { label: 'Calendar', value: 'calendar' },
33
- // { label: 'Table', value: 'table' },
34
- // ],
35
- // })
36
- // // creates an object out of array and sets answers to true
37
- // options = answers.reduce((a: any, v: any) => ({ ...a, [v]: true }), {})
38
- }
39
-
40
- await runAdd(options)
41
-
42
- process.exit(ExitCode.Success)
43
- })
44
-
45
- buddy
46
- .command('add:table', descriptions.table)
47
- .option('-t, --table', descriptions.table, { default: true })
48
- .option('-p, --project [project]', descriptions.project, { default: false })
49
- .option('--verbose', descriptions.verbose, { default: false })
50
- .action(async (options: BuildOptions) => {
51
- await runAdd(options)
52
- })
53
-
54
- buddy
55
- .command('add:calendar', descriptions.calendar)
56
- .option('-t, --calendar', descriptions.calendar, { default: true })
57
- .option('-p, --project [project]', descriptions.project, { default: false })
58
- .option('--verbose', descriptions.verbose, { default: false })
59
- .action(async (options: BuildOptions) => {
60
- await runAdd(options)
61
- })
62
-
63
- buddy.on('add:*', () => {
64
- console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
65
- process.exit(1)
66
- })
67
- }
68
-
69
- function hasNoOptions(options: AddOptions) {
70
- return !options.all && !options.table && !options.calendar
71
- }
@@ -1,299 +0,0 @@
1
- import type { BuildOptions, CLI } from '@stacksjs/types'
2
- import process from 'node:process'
3
- import { runAction } from '@stacksjs/actions'
4
- import { intro, log, outro, prompts } from '@stacksjs/cli'
5
- import { Action } from '@stacksjs/enums'
6
- import { ExitCode } from '@stacksjs/types'
7
-
8
- export function build(buddy: CLI): void {
9
- const descriptions = {
10
- build: 'Build any of your libraries (packages) for production use',
11
- components: 'Build your component library',
12
- vueComponents: 'Build your Vue component library',
13
- webComponents: 'Build your framework agnostic web component library',
14
- elements: 'An alias to the -w flag',
15
- buddy: 'Build the Buddy binary',
16
- functions: 'Build your function library',
17
- desktop: 'Build the Desktop Application',
18
- pages: 'Build your frontend',
19
- docs: 'Build your documentation',
20
- framework: 'Build Stacks framework',
21
- cli: 'Automagically build the CLI',
22
- server: 'Build the Stacks cloud server (Docker image)',
23
- select: 'What are you trying to build?',
24
- project: 'Target a specific project',
25
- verbose: 'Enable verbose output',
26
- }
27
-
28
- buddy
29
- .command('build [type]', descriptions.build)
30
- .option('-c, --components', descriptions.components)
31
- .option('-v, --vue-components', descriptions.vueComponents) // also automatically built via the -c flag
32
- .option('-w, --web-components', descriptions.webComponents) // also automatically built via the -c flag
33
- .option('-e, --elements', descriptions.elements) // alias for --web-components
34
- .option('-f, --functions', descriptions.functions)
35
- .option('-p, --views', descriptions.pages)
36
- .option('--pages', descriptions.pages) // alias for --views
37
- .option('-d, --docs', descriptions.docs)
38
- .option('-b, --buddy', descriptions.buddy, { default: false })
39
- .option('-s, --stacks', descriptions.framework, { default: false })
40
- .option('--project [project]', descriptions.project, { default: false })
41
- .option('--server', descriptions.server, { default: false })
42
- .option('--verbose', descriptions.verbose, { default: false })
43
- .action(async (server: string | undefined, options: BuildOptions) => {
44
- log.debug('Running `buddy build` ...', options)
45
-
46
- switch (server) {
47
- case 'components':
48
- options.components = true
49
- break
50
- case 'vue':
51
- options.vueComponents = true
52
- break
53
- case 'web-components':
54
- options.webComponents = true
55
- break
56
- case 'functions':
57
- options.functions = true
58
- break
59
- case 'views':
60
- options.views = true
61
- break
62
- case 'docs':
63
- options.docs = true
64
- break
65
- case 'buddy':
66
- options.buddy = true
67
- break
68
- case 'cli':
69
- options.buddy = true
70
- break
71
- case 'stacks':
72
- options.stacks = true
73
- break
74
- case 'server':
75
- options.server = true
76
- break
77
- default:
78
- break
79
- }
80
-
81
- console.log('server', server, options)
82
-
83
- // TODO: uncomment this when prompt is available
84
- if (hasNoOptions(options)) {
85
- console.log('has no')
86
- const answers = await prompts({
87
- type: 'multiselect',
88
- name: 'build',
89
- message: descriptions.select,
90
- choices: [
91
- { title: 'Components', value: 'components' },
92
- // { label: 'Vue Components', value: 'vue-components' },
93
- { title: 'Web Components', value: 'web-components' },
94
- { title: 'Functions', value: 'functions' },
95
- { title: 'Views', value: 'views' },
96
- { title: 'Documentation', value: 'docs' },
97
- ],
98
- })
99
-
100
- console.log('answers', answers)
101
- if (answers !== null)
102
- process.exit(ExitCode.InvalidArgument)
103
- }
104
- else {
105
- console.log('has op')
106
- }
107
-
108
- if (options.docs)
109
- await runAction(Action.BuildDocs)
110
- if (options.components)
111
- await runAction(Action.BuildComponentLibs)
112
- if (options.vueComponents)
113
- await runAction(Action.BuildVueComponentLib)
114
- if (options.webComponents)
115
- await runAction(Action.BuildWebComponentLib)
116
- if (options.functions)
117
- await runAction(Action.BuildFunctionLib)
118
- if (options.views)
119
- await runAction(Action.BuildViews)
120
- if (options.stacks)
121
- await runAction(Action.BuildStacks)
122
- if (options.buddy)
123
- await runAction(Action.BuildCli)
124
- if (options.server)
125
- await runAction(Action.BuildServer)
126
- process.exit(ExitCode.Success)
127
- })
128
-
129
- buddy
130
- .command('build:components', 'Automagically build component libraries for production use & npm/CDN distribution')
131
- .alias('prod:components')
132
- .option('-c, --components', descriptions.components, { default: true })
133
- .option('-p, --project [project]', descriptions.project, { default: false })
134
- .option('--verbose', descriptions.verbose, { default: false })
135
- .action(async (options: BuildOptions) => {
136
- log.debug('Running `buddy build:components` ...', options)
137
- await runAction(Action.BuildComponentLibs, options)
138
- })
139
-
140
- buddy
141
- .command('build:cli', descriptions.cli)
142
- .alias('prod:cli')
143
- .option('-b, --buddy', descriptions.buddy, { default: true })
144
- .option('-p, --project [project]', descriptions.project, { default: false })
145
- .option('--verbose', descriptions.verbose, { default: false })
146
- .action(async (options: BuildOptions) => {
147
- log.debug('Running `buddy build:cli` ...', options)
148
- await runAction(Action.BuildCli, options)
149
- })
150
-
151
- buddy
152
- .command('build:server', descriptions.server)
153
- .alias('prod:server')
154
- .alias('build:docker')
155
- .option('-p, --project [project]', descriptions.project, { default: false })
156
- .option('--verbose', descriptions.verbose, { default: false })
157
- .action(async (options: BuildOptions) => {
158
- log.debug('Running `buddy build:server` ...', options)
159
- await runAction(Action.BuildServer, options)
160
- })
161
-
162
- buddy
163
- .command('build:functions', 'Automagically build function library for npm/CDN distribution')
164
- .option('-f, --functions', descriptions.functions, { default: true })
165
- .option('-p, --project [project]', descriptions.project, { default: false })
166
- .option('--verbose', descriptions.verbose, { default: false })
167
- .action(async (options: BuildOptions) => {
168
- log.debug('Running `buddy `build:functions` ...', options)
169
- await runAction(Action.BuildFunctionLib, options)
170
- })
171
-
172
- buddy
173
- .command('build:vue-components', 'Automagically build Vue component library for npm/CDN distribution')
174
- .alias('build:vue')
175
- .alias('prod:vue-components')
176
- .alias('prod:vue')
177
- .option('-v, --vue-components', descriptions.vueComponents, {
178
- default: true,
179
- })
180
- .option('-p, --project [project]', descriptions.project, { default: false })
181
- .option('--verbose', descriptions.verbose, { default: false })
182
- .alias('build:vue')
183
- .action(async (options: BuildOptions) => {
184
- log.debug('Running `buddy build:vue-components` ...', options)
185
- await runAction(Action.BuildVueComponentLib, options)
186
- })
187
-
188
- buddy
189
- .command('build:web-components', 'Automagically build Web Component library for npm/CDN distribution')
190
- .alias('build:wc')
191
- .alias('prod:web-components')
192
- .alias('prod:wc')
193
- .option('-w, --web-components', descriptions.webComponents, {
194
- default: true,
195
- })
196
- .option('-p, --project [project]', descriptions.project, { default: false })
197
- .option('--verbose', descriptions.verbose, { default: false })
198
- .action(async (options: BuildOptions) => {
199
- log.debug('Running `buddy build:web-components` ...', options)
200
- await runAction(Action.BuildWebComponentLib, options)
201
- })
202
-
203
- buddy
204
- .command('build:docs', 'Automagically build your documentation site.')
205
- .alias('prod:docs')
206
- .alias('build:documentation')
207
- .alias('prod:documentation')
208
- .option('-d, --docs', descriptions.docs, { default: true })
209
- .option('-p, --project [project]', descriptions.project, { default: false })
210
- .option('--verbose', descriptions.verbose, { default: false })
211
- .action(async (options: BuildOptions) => {
212
- log.debug('Running `buddy build:docs` ...', options)
213
- await runAction(Action.BuildDocs, options)
214
- })
215
-
216
- buddy
217
- .command('build:core', 'Automagically build the Stacks core.')
218
- .option('-p, --project [project]', descriptions.project, { default: false })
219
- .option('--verbose', descriptions.verbose, { default: false })
220
- .action(async (options: BuildOptions) => {
221
- log.debug('Running `buddy build:core` ...', options)
222
-
223
- const startTime = await intro('buddy build:core')
224
- const result = await runAction(Action.BuildCore, options)
225
-
226
- if (result.isErr()) {
227
- log.error('Failed to build the Stacks core.', result.error)
228
- process.exit()
229
- }
230
-
231
- await outro('Core packages built successfully', {
232
- startTime,
233
- useSeconds: true,
234
- })
235
- })
236
-
237
- buddy
238
- .command('build:desktop', descriptions.desktop)
239
- .alias('prod:desktop')
240
- .option('-p, --project [project]', descriptions.project, { default: false })
241
- .option('--verbose', descriptions.verbose, { default: false })
242
- .action(async (options: BuildOptions) => {
243
- log.debug('Running `buddy build:desktop` ...', options)
244
-
245
- const perf = await intro('buddy build:desktop')
246
- const result = await runAction(Action.BuildDesktop, options)
247
-
248
- if (result.isErr()) {
249
- await outro(
250
- 'While running the build:desktop command, there was an issue',
251
- { startTime: perf, useSeconds: true },
252
- result.error,
253
- )
254
- process.exit()
255
- }
256
-
257
- console.log('')
258
- await outro('Exited', { startTime: perf, useSeconds: true })
259
- process.exit(ExitCode.Success)
260
- })
261
-
262
- buddy
263
- .command('build:stacks', 'Build the Stacks framework.')
264
- .option('-s, --stacks', descriptions.framework, { default: true })
265
- .option('-p, --project [project]', descriptions.project, { default: false })
266
- .option('--verbose', descriptions.verbose, { default: false })
267
- .action(async (options: BuildOptions) => {
268
- log.debug('Running `buddy build:stacks` ...', options)
269
-
270
- const startTime = await intro('buddy build:stacks')
271
- const result = await runAction(Action.BuildStacks, options)
272
-
273
- if (result.isErr()) {
274
- log.error('Failed to build Stacks.', result.error)
275
- process.exit()
276
- }
277
-
278
- await outro('Stacks built successfully', { startTime, useSeconds: true })
279
- })
280
-
281
- buddy.on('build:*', () => {
282
- console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
283
- process.exit(1)
284
- })
285
- }
286
-
287
- function hasNoOptions(options: BuildOptions) {
288
- return (
289
- !options.components
290
- && !options.vueComponents
291
- && !options.webComponents
292
- && !options.elements
293
- && !options.functions
294
- && !options.views
295
- && !options.docs
296
- && !options.stacks
297
- && !options.buddy
298
- )
299
- }
@@ -1,52 +0,0 @@
1
- import type { CLI, FreshOptions } from '@stacksjs/types'
2
- import process from 'node:process'
3
- import { runAction } from '@stacksjs/actions'
4
- import { intro, log, outro } from '@stacksjs/cli'
5
- import { Action } from '@stacksjs/enums'
6
-
7
- export function changelog(buddy: CLI): void {
8
- const descriptions = {
9
- changelog: 'Create a CHANGELOG.md file',
10
- quiet: 'Minimal output',
11
- dryRun: 'Do not write the file, just output the changes',
12
- project: 'Target a specific project',
13
- verbose: 'Enable verbose output',
14
- }
15
-
16
- // console.log('changelog', descriptions.changelog)
17
-
18
- buddy
19
- .command('changelog', descriptions.changelog)
20
- .option('-q, --quiet', descriptions.quiet, { default: false })
21
- .option('-d, --dry-run', descriptions.dryRun, { default: false })
22
- .option('-p, --project [project]', descriptions.project, { default: false })
23
- .option('--verbose', descriptions.verbose, { default: false })
24
- .action(async (options: FreshOptions) => {
25
- log.debug('Running `buddy changelog` ...', options)
26
-
27
- const perf = await intro('buddy changelog')
28
- const result = await runAction(Action.Changelog, options)
29
-
30
- if (result.isErr()) {
31
- await outro(
32
- 'While running the changelog command, there was an issue',
33
- { ...options, startTime: perf, useSeconds: true },
34
- result.error,
35
- )
36
- process.exit()
37
- }
38
-
39
- await outro('Generated CHANGELOG.md', {
40
- ...options,
41
- startTime: perf,
42
- useSeconds: true,
43
- type: 'success',
44
- })
45
- })
46
-
47
- buddy.on('changelog:*', () => {
48
- console.log('Invalid command: %s', buddy.args.join(' '))
49
- console.log('See --help for a list of available commands.')
50
- process.exit(1)
51
- })
52
- }
@@ -1,46 +0,0 @@
1
- import type { CleanOptions, CLI } from '@stacksjs/types'
2
- import process from 'node:process'
3
- import { runAction } from '@stacksjs/actions'
4
- import { intro, log, outro } from '@stacksjs/cli'
5
- import { Action } from '@stacksjs/enums'
6
- import { ExitCode } from '@stacksjs/types'
7
-
8
- export function clean(buddy: CLI): void {
9
- const descriptions = {
10
- clean: 'Removes all node_modules & lock files',
11
- project: 'Target a specific project',
12
- verbose: 'Enable verbose output',
13
- }
14
-
15
- buddy
16
- .command('clean', descriptions.clean)
17
- .option('-p, --project [project]', descriptions.project, { default: false })
18
- .option('--verbose', descriptions.verbose, { default: false })
19
- .action(async (options: CleanOptions) => {
20
- log.debug('Running `buddy clean` ...', options)
21
-
22
- const perf = await intro('buddy clean')
23
- const result = await runAction(Action.Clean, options)
24
-
25
- if (result.isErr()) {
26
- await outro(
27
- 'While running the clean command, there was an issue',
28
- { startTime: perf, useSeconds: true },
29
- result.error,
30
- )
31
- process.exit(ExitCode.FatalError)
32
- }
33
-
34
- await outro('Cleaned up', {
35
- startTime: perf,
36
- useSeconds: true,
37
- message: 'Cleaned up',
38
- })
39
- process.exit(ExitCode.Success)
40
- })
41
-
42
- buddy.on('clean:*', () => {
43
- console.error('Invalid command: %s\nSee --help for a list of available commands.', buddy.args.join(' '))
44
- process.exit(1)
45
- })
46
- }