@stacksjs/buddy 0.66.0 → 0.68.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.d.ts +4 -0
- package/dist/build.d.ts +4 -0
- package/dist/changelog.d.ts +3 -0
- package/dist/chunk-06g79v9j.js +2 -0
- package/dist/chunk-08bm2xax.js +2 -0
- package/dist/chunk-0enrsn65.js +978 -0
- package/dist/chunk-0m218zhk.js +2 -0
- package/dist/chunk-0q0jn0kk.js +6 -0
- package/dist/chunk-0yyhz107.js +2 -0
- package/dist/chunk-11vhe2za.js +2 -0
- package/dist/chunk-13143jmy.js +3 -0
- package/dist/chunk-1agj4qty.js +2 -0
- package/dist/chunk-1c4yywmn.js +9 -0
- package/dist/chunk-1e2f0z80.js +2 -0
- package/dist/chunk-1v13dkfw.js +2 -0
- package/dist/chunk-20e0mpcw.js +9 -0
- package/dist/chunk-25nxsybw.js +2 -0
- package/dist/chunk-27ksm11g.js +2 -0
- package/dist/chunk-2mhj5ght.js +2 -0
- package/dist/chunk-2wrs9p57.js +1 -0
- package/dist/chunk-2yj4j69j.js +2 -0
- package/dist/chunk-2ymn50ck.js +2 -0
- package/dist/chunk-3vjfkr7v.js +978 -0
- package/dist/{chunk-3zx3yk1m.js → chunk-3wpw5xgd.js} +1 -4
- package/dist/chunk-3y0gapf6.js +2 -0
- package/dist/chunk-4rb5r88h.js +978 -0
- package/dist/chunk-4wb68jfr.js +2 -0
- package/dist/chunk-5ewcj9vd.js +2 -0
- package/dist/chunk-5fm9mfqs.js +2 -0
- package/dist/chunk-5jhkn5by.js +2 -0
- package/dist/chunk-5m9xts4v.js +2 -0
- package/dist/chunk-6sqy7049.js +2 -0
- package/dist/chunk-6yazdvb4.js +2 -0
- package/dist/chunk-746p83dw.js +2 -0
- package/dist/chunk-76g7tr80.js +2 -0
- package/dist/chunk-7fz1p8p3.js +10 -0
- package/dist/chunk-814adsn3.js +2 -0
- package/dist/chunk-831wk0b3.js +2 -0
- package/dist/chunk-833tanrb.js +2 -0
- package/dist/chunk-8cx90pvv.js +2 -0
- package/dist/chunk-8gx9at51.js +1 -0
- package/dist/chunk-91pnyybg.js +9 -0
- package/dist/chunk-99syj1p0.js +2 -0
- package/dist/chunk-9bxh78vd.js +5 -0
- package/dist/chunk-9jaqey2q.js +2 -0
- package/dist/chunk-9tyaew40.js +2 -0
- package/dist/chunk-9zcyq5gh.js +2 -0
- package/dist/chunk-a4g1e1n0.js +2 -0
- package/dist/chunk-a6g2jk1y.js +2 -0
- package/dist/chunk-aaqd43t5.js +2 -0
- package/dist/chunk-adswb3gq.js +2 -0
- package/dist/chunk-atnw2cq3.js +2 -0
- package/dist/chunk-avdharmq.js +2 -0
- package/dist/chunk-b13gbfg3.js +2 -0
- package/dist/chunk-b3wr7cpk.js +2 -0
- package/dist/chunk-bngyck4v.js +2 -0
- package/dist/chunk-brb5zthb.js +1 -0
- package/dist/chunk-bx2vf8g7.js +5 -0
- package/dist/chunk-c343n0yt.js +2 -0
- package/dist/chunk-cdwpqzrw.js +2 -0
- package/dist/chunk-cm7bwdk9.js +2 -0
- package/dist/chunk-cs5k02gt.js +1 -0
- package/dist/chunk-cv8f2v27.js +2 -0
- package/dist/chunk-d2dbhn2h.js +2 -0
- package/dist/chunk-d3awsfqm.js +9 -0
- package/dist/chunk-d9q17hb8.js +2 -0
- package/dist/chunk-dw62d69f.js +2 -0
- package/dist/chunk-e8p8v7ca.js +978 -0
- package/dist/chunk-ehhrhkwe.js +9 -0
- package/dist/chunk-enhf12a1.js +2 -0
- package/dist/chunk-f0ksrase.js +8 -0
- package/dist/chunk-f2d9w3nr.js +2 -0
- package/dist/chunk-f3y73e4b.js +6 -0
- package/dist/chunk-fe3xb8z9.js +2 -0
- package/dist/chunk-fg5gh4dn.js +2 -0
- package/dist/chunk-fh4rw8kr.js +5 -0
- package/dist/chunk-fxsv4p5c.js +8 -0
- package/dist/chunk-gg80s18j.js +2 -0
- package/dist/chunk-h5saw32v.js +2 -0
- package/dist/chunk-ha75r57f.js +8 -0
- package/dist/chunk-hgrs6wcy.js +2 -0
- package/dist/chunk-hrsat16n.js +8 -0
- package/dist/chunk-hxy5t7tm.js +10 -0
- package/dist/chunk-hzfqtj82.js +2 -0
- package/dist/chunk-j2n86dsz.js +2 -0
- package/dist/chunk-jg68fsnk.js +10 -0
- package/dist/chunk-jhvjhf1j.js +2 -0
- package/dist/chunk-jr4naxsv.js +2 -0
- package/dist/chunk-jtax0mpm.js +2 -0
- package/dist/chunk-k59kbbvm.js +2 -0
- package/dist/chunk-kanz993c.js +2 -0
- package/dist/chunk-kg9abatp.js +2 -0
- package/dist/chunk-kvghsjg7.js +5 -0
- package/dist/chunk-ky8p46ae.js +5 -0
- package/dist/chunk-kzm498bh.js +2 -0
- package/dist/chunk-m4gwjnfh.js +6 -0
- package/dist/chunk-msv6dcc2.js +2 -0
- package/dist/chunk-mxdajhb4.js +10 -0
- package/dist/chunk-mxzjn2gs.js +978 -0
- package/dist/chunk-n1bqkqk7.js +10 -0
- package/dist/chunk-njtyervf.js +1 -0
- package/dist/chunk-nx1598yr.js +2 -0
- package/dist/chunk-p18kqenr.js +1 -0
- package/dist/chunk-p23aswbf.js +2 -0
- package/dist/chunk-p55ntqj0.js +2 -0
- package/dist/chunk-p5va3trj.js +2 -0
- package/dist/chunk-p88bsqtc.js +10 -0
- package/dist/chunk-p9z7f8c8.js +2 -0
- package/dist/chunk-ppkzf21q.js +8 -0
- package/dist/chunk-prqq5zw2.js +2 -0
- package/dist/chunk-pv6hp18q.js +10 -0
- package/dist/chunk-q9ycfthp.js +2 -0
- package/dist/chunk-qhcx6dmf.js +2 -0
- package/dist/chunk-qma4ysd8.js +9 -0
- package/dist/chunk-qqp394c2.js +2 -0
- package/dist/chunk-ra5sfgg4.js +2 -0
- package/dist/chunk-rfd43z7p.js +5 -0
- package/dist/chunk-s2n3hw0a.js +2 -0
- package/dist/chunk-sm7vvfqf.js +2 -0
- package/dist/chunk-sqbdav33.js +2 -0
- package/dist/chunk-sy4d4hnx.js +2 -0
- package/dist/chunk-t0b356bb.js +978 -0
- package/dist/chunk-t9wdnzz4.js +6 -0
- package/dist/chunk-v25g7h01.js +2 -0
- package/dist/chunk-v7zy7xda.js +1 -0
- package/dist/chunk-vg4vfkzk.js +6 -0
- package/dist/chunk-vgcre8jy.js +2 -0
- package/dist/chunk-vqyngnj0.js +9 -0
- package/dist/chunk-w17d2rbd.js +6 -0
- package/dist/chunk-x22v9kvb.js +2 -0
- package/dist/chunk-xacjs4ar.js +6 -0
- package/dist/chunk-xmdbxa8w.js +1 -0
- package/dist/chunk-xy6hjazn.js +978 -0
- package/dist/chunk-y0m35t3m.js +2 -0
- package/dist/chunk-y1tre8v8.js +8 -0
- package/dist/chunk-y50mc7dt.js +2 -0
- package/dist/chunk-y93ke5m6.js +2 -0
- package/dist/chunk-yktee4wv.js +1 -0
- package/dist/chunk-yvmyw2r2.js +2 -0
- package/dist/chunk-z1h35hsa.js +2 -0
- package/dist/chunk-z6xydw90.js +2 -0
- package/dist/chunk-zak32nab.js +2 -0
- package/dist/clean.d.ts +3 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.js +1 -4
- package/dist/cloud.d.ts +3 -0
- package/dist/commit.d.ts +3 -0
- package/dist/configure.d.ts +4 -0
- package/dist/create.d.ts +8 -0
- package/dist/custom-cli.d.ts +1 -1
- package/dist/deploy.d.ts +7 -0
- package/dist/{commands/dev.d.ts → dev.d.ts} +3 -1
- package/dist/dns.d.ts +18 -0
- package/dist/domains.d.ts +3 -0
- package/dist/fresh.d.ts +3 -0
- package/dist/generate.d.ts +3 -0
- package/dist/http.d.ts +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -4
- package/dist/install.d.ts +3 -0
- package/dist/key.d.ts +3 -0
- package/dist/lint.d.ts +3 -0
- package/dist/list.d.ts +3 -0
- package/dist/make.d.ts +1 -0
- package/dist/migrate.d.ts +3 -0
- package/dist/outdated.d.ts +3 -0
- package/dist/ports.d.ts +7 -0
- package/dist/prepublish.d.ts +3 -0
- package/dist/projects.d.ts +3 -0
- package/dist/release.d.ts +9 -0
- package/dist/route.d.ts +3 -0
- package/dist/saas.d.ts +3 -0
- package/dist/seed.d.ts +3 -0
- package/dist/setup.d.ts +8 -0
- package/dist/stacks +0 -0
- package/dist/test.d.ts +3 -0
- package/dist/tinker.d.ts +3 -0
- package/dist/types.d.ts +3 -0
- package/dist/upgrade.d.ts +4 -0
- package/dist/version.d.ts +3 -0
- package/package.json +48 -49
- package/dist/chunk-3cfvbq6w.js +0 -5
- package/dist/chunk-3cfvbq6w.js.map +0 -32
- package/dist/chunk-3v3h2zkp.js +0 -5
- package/dist/chunk-3v3h2zkp.js.map +0 -46
- package/dist/chunk-3zx3yk1m.js.map +0 -15
- package/dist/chunk-8a487snn.js +0 -5
- package/dist/chunk-8a487snn.js.map +0 -9
- package/dist/chunk-9kkf5maz.js +0 -5
- package/dist/chunk-9kkf5maz.js.map +0 -23
- package/dist/chunk-9qba8jdt.js +0 -12
- package/dist/chunk-9qba8jdt.js.map +0 -11
- package/dist/chunk-cvpb67bs.js +0 -5
- package/dist/chunk-cvpb67bs.js.map +0 -10
- package/dist/chunk-eqwfdbyk.js +0 -5
- package/dist/chunk-eqwfdbyk.js.map +0 -17
- package/dist/chunk-f41k7dpa.js +0 -5
- package/dist/chunk-f41k7dpa.js.map +0 -11
- package/dist/chunk-fx1zxxxa.js +0 -9
- package/dist/chunk-fx1zxxxa.js.map +0 -13
- package/dist/chunk-get5gzkc.js +0 -11
- package/dist/chunk-get5gzkc.js.map +0 -10
- package/dist/chunk-m43npkjw.js +0 -5
- package/dist/chunk-m43npkjw.js.map +0 -12
- package/dist/chunk-mrrgcavv.js +0 -831
- package/dist/chunk-mrrgcavv.js.map +0 -240
- package/dist/chunk-n5y0mrsg.js +0 -15
- package/dist/chunk-n5y0mrsg.js.map +0 -173
- package/dist/chunk-qebxvzqz.js +0 -5
- package/dist/chunk-qebxvzqz.js.map +0 -26
- package/dist/chunk-qj2v5psd.js +0 -5
- package/dist/chunk-qj2v5psd.js.map +0 -20
- package/dist/chunk-rh4brnzh.js +0 -5
- package/dist/chunk-rh4brnzh.js.map +0 -16
- package/dist/chunk-w2vwjv6k.js +0 -6
- package/dist/chunk-w2vwjv6k.js.map +0 -57
- package/dist/chunk-w81rbh65.js +0 -5
- package/dist/chunk-w81rbh65.js.map +0 -10
- package/dist/chunk-wayp5kn2.js +0 -5
- package/dist/chunk-wayp5kn2.js.map +0 -22
- package/dist/chunk-x5c5ngpb.js +0 -4
- package/dist/chunk-x5c5ngpb.js.map +0 -23
- package/dist/cli.js.map +0 -10
- package/dist/commands/add.d.ts +0 -2
- package/dist/commands/build.d.ts +0 -2
- package/dist/commands/changelog.d.ts +0 -2
- package/dist/commands/clean.d.ts +0 -2
- package/dist/commands/cloud.d.ts +0 -2
- package/dist/commands/commit.d.ts +0 -2
- package/dist/commands/configure.d.ts +0 -2
- package/dist/commands/create.d.ts +0 -2
- package/dist/commands/deploy.d.ts +0 -2
- package/dist/commands/dns.d.ts +0 -2
- package/dist/commands/domains.d.ts +0 -2
- package/dist/commands/fresh.d.ts +0 -2
- package/dist/commands/generate.d.ts +0 -2
- package/dist/commands/http.d.ts +0 -2
- package/dist/commands/index.d.ts +0 -33
- package/dist/commands/install.d.ts +0 -2
- package/dist/commands/key.d.ts +0 -2
- package/dist/commands/lint.d.ts +0 -2
- package/dist/commands/list.d.ts +0 -2
- package/dist/commands/make.d.ts +0 -2
- package/dist/commands/migrate.d.ts +0 -2
- package/dist/commands/outdated.d.ts +0 -2
- package/dist/commands/ports.d.ts +0 -2
- package/dist/commands/prepublish.d.ts +0 -2
- package/dist/commands/projects.d.ts +0 -2
- package/dist/commands/release.d.ts +0 -2
- package/dist/commands/route.d.ts +0 -2
- package/dist/commands/seed.d.ts +0 -2
- package/dist/commands/setup.d.ts +0 -4
- package/dist/commands/test.d.ts +0 -2
- package/dist/commands/tinker.d.ts +0 -2
- package/dist/commands/types.d.ts +0 -2
- package/dist/commands/upgrade.d.ts +0 -2
- package/dist/commands/version.d.ts +0 -2
- package/dist/index.js.map +0 -9
- package/src/cli.ts +0 -105
- package/src/commands/add.ts +0 -71
- package/src/commands/build.ts +0 -299
- package/src/commands/changelog.ts +0 -52
- package/src/commands/clean.ts +0 -46
- package/src/commands/cloud.ts +0 -553
- package/src/commands/commit.ts +0 -26
- package/src/commands/configure.ts +0 -84
- package/src/commands/create.ts +0 -143
- package/src/commands/deploy.ts +0 -194
- package/src/commands/dev.ts +0 -292
- package/src/commands/dns.ts +0 -86
- package/src/commands/domains.ts +0 -255
- package/src/commands/fresh.ts +0 -48
- package/src/commands/generate.ts +0 -202
- package/src/commands/http.ts +0 -57
- package/src/commands/index.ts +0 -33
- package/src/commands/install.ts +0 -30
- package/src/commands/key.ts +0 -36
- package/src/commands/lint.ts +0 -54
- package/src/commands/list.ts +0 -42
- package/src/commands/make.ts +0 -352
- package/src/commands/migrate.ts +0 -105
- package/src/commands/outdated.ts +0 -31
- package/src/commands/ports.ts +0 -188
- package/src/commands/prepublish.ts +0 -28
- package/src/commands/projects.ts +0 -54
- package/src/commands/release.ts +0 -47
- package/src/commands/route.ts +0 -39
- package/src/commands/seed.ts +0 -47
- package/src/commands/setup.ts +0 -145
- package/src/commands/test.ts +0 -214
- package/src/commands/tinker.ts +0 -42
- package/src/commands/types.ts +0 -35
- package/src/commands/upgrade.ts +0 -200
- package/src/commands/version.ts +0 -29
- package/src/custom-cli.ts +0 -35
- 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 ssoTokenFilepath = getSSOTokenFilepath(id);\n const ssoTokenText = await readFile(ssoTokenFilepath, \"utf8\");\n return JSON.parse(ssoTokenText);\n};\n"
|
|
19
|
-
],
|
|
20
|
-
"mappings": "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",
|
|
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,EAAG,CACpB,MAAM,EAAQ,EAAI,OAAO,EAQzB,GALI,EAAM,CAAK,EACX,EAAI,CAAK,EAGO,MAAM,EAA2B,EAEnD,EAAI,MAAM,wBAAwB,MAE/B,CACH,EAAI,KAAK,+BAA+B,EACxC,EAAI,KAAK,+BAA+B,EACxC,MAAM,EAAS,MAAM,EAAU,EAAO,WAAW,EAEjD,GAAI,EAAO,MAAM,EACf,EAAI,MAAM,wCAAyC,EAAO,KAAK,EAC/D,EAAQ,KAAK,EAIjB,AAAI,EAAM,CAAK,EACX,EAAU,CAAK,EACf,EAAM,CAAK,EACX,EAAM,CAAK,EACX,EAAO,CAAK,EACZ,EAAU,CAAK,EACf,EAAI,CAAK,EACT,EAAQ,CAAK,EACb,EAAO,CAAK,EACZ,EAAI,CAAK,EACT,EAAM,CAAK,EACX,EAAS,CAAK,EACd,EAAM,CAAK,EACX,EAAS,CAAK,EACd,EAAK,CAAK,EACV,EAAQ,CAAK,EACb,EAAK,CAAK,EACV,EAAK,CAAK,EACV,EAAK,CAAK,EACV,EAAQ,CAAK,EACb,EAAS,CAAK,EACd,EAAQ,CAAK,EACb,EAAM,CAAK,EACX,EAAK,CAAK,EACV,EAAM,CAAK,EACX,EAAK,CAAK,EACV,EAAO,CAAK,EACZ,EAAQ,CAAK,EACb,EAAW,CAAK,EAChB,EAAQ,CAAK,EAGjB,MAAM,EAAe,CAAK,EAE1B,EAAM,KAAK,EACX,EAAM,MAAM,EAKd,eAAe,CAAc,CAAC,EAAY,CAExC,MAAM,EAAc,EAAE,QAAQ,UAAU,EAClC,EAAe,EAAG,YAAY,CAAW,EAAE,OAAO,CAAC,IAAiB,EAAK,SAAS,KAAK,CAAC,EAE9F,QAAW,KAAQ,EAAc,CAE/B,MAAM,EAAgB,MAAa,OADf,GAAG,KAAe,KAItC,UAAW,EAAc,UAAY,WACnC,EAAc,QAAQ,CAAK,MACxB,SAAQ,MAAM,yCAAyC,cAAkB,EAAc,OAAO,EAGrG,MAAM,EAAiB,MAAa,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/commands/add.d.ts
DELETED
package/dist/commands/build.d.ts
DELETED
package/dist/commands/clean.d.ts
DELETED
package/dist/commands/cloud.d.ts
DELETED
package/dist/commands/dns.d.ts
DELETED
package/dist/commands/fresh.d.ts
DELETED
package/dist/commands/http.d.ts
DELETED
package/dist/commands/index.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export * from "./build";
|
|
2
|
-
export * from "./changelog";
|
|
3
|
-
export * from "./clean";
|
|
4
|
-
export * from "./cloud";
|
|
5
|
-
export * from "./commit";
|
|
6
|
-
export * from "./configure";
|
|
7
|
-
export * from "./create";
|
|
8
|
-
export * from "./deploy";
|
|
9
|
-
export * from "./dev";
|
|
10
|
-
export * from "./dns";
|
|
11
|
-
export * from "./domains";
|
|
12
|
-
export * from "./fresh";
|
|
13
|
-
export * from "./generate";
|
|
14
|
-
export * from "./http";
|
|
15
|
-
export * from "./install";
|
|
16
|
-
export * from "./key";
|
|
17
|
-
export * from "./lint";
|
|
18
|
-
export * from "./list";
|
|
19
|
-
export * from "./make";
|
|
20
|
-
export * from "./migrate";
|
|
21
|
-
export * from "./outdated";
|
|
22
|
-
export * from "./ports";
|
|
23
|
-
export * from "./prepublish";
|
|
24
|
-
export * from "./projects";
|
|
25
|
-
export * from "./release";
|
|
26
|
-
export * from "./route";
|
|
27
|
-
export * from "./seed";
|
|
28
|
-
export * from "./setup";
|
|
29
|
-
export * from "./test";
|
|
30
|
-
export * from "./tinker";
|
|
31
|
-
export * from "./types";
|
|
32
|
-
export * from "./upgrade";
|
|
33
|
-
export * from "./version";
|
package/dist/commands/key.d.ts
DELETED
package/dist/commands/lint.d.ts
DELETED
package/dist/commands/list.d.ts
DELETED
package/dist/commands/make.d.ts
DELETED
package/dist/commands/ports.d.ts
DELETED
package/dist/commands/route.d.ts
DELETED
package/dist/commands/seed.d.ts
DELETED
package/dist/commands/setup.d.ts
DELETED
package/dist/commands/test.d.ts
DELETED
package/dist/commands/types.d.ts
DELETED
package/dist/index.js.map
DELETED
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
|
-
}
|
package/src/commands/add.ts
DELETED
|
@@ -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
|
-
}
|