@prisma/composer-cli 0.39.0-dev.1 → 0.39.0-dev.11
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/app-converge-bS1l9jIf-B1FOgxBQ.mjs +88 -0
- package/dist/app-converge-bS1l9jIf-B1FOgxBQ.mjs.map +1 -0
- package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs +254 -0
- package/dist/composer-config-QKdY85G--CEXrb2Uc.mjs.map +1 -0
- package/dist/{validate-environment-D1BTCkTs-C5m4rL6t.mjs → deploy-Br1yvLe3.mjs} +335 -1091
- package/dist/deploy-Br1yvLe3.mjs.map +1 -0
- package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs +256 -0
- package/dist/dev-converge-messages-DML4rTz7-B6uxtpZG.mjs.map +1 -0
- package/dist/dev-converge-worker.d.mts +1 -0
- package/dist/dev-converge-worker.mjs +143 -0
- package/dist/dev-converge-worker.mjs.map +1 -0
- package/dist/{dev-current-wD5YDLjA-CFI8XTAK.mjs → dev-current-lAlj53eX-DvAHNZFo.mjs} +12 -18
- package/dist/dev-current-lAlj53eX-DvAHNZFo.mjs.map +1 -0
- package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs +43 -0
- package/dist/dev-environment-name-6eEr5PW8-CCY7WNWz.mjs.map +1 -0
- package/dist/{dist-D0rWRHos.mjs → dist-C0OGaDnj.mjs} +4 -3
- package/dist/{dist-D0rWRHos.mjs.map → dist-C0OGaDnj.mjs.map} +1 -1
- package/dist/errors-CVYwN2km.mjs +93 -0
- package/dist/errors-CVYwN2km.mjs.map +1 -0
- package/dist/{execute-deploy-destroy-DOzo2Psp-2iWcFbD9.mjs → execute-deploy-destroy-DN16ETAk-CzORriUO.mjs} +374 -141
- package/dist/execute-deploy-destroy-DN16ETAk-CzORriUO.mjs.map +1 -0
- package/dist/{execute-dev-BIyOI3Ys-DGpTd9rP.mjs → execute-dev-DnVmNpc1-BzK9Qns_.mjs} +444 -128
- package/dist/execute-dev-DnVmNpc1-BzK9Qns_.mjs.map +1 -0
- package/dist/{execute-dev-current-CKOzjWuO-DTOVqZzZ.mjs → execute-dev-current-CZdmxVQ4-DxDflvNG.mjs} +9 -6
- package/dist/{execute-dev-current-CKOzjWuO-DTOVqZzZ.mjs.map → execute-dev-current-CZdmxVQ4-DxDflvNG.mjs.map} +1 -1
- package/dist/{redaction-Bf8FvTFH-XGchRgrK.d.mts → family-DfwviKFj-CS1L-EvS.d.mts} +439 -204
- package/dist/family-DfwviKFj-CS1L-EvS.d.mts.map +1 -0
- package/dist/family.d.mts +1 -1
- package/dist/family.mjs +259 -269
- package/dist/family.mjs.map +1 -1
- package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs +58 -0
- package/dist/internal-error-Dfur7Zqt-B8J8e7ac.mjs.map +1 -0
- package/dist/{list-deployed-BFJJxt_W.mjs → list-deployed-D6vTzpWu.mjs} +6 -5
- package/dist/list-deployed-D6vTzpWu.mjs.map +1 -0
- package/dist/local-target-CZzICh5R.mjs +34 -0
- package/dist/local-target-CZzICh5R.mjs.map +1 -0
- package/dist/{preflight-transport-DmmtoFPH-CZ0o7QPf.mjs → preflight-transport-2d6iIchu-ArIJUY1L.mjs} +7 -28
- package/dist/preflight-transport-2d6iIchu-ArIJUY1L.mjs.map +1 -0
- package/dist/{redaction-DXung4ip-Co_fv4Zl.mjs → redaction-DY6eDC12-BrK1aSN5.mjs} +33 -267
- package/dist/redaction-DY6eDC12-BrK1aSN5.mjs.map +1 -0
- package/dist/result-CttmabB6.mjs +91 -0
- package/dist/result-CttmabB6.mjs.map +1 -0
- package/dist/rolldown-runtime-C7HZzL1F.mjs +26 -0
- package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs +287 -0
- package/dist/steps-BZXNqW6U-BM2Aa8Bp.mjs.map +1 -0
- package/dist/testing.d.mts +4 -49
- package/dist/testing.d.mts.map +1 -1
- package/dist/testing.mjs +2 -75
- package/dist/testing.mjs.map +1 -1
- package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs +983 -0
- package/dist/validate-environment-DCZiNSlR-idVge-kq.mjs.map +1 -0
- package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs +15 -0
- package/dist/value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs.map +1 -0
- package/package.json +9 -9
- package/src/exports/dev-converge-worker.ts +2 -0
- package/src/exports/testing.ts +1 -4
- package/dist/app-configuration-file-CeJvBAti-DA4EKwFq.mjs +0 -140
- package/dist/app-configuration-file-CeJvBAti-DA4EKwFq.mjs.map +0 -1
- package/dist/dev-current-wD5YDLjA-CFI8XTAK.mjs.map +0 -1
- package/dist/dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs +0 -71
- package/dist/dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs.map +0 -1
- package/dist/execute-deploy-destroy-DOzo2Psp-2iWcFbD9.mjs.map +0 -1
- package/dist/execute-dev-BIyOI3Ys-DGpTd9rP.mjs.map +0 -1
- package/dist/generate-dev-stack-BV_n-X9n-DM5faH3-.mjs +0 -100
- package/dist/generate-dev-stack-BV_n-X9n-DM5faH3-.mjs.map +0 -1
- package/dist/list-deployed-BFJJxt_W.mjs.map +0 -1
- package/dist/preflight-transport-DmmtoFPH-CZ0o7QPf.mjs.map +0 -1
- package/dist/redaction-Bf8FvTFH-XGchRgrK.d.mts.map +0 -1
- package/dist/redaction-DXung4ip-Co_fv4Zl.mjs.map +0 -1
- package/dist/result-sR7PBi61.mjs +0 -229
- package/dist/result-sR7PBi61.mjs.map +0 -1
- package/dist/run-alchemy-CRLAyOtt-CwFLe4Zg.mjs +0 -236
- package/dist/run-alchemy-CRLAyOtt-CwFLe4Zg.mjs.map +0 -1
- package/dist/validate-environment-D1BTCkTs-C5m4rL6t.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-environment-DCZiNSlR-idVge-kq.mjs","names":["fs","path","fs"],"sources":["../../../../node_modules/dotenv-flow/node_modules/dotenv/package.json","../../../../node_modules/dotenv-flow/node_modules/dotenv/lib/main.js","../../../../node_modules/dotenv-flow/package.json","../../../../node_modules/dotenv-flow/lib/dotenv-flow.js","../../../0-framework/3-tooling/cli/dist/config-adapters-DG-uhGfv.mjs","../../../0-framework/3-tooling/assemble/dist/index.mjs","../../../0-framework/3-tooling/cli/dist/validate-environment-DCZiNSlR.mjs"],"sourcesContent":["","const fs = require('fs')\nconst path = require('path')\nconst os = require('os')\nconst crypto = require('crypto')\nconst packageJson = require('../package.json')\n\nconst version = packageJson.version\n\nconst LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg\n\n// Parse src into an Object\nfunction parse (src) {\n const obj = {}\n\n // Convert buffer to string\n let lines = src.toString()\n\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/mg, '\\n')\n\n let match\n while ((match = LINE.exec(lines)) != null) {\n const key = match[1]\n\n // Default undefined or null to empty string\n let value = (match[2] || '')\n\n // Remove whitespace\n value = value.trim()\n\n // Check if double quoted\n const maybeQuote = value[0]\n\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/mg, '$2')\n\n // Expand newlines if double quoted\n if (maybeQuote === '\"') {\n value = value.replace(/\\\\n/g, '\\n')\n value = value.replace(/\\\\r/g, '\\r')\n }\n\n // Add to object\n obj[key] = value\n }\n\n return obj\n}\n\nfunction _parseVault (options) {\n options = options || {}\n\n const vaultPath = _vaultPath(options)\n options.path = vaultPath // parse .env.vault\n const result = DotenvModule.configDotenv(options)\n if (!result.parsed) {\n const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)\n err.code = 'MISSING_DATA'\n throw err\n }\n\n // handle scenario for comma separated keys - for use with key rotation\n // example: DOTENV_KEY=\"dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod\"\n const keys = _dotenvKey(options).split(',')\n const length = keys.length\n\n let decrypted\n for (let i = 0; i < length; i++) {\n try {\n // Get full key\n const key = keys[i].trim()\n\n // Get instructions for decrypt\n const attrs = _instructions(result, key)\n\n // Decrypt\n decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)\n\n break\n } catch (error) {\n // last key\n if (i + 1 >= length) {\n throw error\n }\n // try next key\n }\n }\n\n // Parse decrypted .env string\n return DotenvModule.parse(decrypted)\n}\n\nfunction _warn (message) {\n console.log(`[dotenv@${version}][WARN] ${message}`)\n}\n\nfunction _debug (message) {\n console.log(`[dotenv@${version}][DEBUG] ${message}`)\n}\n\nfunction _log (message) {\n console.log(`[dotenv@${version}] ${message}`)\n}\n\nfunction _dotenvKey (options) {\n // prioritize developer directly setting options.DOTENV_KEY\n if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {\n return options.DOTENV_KEY\n }\n\n // secondary infra already contains a DOTENV_KEY environment variable\n if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {\n return process.env.DOTENV_KEY\n }\n\n // fallback to empty string\n return ''\n}\n\nfunction _instructions (result, dotenvKey) {\n // Parse DOTENV_KEY. Format is a URI\n let uri\n try {\n uri = new URL(dotenvKey)\n } catch (error) {\n if (error.code === 'ERR_INVALID_URL') {\n const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n throw error\n }\n\n // Get decrypt key\n const key = uri.password\n if (!key) {\n const err = new Error('INVALID_DOTENV_KEY: Missing key part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get environment\n const environment = uri.searchParams.get('environment')\n if (!environment) {\n const err = new Error('INVALID_DOTENV_KEY: Missing environment part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get ciphertext payload\n const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`\n const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION\n if (!ciphertext) {\n const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)\n err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'\n throw err\n }\n\n return { ciphertext, key }\n}\n\nfunction _vaultPath (options) {\n let possibleVaultPath = null\n\n if (options && options.path && options.path.length > 0) {\n if (Array.isArray(options.path)) {\n for (const filepath of options.path) {\n if (fs.existsSync(filepath)) {\n possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`\n }\n }\n } else {\n possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`\n }\n } else {\n possibleVaultPath = path.resolve(process.cwd(), '.env.vault')\n }\n\n if (fs.existsSync(possibleVaultPath)) {\n return possibleVaultPath\n }\n\n return null\n}\n\nfunction _resolveHome (envPath) {\n return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath\n}\n\nfunction _configVault (options) {\n const debug = Boolean(options && options.debug)\n const quiet = options && 'quiet' in options ? options.quiet : true\n\n if (debug || !quiet) {\n _log('Loading env from encrypted .env.vault')\n }\n\n const parsed = DotenvModule._parseVault(options)\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsed, options)\n\n return { parsed }\n}\n\nfunction configDotenv (options) {\n const dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding = 'utf8'\n const debug = Boolean(options && options.debug)\n const quiet = options && 'quiet' in options ? options.quiet : true\n\n if (options && options.encoding) {\n encoding = options.encoding\n } else {\n if (debug) {\n _debug('No encoding is specified. UTF-8 is used by default')\n }\n }\n\n let optionPaths = [dotenvPath] // default, look for .env\n if (options && options.path) {\n if (!Array.isArray(options.path)) {\n optionPaths = [_resolveHome(options.path)]\n } else {\n optionPaths = [] // reset default\n for (const filepath of options.path) {\n optionPaths.push(_resolveHome(filepath))\n }\n }\n }\n\n // Build the parsed data in a temporary object (because we need to return it). Once we have the final\n // parsed data, we will combine it with process.env (or options.processEnv if provided).\n let lastError\n const parsedAll = {}\n for (const path of optionPaths) {\n try {\n // Specifying an encoding returns a string instead of a buffer\n const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }))\n\n DotenvModule.populate(parsedAll, parsed, options)\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${path} ${e.message}`)\n }\n lastError = e\n }\n }\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsedAll, options)\n\n if (debug || !quiet) {\n const keysCount = Object.keys(parsedAll).length\n const shortPaths = []\n for (const filePath of optionPaths) {\n try {\n const relative = path.relative(process.cwd(), filePath)\n shortPaths.push(relative)\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${filePath} ${e.message}`)\n }\n lastError = e\n }\n }\n\n _log(`injecting env (${keysCount}) from ${shortPaths.join(',')}`)\n }\n\n if (lastError) {\n return { parsed: parsedAll, error: lastError }\n } else {\n return { parsed: parsedAll }\n }\n}\n\n// Populates process.env from .env file\nfunction config (options) {\n // fallback to original dotenv if DOTENV_KEY is not set\n if (_dotenvKey(options).length === 0) {\n return DotenvModule.configDotenv(options)\n }\n\n const vaultPath = _vaultPath(options)\n\n // dotenvKey exists but .env.vault file does not exist\n if (!vaultPath) {\n _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)\n\n return DotenvModule.configDotenv(options)\n }\n\n return DotenvModule._configVault(options)\n}\n\nfunction decrypt (encrypted, keyStr) {\n const key = Buffer.from(keyStr.slice(-64), 'hex')\n let ciphertext = Buffer.from(encrypted, 'base64')\n\n const nonce = ciphertext.subarray(0, 12)\n const authTag = ciphertext.subarray(-16)\n ciphertext = ciphertext.subarray(12, -16)\n\n try {\n const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)\n aesgcm.setAuthTag(authTag)\n return `${aesgcm.update(ciphertext)}${aesgcm.final()}`\n } catch (error) {\n const isRange = error instanceof RangeError\n const invalidKeyLength = error.message === 'Invalid key length'\n const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'\n\n if (isRange || invalidKeyLength) {\n const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n } else if (decryptionFailed) {\n const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY')\n err.code = 'DECRYPTION_FAILED'\n throw err\n } else {\n throw error\n }\n }\n}\n\n// Populate process.env with parsed values\nfunction populate (processEnv, parsed, options = {}) {\n const debug = Boolean(options && options.debug)\n const override = Boolean(options && options.override)\n\n if (typeof parsed !== 'object') {\n const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')\n err.code = 'OBJECT_REQUIRED'\n throw err\n }\n\n // Set process.env\n for (const key of Object.keys(parsed)) {\n if (Object.prototype.hasOwnProperty.call(processEnv, key)) {\n if (override === true) {\n processEnv[key] = parsed[key]\n }\n\n if (debug) {\n if (override === true) {\n _debug(`\"${key}\" is already defined and WAS overwritten`)\n } else {\n _debug(`\"${key}\" is already defined and was NOT overwritten`)\n }\n }\n } else {\n processEnv[key] = parsed[key]\n }\n }\n}\n\nconst DotenvModule = {\n configDotenv,\n _configVault,\n _parseVault,\n config,\n decrypt,\n parse,\n populate\n}\n\nmodule.exports.configDotenv = DotenvModule.configDotenv\nmodule.exports._configVault = DotenvModule._configVault\nmodule.exports._parseVault = DotenvModule._parseVault\nmodule.exports.config = DotenvModule.config\nmodule.exports.decrypt = DotenvModule.decrypt\nmodule.exports.parse = DotenvModule.parse\nmodule.exports.populate = DotenvModule.populate\n\nmodule.exports = DotenvModule\n","","'use strict';\n\nconst fs = require('fs');\nconst p = require('path');\nconst dotenv = require('dotenv');\nconst {version} = require('../package.json');\n\nconst DEFAULT_PATTERN = '.env[.node_env][.local]';\n\nconst LOCAL_PLACEHOLDER_REGEX = /\\[(\\W*\\blocal\\b\\W*)]/g;\nconst NODE_ENV_PLACEHOLDER_REGEX = /\\[(\\W*\\b)node_env(\\b\\W*)]/g;\n\n/**\n * Compose a filename from a given `patten`.\n *\n * @param {string} pattern\n * @param {object} [options]\n * @param {boolean} [options.local]\n * @param {string} [options.node_env]\n * @return {string} filename\n */\nfunction composeFilename(pattern, options) {\n let filename = pattern;\n\n filename = filename.replace(\n LOCAL_PLACEHOLDER_REGEX,\n (options && options.local) ? '$1' : ''\n );\n\n filename = filename.replace(\n NODE_ENV_PLACEHOLDER_REGEX,\n (options && options.node_env) ? `$1${options.node_env}$2` : ''\n );\n\n return filename;\n}\n\n/**\n * Returns a list of existing `.env*` filenames depending on the given `options`.\n *\n * The resulting list is ordered by the env files'\n * variables overwriting priority from lowest to highest.\n *\n * This can also be referenced as \"env files' environment cascade\"\n * or \"order of ascending priority.\"\n *\n * ⚠️ Note that the `.env.local` file is not listed for \"test\" environment,\n * since normally you expect tests to produce the same results for everyone.\n *\n * @param {object} [options] - `.env*` files listing options\n * @param {string} [options.node_env] - node environment (development/test/production/etc.)\n * @param {string} [options.path] - path to the working directory (default: `process.cwd()`)\n * @param {string} [options.pattern] - `.env*` files' naming convention pattern\n * (default: \".env[.node_env][.local]\")\n * @param {boolean} [options.debug] - turn on debug messages\n * @return {string[]}\n */\nfunction listFiles(options = {}) {\n options.debug && debug('listing effective `.env*` files…');\n\n const {\n node_env,\n path = process.cwd(),\n pattern = DEFAULT_PATTERN,\n } = options;\n\n const hasLocalPlaceholder = LOCAL_PLACEHOLDER_REGEX.test(pattern);\n\n const filenames = {};\n\n if (pattern === DEFAULT_PATTERN) {\n filenames['.env.defaults'] = '.env.defaults'; // for seamless transition from \".env + .env.defaults\"\n }\n\n filenames['.env'] = composeFilename(pattern);\n\n if (hasLocalPlaceholder) {\n const envlocal = composeFilename(pattern, { local: true });\n\n if (node_env !== 'test') {\n filenames['.env.local'] = envlocal;\n }\n else if (options.debug && fs.existsSync(p.resolve(path, envlocal))) {\n debug(\n '[!] note that `%s` is being skipped for \"test\" environment',\n envlocal\n );\n }\n }\n\n if (node_env && NODE_ENV_PLACEHOLDER_REGEX.test(pattern)) {\n filenames['.env.node_env'] = composeFilename(pattern, { node_env });\n\n if (hasLocalPlaceholder) {\n filenames['.env.node_env.local'] = composeFilename(pattern, { node_env, local: true });\n }\n }\n\n return [\n '.env.defaults',\n '.env',\n '.env.local',\n '.env.node_env',\n '.env.node_env.local'\n ]\n .reduce((list, basename) => {\n if (!filenames[basename]) {\n return list;\n }\n\n const filename = p.resolve(path, filenames[basename]);\n if (fs.existsSync(filename)) {\n options.debug && debug('>> %s', filename);\n list.push(filename);\n }\n\n return list;\n }, []);\n}\n\n/**\n * Parses a given file or a list of files.\n *\n * When a list of filenames is given, the files will be parsed and merged in the same order as given.\n *\n * @param {string|string[]} filenames - filename or a list of filenames to parse and merge\n * @param {{ encoding?: string, debug?: boolean }} [options] - parse options\n * @return {Object<string, string>} the resulting map of `{ env_var: value }` as an object\n */\nfunction parse(filenames, options = {}) {\n if (typeof filenames === 'string') {\n options.debug && debug('parsing \"%s\"…', filenames);\n\n const parsed = dotenv.parse(\n fs.readFileSync(\n filenames,\n options.encoding && { encoding: options.encoding }\n )\n );\n\n if (options.debug) {\n Object.keys(parsed)\n .forEach(varname => debug('>> %s', varname));\n }\n\n return parsed;\n }\n\n return filenames.reduce((result, filename) => {\n const parsed = parse(filename, options);\n\n if (options.debug) {\n Object.keys(parsed)\n .filter(varname => result.hasOwnProperty(varname))\n .forEach(varname => debug('`%s` is being overwritten by merge from \"%s\"', varname, filename));\n }\n\n return Object.assign(result, parsed);\n }, {});\n}\n\n/**\n * Parses variables defined in given file(s) and assigns them to `process.env`.\n *\n * Variables that are already defined in `process.env` will not be overwritten,\n * thus giving a higher priority to environment variables predefined by the shell.\n *\n * If the loading is successful, an object with `parsed` property is returned.\n * The `parsed` property contains parsed variables' `key => value` pairs merged in order using\n * the \"overwrite merge\" strategy.\n *\n * If parsing fails for any of the given files, `process.env` is being left untouched,\n * and an object with `error` property is returned.\n * The `error` property, if present, references to the occurred error.\n *\n * @param {string|string[]} filenames - filename or a list of filenames to parse and merge\n * @param {object} [options] - file loading options\n * @param {string} [options.encoding=\"utf8\"] - encoding of `.env*` files\n * @param {boolean} [options.debug=false] - turn on debug messages\n * @param {boolean} [options.silent=false] - suppress console errors and warnings\n * @return {{ error: Error } | { parsed: Object<string, string> }}\n */\nfunction load(filenames, options = {}) {\n try {\n const parsed = parse(filenames, {\n encoding: options.encoding,\n debug: options.debug\n });\n\n options.debug && debug('safe-merging parsed environment variables into `process.env`…');\n\n for (const varname of Object.keys(parsed)) {\n if (!process.env.hasOwnProperty(varname)) {\n options.debug && debug('>> process.env.%s', varname);\n process.env[varname] = parsed[varname];\n }\n else if (options.debug && process.env[varname] !== parsed[varname]) {\n debug('environment variable `%s` is predefined and not being overwritten', varname);\n }\n }\n\n return { parsed };\n }\n catch (error) {\n return failure(error, options);\n }\n}\n\n/**\n * Unload variables defined in a given file(s) from `process.env`.\n *\n * This function can gracefully resolve the following issue:\n *\n * In some cases, the original \"dotenv\" library can be used by one of the dependent npm modules.\n * It causes calling the original `dotenv.config()` that loads the `.env` file from your project before you can call `dotenv-flow.config()`.\n * Such cases break `.env*` files priority because the previously loaded environment variables are treated as shell-defined thus having a higher priority.\n *\n * Unloading the previously loaded `.env` file can be activated when using the `dotenv-flow.config()` with the `purge_dotenv` option set to `true`.\n *\n * @param {string|string[]} filenames - filename or a list of filenames to unload\n * @param {object} [options] - `fs.readFileSync` options\n */\nfunction unload(filenames, options = {}) {\n const parsed = parse(filenames, options);\n\n Object.keys(parsed).forEach((key) => {\n if (process.env[key] === parsed[key]) {\n delete process.env[key];\n }\n });\n}\n\n/**\n * Returns effective (computed) `node_env`.\n *\n * @param {object} [options]\n * @param {string} [options.node_env]\n * @param {string} [options.default_node_env]\n * @param {boolean} [options.debug]\n * @return {string|undefined} node_env\n */\nfunction getEffectiveNodeEnv(options = {}) {\n if (options.node_env) {\n options.debug && debug(\n `operating in \"${options.node_env}\" environment (set by \\`options.node_env\\`)`\n );\n return options.node_env;\n }\n\n if (process.env.NODE_ENV) {\n options.debug && debug(\n `operating in \"${process.env.NODE_ENV}\" environment (as per \\`process.env.NODE_ENV\\`)`\n );\n return process.env.NODE_ENV;\n }\n\n if (options.default_node_env) {\n options.debug && debug(\n `operating in \"${options.default_node_env}\" environment (taken from \\`options.default_node_env\\`)`\n );\n return options.default_node_env;\n }\n\n options.debug && debug(\n 'operating in \"no environment\" mode (no environment-related options are set)'\n );\n return undefined;\n}\n\nconst CONFIG_OPTION_KEYS = [\n 'node_env',\n 'default_node_env',\n 'path',\n 'pattern',\n 'files',\n 'encoding',\n 'purge_dotenv',\n 'silent'\n];\n\n/**\n * \"dotenv-flow\" initialization function (API entry point).\n *\n * Allows configuring dotenv-flow programmatically.\n *\n * @param {object} [options] - configuration options\n * @param {string} [options.node_env=process.env.NODE_ENV] - node environment (development/test/production/etc.)\n * @param {string} [options.default_node_env] - the default node environment\n * @param {string} [options.path=process.cwd()] - path to `.env*` files directory\n * @param {string} [options.pattern=\".env[.node_env][.local]\"] - `.env*` files' naming convention pattern\n * @param {string[]} [options.files] - an explicit list of `.env*` files to load (note that `options.[default_]node_env` and `options.pattern` are ignored in this case)\n * @param {string} [options.encoding=\"utf8\"] - encoding of `.env*` files\n * @param {boolean} [options.purge_dotenv=false] - perform the `.env` file {@link unload}\n * @param {boolean} [options.debug=false] - turn on detailed logging to help debug why certain variables are not being set as you expect\n * @param {boolean} [options.silent=false] - suppress all kinds of warnings including \".env*\" files' loading errors\n * @return {{ parsed?: object, error?: Error }} with a `parsed` key containing the loaded content or an `error` key with an error that is occurred\n */\nfunction config(options = {}) {\n if (options.debug) {\n debug('initializing…');\n\n CONFIG_OPTION_KEYS\n .filter(key => key in options)\n .forEach(key => debug(`| options.${key} =`, options[key]));\n }\n\n const {\n path = process.cwd(),\n pattern = DEFAULT_PATTERN\n } = options;\n\n if (options.purge_dotenv) {\n options.debug && debug(\n '`options.purge_dotenv` is enabled, unloading potentially pre-loaded `.env`…'\n );\n\n const dotenvFile = p.resolve(path, '.env');\n try {\n fs.existsSync(dotenvFile) && unload(dotenvFile, { encoding: options.encoding });\n }\n catch (error) {\n !options.silent && warn('unloading failed: ', error);\n }\n }\n\n try {\n let filenames;\n\n if (options.files) {\n options.debug && debug(\n 'using explicit list of `.env*` files: %s…',\n options.files.join(', ')\n );\n\n filenames = options.files\n .reduce((list, basename) => {\n const filename = p.resolve(path, basename);\n\n if (fs.existsSync(filename)) {\n list.push(filename);\n }\n else if (options.debug) {\n debug('>> %s does not exist, skipping…', filename);\n }\n\n return list;\n }, []);\n }\n else {\n const node_env = getEffectiveNodeEnv(options);\n\n filenames = listFiles({ node_env, path, pattern, debug: options.debug });\n\n if (filenames.length === 0) {\n const _pattern = node_env\n ? pattern.replace(NODE_ENV_PLACEHOLDER_REGEX, `[$1${node_env}$2]`)\n : pattern;\n\n return failure(\n new Error(`no \".env*\" files matching pattern \"${_pattern}\" in \"${path}\" dir`),\n options\n );\n }\n }\n\n const result = load(filenames, {\n encoding: options.encoding,\n debug: options.debug,\n silent: options.silent\n });\n\n options.debug && debug('initialization completed.');\n\n return result;\n }\n catch (error) {\n return failure(error, options);\n }\n}\n\nfunction failure(error, options) {\n if (!options.silent) {\n warn(`\".env*\" files loading failed: ${error.message || error}`);\n }\n\n return { error };\n}\n\nfunction warn(message, error) {\n if (error) {\n message += ': %s';\n }\n\n console.warn(`[dotenv-flow@${version}]: ${message}`, error);\n}\n\nfunction debug(message, ...values) {\n console.debug(`[dotenv-flow@${version}]: ${message}`, ...values);\n}\n\nmodule.exports = {\n DEFAULT_PATTERN,\n listFiles,\n parse,\n load,\n unload,\n config\n};\n","import * as path from \"node:path\";\nimport { listFiles, parse } from \"dotenv-flow\";\n//#region src/config-adapters.ts\n/** Reads the process environment when called: every variable whose value is a string. The default for both `config` and `secrets`. */\nfunction environmentVariables() {\n\treturn () => {\n\t\tconst values = {};\n\t\tfor (const [name, value] of Object.entries(process.env)) if (typeof value === \"string\") values[name] = value;\n\t\treturn values;\n\t};\n}\n/** `dotenv-flow`'s own default pattern. Given it, `listFiles` also lists `.env.defaults`, first. */\nconst DOTENV_FLOW_PATTERN = \".env[.node_env][.local]\";\nconst ENV_DEFAULTS_FILE = \".env.defaults\";\nfunction envFiles(configDirectory, environment) {\n\tconst files = listFiles({\n\t\tnode_env: encodeURIComponent(environment),\n\t\tpath: configDirectory,\n\t\tpattern: DOTENV_FLOW_PATTERN\n\t});\n\treturn files[0] === path.resolve(configDirectory, ENV_DEFAULTS_FILE) ? files.slice(1) : files;\n}\nfunction readEnvFile(file) {\n\ttry {\n\t\treturn parse(file);\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tthrow new Error(`dotenv() could not read ${file}: ${message}`, { cause: error });\n\t}\n}\n/**\n* Reads `.env`, `.env.local`, `.env.<environment>` and `.env.<environment>.local` from the\n* directory of prisma.config.ts, in `dotenv-flow`'s order, a later file winning. It skips\n* `.env.local` for the environment `test`, as `dotenv-flow` does, and never reads\n* `.env.defaults`. It does not read or change the process environment.\n*/\nfunction dotenv() {\n\treturn ({ environment, configDirectory }) => {\n\t\tconst values = {};\n\t\tfor (const file of envFiles(configDirectory, environment)) Object.assign(values, readEnvFile(file));\n\t\treturn values;\n\t};\n}\n//#endregion\nexport { environmentVariables as n, dotenv as t };\n\n//# sourceMappingURL=config-adapters-DG-uhGfv.mjs.map","import { CliStructuredError } from \"@internal/foundation/errors\";\n//#region src/assemble-error.ts\n/**\n* A user-facing assembly failure, structured at origin (base-type rule 6):\n* a `CliStructuredError` whose code names which way assembly went wrong.\n* This package's second consumer is the programmatic deploy API, not just\n* the CLI — hosts branch on `error.code`, the CLI renders the envelope.\n*/\nvar AssembleError = class extends CliStructuredError {\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t}\n};\n//#endregion\n//#region src/assemble-services.ts\n/**\n* The registry route for one service's build: extension by\n* `build.extension`, node descriptor by `build.type`, kind must be \"build\".\n* The CLI's coverage validation reports the same misses earlier with the\n* config fix; these errors are the backstop for programmatic callers.\n*/\nfunction buildDescriptorAssemble(config, node, address, cwd, report) {\n\tconst { extension, type } = node.build;\n\tconst extensionDescriptor = config.extensions.find((candidate) => candidate.id === extension);\n\tif (extensionDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by service \"${node.name}\"'s build).`, { fix: \"Add it to `extensions` in the `composer` section of prisma.config.ts.\" });\n\tconst nodeDescriptor = extensionDescriptor.nodes[type];\n\tif (nodeDescriptor === void 0) throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for build type \"${type}\".`, { why: `Known types: ${Object.keys(extensionDescriptor.nodes).join(\", \")}.` });\n\tif (nodeDescriptor.kind !== \"build\") throw new AssembleError(\"ASSEMBLE.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for type \"${type}\" is a \"${nodeDescriptor.kind}\" descriptor.`, { why: \"Assembling a service build needs a \\\"build\\\" descriptor.\" });\n\treturn nodeDescriptor.assemble({\n\t\tbuild: node.build,\n\t\taddress,\n\t\tcwd,\n\t\treport\n\t});\n}\n/**\n* The dev server a service's build descriptor declares, or `undefined` when it\n* declares none — including when the registry route misses, which the\n* assemble that follows reports with its own pinned error.\n*/\nasync function buildDescriptorServe(config, node, address) {\n\tconst { extension, type } = node.build;\n\tconst nodeDescriptor = config.extensions.find((candidate) => candidate.id === extension)?.nodes[type];\n\tif (nodeDescriptor?.kind !== \"build\" || nodeDescriptor.serve === void 0) return void 0;\n\ttry {\n\t\treturn await nodeDescriptor.serve({\n\t\t\tbuild: node.build,\n\t\t\taddress\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError.is(error)) throw error;\n\t\tthrow new CliStructuredError(\"DEV.DEV_SERVER_UNAVAILABLE\", `service \"${address}\" cannot run its dev server: ${error instanceof Error ? error.message : String(error)}`, {\n\t\t\tmeta: { address },\n\t\t\tcause: error\n\t\t});\n\t}\n}\nasync function assembleServices(graph, config, cwd, run, onEvent, options = {}) {\n\tconst runAssembler = run ?? ((node, address, nodeCwd, report) => buildDescriptorAssemble(config, node, address, nodeCwd, report));\n\tconst serviceNodes = graph.nodes.filter((n) => n.node.kind === \"service\");\n\tif (serviceNodes.length === 0) throw new AssembleError(\"ASSEMBLE.SERVICE_MISSING\", \"The loaded graph has no service to assemble.\");\n\tconst bundles = {};\n\tconst devServers = {};\n\tfor (const { id, node } of serviceNodes) {\n\t\tif (options.devServers === true) {\n\t\t\tconst server = await buildDescriptorServe(config, node, id);\n\t\t\tif (server !== void 0) {\n\t\t\t\tdevServers[id] = server;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tonEvent?.({\n\t\t\tkind: \"service-started\",\n\t\t\taddress: id\n\t\t});\n\t\tconst data = {};\n\t\tlet artifact;\n\t\ttry {\n\t\t\tartifact = await runAssembler(node, id, cwd, (reported) => Object.assign(data, reported));\n\t\t} catch (error) {\n\t\t\tif (CliStructuredError.is(error)) throw error;\n\t\t\tthrow new AssembleError(\"ASSEMBLE.BUILD_FAILED\", error instanceof Error ? error.message : String(error), {\n\t\t\t\tmeta: { address: id },\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t\tbundles[id] = artifact;\n\t\tonEvent?.({\n\t\t\tkind: \"service-assembled\",\n\t\t\taddress: id,\n\t\t\tdata\n\t\t});\n\t}\n\treturn {\n\t\tbundles,\n\t\tdevServers\n\t};\n}\n//#endregion\nexport { AssembleError, assembleServices };\n\n//# sourceMappingURL=index.mjs.map","import { n as environmentVariables } from \"./config-adapters-DG-uhGfv.mjs\";\nimport { n as configFileMissing, r as entryMissing, t as checkComposerConfig } from \"./composer-config-QKdY85G-.mjs\";\nimport { t as loadEntry } from \"./load-entry-CEoVBdMj.mjs\";\nimport { r as credentialLookingValues, t as SecretRedaction, u as valuesUnderSecretsKeys } from \"./redaction-DY6eDC12.mjs\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { assembleServices } from \"@internal/assemble\";\nimport { GraphCheckError, Load, assertAppName } from \"@internal/core\";\nimport { secretsKeys } from \"@internal/core/deploy\";\nimport { CliStructuredError, InternalError, describeKind } from \"@internal/foundation/errors\";\nimport { spawnSync } from \"node:child_process\";\n//#region src/app-configuration.ts\nfunction adapterInvalid(list, index, input, summary, fix) {\n\treturn new CliStructuredError(\"CONFIG.ADAPTER_INVALID\", summary, {\n\t\tfix,\n\t\twhere: { path: input.configFile },\n\t\tmeta: { field: `${list}[${index}]` }\n\t});\n}\nfunction isValues(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isText(values) {\n\treturn Object.values(values).every((value) => typeof value === \"string\");\n}\nasync function readAdapters(list, adapters, input) {\n\tconst adapterInput = Object.freeze({\n\t\tenvironment: input.environment,\n\t\tconfigDirectory: path.dirname(input.configFile)\n\t});\n\tconst merged = Object.create(null);\n\tfor (const [index, adapter] of adapters.entries()) {\n\t\tconst field = `composer.${list}[${index}]`;\n\t\tlet values;\n\t\ttry {\n\t\t\tvalues = await adapter(adapterInput);\n\t\t} catch (thrown) {\n\t\t\tthrow new CliStructuredError(\"CONFIG.ADAPTER_FAILED\", `\\`${field}\\` failed to read the values for the environment \"${input.environment}\".`, {\n\t\t\t\twhy: `It threw: ${thrown instanceof Error ? thrown.message : String(thrown)}`,\n\t\t\t\tfix: `Fix the adapter, or remove it from \\`composer.${list}\\` in prisma.config.ts.`,\n\t\t\t\twhere: { path: input.configFile },\n\t\t\t\tmeta: { field: `${list}[${index}]` },\n\t\t\t\tcause: thrown\n\t\t\t});\n\t\t}\n\t\tif (typeof values === \"function\") throw adapterInvalid(list, index, input, `\\`${field}\\` returned a function, not an object of values.`, \"An adapter factory was put in the list instead of the adapter it makes: write `dotenv()`, not `dotenv`.\");\n\t\tif (!isValues(values)) throw adapterInvalid(list, index, input, `\\`${field}\\` returned ${describeKind(values)}, not an object of values.`, \"Return an object whose keys are the names of the values, e.g. `{ EMAIL_FROM: 'shop@example.com' }`.\");\n\t\tfor (const [key, value] of Object.entries(values)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tif (list === \"secrets\" && typeof value !== \"string\") throw adapterInvalid(list, index, input, `\\`${field}\\` returned ${describeKind(value)} for \"${key}\", but a secret is text.`, \"Return the secret as a string. A platform variable holds text.\");\n\t\t\tmerged[key] = value;\n\t\t}\n\t}\n\treturn Object.freeze(merged);\n}\n/** Calls the section's `config` adapters (default `[environmentVariables()]`) and merges what they return: the app configuration. */\nfunction readAppConfiguration(section, input) {\n\treturn readAdapters(\"config\", section.config ?? [environmentVariables()], input);\n}\n/**\n* Calls the section's `secrets` adapters (default `[environmentVariables()]`) and merges what they\n* return: the app secrets. Every value must be text. A value is a known secret only once the graph\n* names it, so this adds none.\n*/\nasync function readAppSecrets(section, input) {\n\tconst merged = await readAdapters(\"secrets\", section.secrets ?? [environmentVariables()], input);\n\tif (!isText(merged)) throw new InternalError(\"readAdapters admitted a secret that is not text\");\n\treturn merged;\n}\n//#endregion\n//#region src/validate-coverage.ts\nfunction lookup(extensions, extension, type, expectedKind, what) {\n\tconst ext = extensions.get(extension);\n\tif (ext === void 0) throw new CliStructuredError(\"CONFIG.EXTENSION_MISSING\", `No extension \"${extension}\" is configured (needed by ${what}).`, {\n\t\tfix: \"Add it to `extensions` in the `composer` section of prisma.config.ts (import its /control entry and list its descriptor).\",\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tconst descriptor = ext.nodes[type];\n\tif (descriptor === void 0) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_MISSING\", `Extension \"${extension}\" has no descriptor for node type \"${type}\" (needed by ${what}).`, {\n\t\twhy: `Known types: ${Object.keys(ext.nodes).join(\", \")}.`,\n\t\tmeta: {\n\t\t\textension,\n\t\t\ttype\n\t\t}\n\t});\n\tif (descriptor.kind !== expectedKind) throw new CliStructuredError(\"CONFIG.DESCRIPTOR_KIND_MISMATCH\", `Extension \"${extension}\"'s descriptor for node type \"${type}\" is a \"${descriptor.kind}\" descriptor — ${what} needs a \"${expectedKind}\" descriptor.`, { meta: {\n\t\textension,\n\t\ttype,\n\t\tkind: descriptor.kind\n\t} });\n}\n/** Throws a structured CONFIG.* error on the first uncovered `(extension, type)`; silent when the config covers the whole graph. */\nfunction validateRegistryCoverage(graph, config) {\n\tconst extensions = new Map(config.extensions.map((descriptor) => [descriptor.id, descriptor]));\n\tfor (const { id, node } of graph.nodes) {\n\t\tif (node.kind === \"resource\") {\n\t\t\tlookup(extensions, node.extension, node.type, \"resource\", `resource node \"${id}\"`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (node.kind !== \"service\") continue;\n\t\tlookup(extensions, node.extension, node.type, \"service\", `service node \"${id}\"`);\n\t\tlookup(extensions, node.build.extension, node.build.type, \"build\", `service node \"${id}\"'s build descriptor`);\n\t}\n}\n//#endregion\n//#region src/pipeline.ts\n/**\n* The shared prefix of `deploy`/`destroy`/`dev` (deploy-cli.md § The\n* pipeline; local-dev spec § 6): entry load, Load,\n* registry coverage validation, name resolution, assemble. Deploy and dev\n* diverge after this — deploy resolves containers/preflight/stack file\n* against the hosted providers, dev against the local ones — so everything\n* up to and including assemble lives here once, consumed verbatim by both\n* `run()` (main.ts) and `runDev()` (dev/run-dev.ts), so the two pipelines\n* cannot drift.\n*/\nconst NO_SECRETS = Object.freeze({});\nfunction configError(findings, file) {\n\tconst [first] = findings;\n\treturn new CliStructuredError(first.code, first.summary, {\n\t\t...first.why === void 0 ? {} : { why: first.why },\n\t\tfix: first.fix,\n\t\twhere: { path: first.where ?? file },\n\t\tmeta: {\n\t\t\t...first.field === void 0 ? {} : { field: first.field },\n\t\t\tfindings\n\t\t}\n\t});\n}\n/**\n* Refuses a caller's config with the same findings, in the same order, as the CLI's section validator.\n* The error is the first finding and carries all of them in `meta.findings`. Returns the config with `file` resolved against `cwd`.\n*/\nfunction checkConfigSource(source, cwd) {\n\tconst file = path.resolve(cwd, source.file);\n\tif (!fs.existsSync(file)) throw configError([configFileMissing(file)], file);\n\tconst checked = checkComposerConfig(source.value, file);\n\tif (!checked.ok) throw configError(checked.findings, file);\n\treturn {\n\t\tvalue: checked.value,\n\t\tfile\n\t};\n}\n/**\n* Resolves the entry module. An override (`--entry`, or an operation's `entry` input) resolves\n* against `cwd`; the section's `entry` resolves against the directory of the file that declares it,\n* as the CLI engine resolves path fields in prisma.config.ts.\n*/\nfunction resolveEntryPath(override, source, cwd) {\n\tif (override !== void 0) return {\n\t\tpath: path.resolve(cwd, override),\n\t\tfix: `Check the \\`--entry\\` path (the \\`entry\\` input when calling @prisma/composer/control) \"${override}\". It is relative to the current directory, ${cwd}.`\n\t};\n\tconst configured = source.value.entry;\n\tif (configured === void 0) throw configError([entryMissing], source.file);\n\treturn {\n\t\tpath: path.resolve(path.dirname(source.file), configured),\n\t\tfix: `Check \\`entry: \"${configured}\"\\` in ${source.file}. It is relative to that file's directory.`\n\t};\n}\n/**\n* The pipeline's front — entry load and name resolution —\n* WITHOUT Load, coverage, or assemble. `log` needs only who the app is (its\n* config and resolved name) to reach the already-running local instance; it\n* neither builds nor provisions, so it must not require the user's built\n* output the way the full pipeline does.\n*/\nasync function resolveAppIdentity(entry, overrideName, cwd, config) {\n\tconst checked = checkConfigSource(config, cwd);\n\tconst { value } = checked;\n\tconst resolved = resolveEntryPath(entry, checked, cwd);\n\tconst entryModule = await loadEntry(resolved.path, cwd, resolved.fix);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\tassertAppName(name);\n\treturn {\n\t\tconfig: value,\n\t\tname\n\t};\n}\n/**\n* Runs entry load, name resolution, Load, registry coverage, and assemble — steps 1–5 of `run()`. `onAssembleError`, when\n* given, lets a caller decorate an assemble failure with command-specific\n* guidance (destroy's \"build first\" hint) without this shared step knowing\n* about any one command.\n*/\nasync function runPipeline(entry, overrideName, environment, cwd, source, deps = {}, onAssembleError) {\n\tconst configSource = checkConfigSource(source, cwd);\n\tconst config = configSource.value;\n\tconst resolved = resolveEntryPath(entry, configSource, cwd);\n\tconst entryModule = await loadEntry(resolved.path, cwd, resolved.fix);\n\tconst name = overrideName ?? entryModule.root.name;\n\tif (name.length === 0) throw new CliStructuredError(\"COMPOSE.NAME_MISSING\", \"The root node has no name.\", { fix: \"Name it at authoring, or pass --name.\" });\n\tconst redaction = deps.redaction ?? new SecretRedaction(process.env);\n\tconst adapterInput = {\n\t\tenvironment,\n\t\tconfigFile: configSource.file\n\t};\n\tconst secrets = deps.readSecrets === true ? await readAppSecrets(config, adapterInput) : NO_SECRETS;\n\tconst configuration = await readAppConfiguration(config, adapterInput);\n\tredaction.addCredentialLookingValues(credentialLookingValues(configuration));\n\tconst graph = Load(entryModule.root, {\n\t\tid: name,\n\t\tenvironment: { name: environment },\n\t\tconfiguration\n\t});\n\tredaction.addKnownSecrets(valuesUnderSecretsKeys(configuration, secrets, secretsKeys(graph)));\n\tcheckGraph(graph, config.extensions);\n\tvalidateRegistryCoverage(graph, config);\n\tdeps.onEvent?.({ kind: \"loaded\" });\n\tlet assembled;\n\ttry {\n\t\tassembled = await assembleServices(graph, config, cwd, deps.runAssembler, deps.onEvent, { devServers: deps.devServers === true });\n\t} catch (error) {\n\t\tif (onAssembleError !== void 0 && error instanceof Error) throw onAssembleError(error);\n\t\tthrow error;\n\t}\n\treturn {\n\t\tconfigSource,\n\t\tentryModule,\n\t\tgraph,\n\t\tname,\n\t\tassembled,\n\t\tconfiguration,\n\t\tsecrets\n\t};\n}\nfunction checkGraph(graph, extensions) {\n\tfor (const extension of extensions) try {\n\t\textension.checkGraph?.(graph);\n\t} catch (error) {\n\t\tif (error instanceof GraphCheckError) throw new GraphCheckError(error.message, { extension: extension.id });\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/validate-environment.ts\n/** Letters, digits, `-` and `_`, starting with a letter or digit: always a valid git ref, so no `git` is needed to check it. */\nconst PLAIN_ENVIRONMENT_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;\n/** An environment name must be a valid git ref (deploy-cli.md) — checked via `git check-ref-format`, never silently normalized. Runs before anything platform-specific. */\nfunction validateEnvironmentName(environment, spawn = spawnSync) {\n\tif (PLAIN_ENVIRONMENT_NAME.test(environment)) return;\n\tconst result = spawn(\"git\", [\"check-ref-format\", `refs/heads/${environment}`], { stdio: \"ignore\" });\n\tif (result.error) throw new CliStructuredError(\"DEPLOY.ENVIRONMENT_UNVALIDATABLE\", `git is required to validate --environment \"${environment}\" (git check-ref-format): ${result.error.message}.`, { cause: result.error });\n\tif (result.status !== 0) throw new CliStructuredError(\"DEPLOY.ENVIRONMENT_INVALID\", `Invalid --environment \"${environment}\": must be a valid git ref name (git check-ref-format rejected \"refs/heads/${environment}\").`);\n}\n//#endregion\nexport { runPipeline as i, checkConfigSource as n, resolveAppIdentity as r, validateEnvironmentName as t };\n\n//# sourceMappingURL=validate-environment-DCZiNSlR.mjs.map"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CCAA,MAAMA,OAAAA,UAAa,IAAI;CACvB,MAAMC,SAAAA,UAAe,MAAM;CAC3B,MAAM,KAAA,UAAa,IAAI;CACvB,MAAM,SAAA,UAAiB,QAAQ;CAG/B,MAAM,UAAA,kBAAA,CAAA,CAAsB;CAE5B,MAAM,OAAO;CAGb,SAAS,MAAO,KAAK;EACnB,MAAM,MAAM,CAAC;EAGb,IAAI,QAAQ,IAAI,SAAS;EAGzB,QAAQ,MAAM,QAAQ,WAAW,IAAI;EAErC,IAAI;EACJ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B,SAAS,OAAO;EACf,IAAI,iBAAiB,iBAAiB,MAAM,IAAI,gBAAgB,MAAM,SAAS,EAAE,WAAW,UAAU,GAAG,CAAC;EAC1G,MAAM;CACP;AACD;;AAIA,MAAM,yBAAyB;;AAE/B,SAAS,wBAAwB,aAAa,QAAQ,WAAW;CAChE,IAAI,uBAAuB,KAAK,WAAW,GAAG;CAC9C,MAAM,SAAS,MAAM,OAAO,CAAC,oBAAoB,cAAc,aAAa,GAAG,EAAE,OAAO,SAAS,CAAC;CAClG,IAAI,OAAO,OAAO,MAAM,IAAI,mBAAmB,oCAAoC,8CAA8C,YAAY,4BAA4B,OAAO,MAAM,QAAQ,IAAI,EAAE,OAAO,OAAO,MAAM,CAAC;CACzN,IAAI,OAAO,WAAW,GAAG,MAAM,IAAI,mBAAmB,8BAA8B,0BAA0B,YAAY,6EAA6E,YAAY,IAAI;AACxN"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { n as quotedList } from "./errors-CVYwN2km.mjs";
|
|
2
|
+
//#region ../../0-framework/3-tooling/cli/dist/value-reads-change-text-DcRCv7Zy.mjs
|
|
3
|
+
/** Which reads changed, as a clause: `reads of "shop.port" were added and "shop.key" was changed`. */
|
|
4
|
+
function valueReadsChangeText(change) {
|
|
5
|
+
const [first, second, third] = [
|
|
6
|
+
...change.added.length > 0 ? [`reads of ${quotedList(change.added)} were added`] : [],
|
|
7
|
+
...change.removed.length > 0 ? [`reads of ${quotedList(change.removed)} were removed`] : [],
|
|
8
|
+
...change.changed.length > 0 ? [`${quotedList(change.changed)} ${change.changed.length === 1 ? "was" : "were"} changed`] : []
|
|
9
|
+
];
|
|
10
|
+
return third !== void 0 ? `${first}, ${second}, and ${third}` : second !== void 0 ? `${first} and ${second}` : first ?? "";
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { valueReadsChangeText as t };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-reads-change-text-DcRCv7Zy-Ca8m3bal.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/value-reads-change-text-DcRCv7Zy.mjs"],"sourcesContent":["import { quotedList } from \"@internal/foundation/errors\";\n//#region src/dev/value-reads-change-text.ts\n/** Which reads changed, as a clause: `reads of \"shop.port\" were added and \"shop.key\" was changed`. */\nfunction valueReadsChangeText(change) {\n\tconst [first, second, third] = [\n\t\t...change.added.length > 0 ? [`reads of ${quotedList(change.added)} were added`] : [],\n\t\t...change.removed.length > 0 ? [`reads of ${quotedList(change.removed)} were removed`] : [],\n\t\t...change.changed.length > 0 ? [`${quotedList(change.changed)} ${change.changed.length === 1 ? \"was\" : \"were\"} changed`] : []\n\t];\n\treturn third !== void 0 ? `${first}, ${second}, and ${third}` : second !== void 0 ? `${first} and ${second}` : first ?? \"\";\n}\n//#endregion\nexport { valueReadsChangeText as t };\n\n//# sourceMappingURL=value-reads-change-text-DcRCv7Zy.mjs.map"],"mappings":";;;AAGA,SAAS,qBAAqB,QAAQ;CACrC,MAAM,CAAC,OAAO,QAAQ,SAAS;EAC9B,GAAG,OAAO,MAAM,SAAS,IAAI,CAAC,YAAY,WAAW,OAAO,KAAK,EAAE,YAAY,IAAI,CAAC;EACpF,GAAG,OAAO,QAAQ,SAAS,IAAI,CAAC,YAAY,WAAW,OAAO,OAAO,EAAE,cAAc,IAAI,CAAC;EAC1F,GAAG,OAAO,QAAQ,SAAS,IAAI,CAAC,GAAG,WAAW,OAAO,OAAO,EAAE,GAAG,OAAO,QAAQ,WAAW,IAAI,QAAQ,OAAO,SAAS,IAAI,CAAC;CAC7H;CACA,OAAO,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI,OAAO,QAAQ,UAAU,WAAW,KAAK,IAAI,GAAG,MAAM,OAAO,WAAW,SAAS;AACzH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/composer-cli",
|
|
3
|
-
"version": "0.39.0-dev.
|
|
3
|
+
"version": "0.39.0-dev.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Prisma Composer's command family, which the `prisma` CLI mounts as `deploy`, `deploy list`, `dev`, `dev url`, `dev stop` and `emulator list`.",
|
|
6
6
|
"exports": {
|
|
@@ -13,22 +13,22 @@
|
|
|
13
13
|
"src"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@prisma/composer": "0.39.0-dev.
|
|
16
|
+
"@prisma/composer": "0.39.0-dev.11",
|
|
17
17
|
"@prisma/management-api-sdk": "^1.80.0",
|
|
18
|
-
"alchemy": "2.0.0-beta.
|
|
18
|
+
"alchemy": "2.0.0-beta.87",
|
|
19
19
|
"cross-spawn": "^7.0.6",
|
|
20
|
-
"effect": "4.1.
|
|
20
|
+
"effect": "4.1.4",
|
|
21
21
|
"esbuild": "^0.28.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@prisma/cli-engine": "0.10.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@internal/cli": "0.39.0-dev.
|
|
28
|
-
"@internal/dev-emulators": "0.39.0-dev.
|
|
29
|
-
"@internal/foundation": "0.39.0-dev.
|
|
30
|
-
"@internal/lowering": "0.39.0-dev.
|
|
31
|
-
"@internal/tsdown-config": "0.39.0-dev.
|
|
27
|
+
"@internal/cli": "0.39.0-dev.11",
|
|
28
|
+
"@internal/dev-emulators": "0.39.0-dev.11",
|
|
29
|
+
"@internal/foundation": "0.39.0-dev.11",
|
|
30
|
+
"@internal/lowering": "0.39.0-dev.11",
|
|
31
|
+
"@internal/tsdown-config": "0.39.0-dev.11",
|
|
32
32
|
"@types/bun": "^1.3.13",
|
|
33
33
|
"@prisma/cli-engine": "0.10.0",
|
|
34
34
|
"@types/node": "^26.0.1",
|
package/src/exports/testing.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public surface (the `./testing` subpath): `createOperationsDouble`, the
|
|
3
3
|
* fixture-backed double of the operations the command family calls, for hosts that test how they
|
|
4
|
-
* mount the command family without running real deploys
|
|
5
|
-
* `renderDevStackFile`, the dev stack file `dev` writes, with `prepareSecondProcess`,
|
|
6
|
-
* the handover to the second process `dev` uses, for tests that drive Alchemy directly.
|
|
7
|
-
* `KnownSecrets` is here only to build the known secrets `prepareSecondProcess` refuses to write.
|
|
4
|
+
* mount the command family without running real deploys.
|
|
8
5
|
*/
|
|
9
6
|
export * from '@internal/cli/testing';
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { t as DEV_DIR } from "./app-config-CErnR6NK-DnKH4Kqc.mjs";
|
|
2
|
-
import { i as CliStructuredError } from "./result-sR7PBi61.mjs";
|
|
3
|
-
import * as fs from "node:fs";
|
|
4
|
-
import * as path from "node:path";
|
|
5
|
-
//#region ../../0-framework/3-tooling/cli/dist/app-configuration-file-CeJvBAti.mjs
|
|
6
|
-
/** Names the app configuration file the first process wrote for this run (ADR-0062). */
|
|
7
|
-
const APP_CONFIGURATION_FILE_ENV = "PRISMA_COMPOSER_APP_CONFIGURATION_FILE";
|
|
8
|
-
/** `prisma dev` only: the named secrets, as a JSON object. */
|
|
9
|
-
const NAMED_SECRETS_ENV = "PRISMA_COMPOSER_NAMED_SECRETS";
|
|
10
|
-
const FILE_NAME = /^app-configuration-(\d+)(-[^/]*)?\.json$/;
|
|
11
|
-
/** The app configuration file a deploy or destroy run writes: unique per run, so concurrent runs from one checkout never share one. */
|
|
12
|
-
function deployAppConfigurationFile(cwd, runId) {
|
|
13
|
-
return path.join(cwd, ".prisma-composer", `app-configuration-${String(process.pid)}-${runId}.json`);
|
|
14
|
-
}
|
|
15
|
-
/** The app configuration file `prisma dev` writes in an environment's folder. */
|
|
16
|
-
function devAppConfigurationFile(devDir) {
|
|
17
|
-
return path.join(devDir, `app-configuration-${String(process.pid)}.json`);
|
|
18
|
-
}
|
|
19
|
-
function isRunning(pid) {
|
|
20
|
-
try {
|
|
21
|
-
process.kill(pid, 0);
|
|
22
|
-
return true;
|
|
23
|
-
} catch (error) {
|
|
24
|
-
return error instanceof Error && "code" in error && error.code === "EPERM";
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Deletes the app configuration files that earlier runs left in `.prisma-composer/` and in
|
|
29
|
-
* each dev environment's folder: a run killed before its exit handler ran leaves its file. A
|
|
30
|
-
* file is deleted only when its process is not running and it is older than
|
|
31
|
-
* `LEFTOVER_APP_CONFIGURATION_FILE_AGE_MS`. Never throws.
|
|
32
|
-
*/
|
|
33
|
-
function removeLeftoverAppConfigurationFiles(cwd) {
|
|
34
|
-
const devRoot = path.join(cwd, DEV_DIR);
|
|
35
|
-
const dirs = [path.join(cwd, ".prisma-composer")];
|
|
36
|
-
try {
|
|
37
|
-
for (const entry of fs.readdirSync(devRoot, { withFileTypes: true })) if (entry.isDirectory()) dirs.push(path.join(devRoot, entry.name));
|
|
38
|
-
} catch {}
|
|
39
|
-
for (const dir of dirs) {
|
|
40
|
-
let names;
|
|
41
|
-
try {
|
|
42
|
-
names = fs.readdirSync(dir);
|
|
43
|
-
} catch {
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
for (const name of names) {
|
|
47
|
-
const pid = Number(FILE_NAME.exec(name)?.[1]);
|
|
48
|
-
if (Number.isNaN(pid) || pid === process.pid || isRunning(pid)) continue;
|
|
49
|
-
const file = path.join(dir, name);
|
|
50
|
-
try {
|
|
51
|
-
if (Date.now() - fs.statSync(file).mtimeMs < 6e5) continue;
|
|
52
|
-
fs.rmSync(file, { force: true });
|
|
53
|
-
} catch {}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function textIn(value, at) {
|
|
58
|
-
if (typeof value === "string") return [{
|
|
59
|
-
at,
|
|
60
|
-
text: value
|
|
61
|
-
}];
|
|
62
|
-
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return [{
|
|
63
|
-
at,
|
|
64
|
-
text: String(value)
|
|
65
|
-
}];
|
|
66
|
-
if (Array.isArray(value)) return value.flatMap((member, index) => textIn(member, [...at, String(index)]));
|
|
67
|
-
if (typeof value === "object" && value !== null) return Object.entries(value).flatMap(([key, member]) => textIn(member, [...at, key]));
|
|
68
|
-
return [];
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Refuses when the file would hold a known secret in a plain value, a number or a boolean
|
|
72
|
-
* compared as its text (`KnownSecrets.nameIn`). The message names where and the secrets key,
|
|
73
|
-
* never the value.
|
|
74
|
-
*/
|
|
75
|
-
function refuseSecretsIn(read, knownSecrets) {
|
|
76
|
-
const places = [...read.rootInput.flatMap((field) => textIn(field.value, field.path).map(({ at, text }) => ({
|
|
77
|
-
where: `Root input field input.${at.join(".")}`,
|
|
78
|
-
text
|
|
79
|
-
}))), ...Object.entries(read.configurationKeyText).map(([key, text]) => ({
|
|
80
|
-
where: `Configuration key "${key}"`,
|
|
81
|
-
text
|
|
82
|
-
}))];
|
|
83
|
-
for (const { where, text } of places) {
|
|
84
|
-
const name = knownSecrets.nameIn(text);
|
|
85
|
-
if (name === void 0) continue;
|
|
86
|
-
throw new CliStructuredError("CONFIG.SECRET_AS_PLAIN_VALUE", `${where} holds the value of the secret "${name}", which an envSecret() in the graph reads. Composer hands the second process every plain value Load read, in a file, and never writes a secret to a file.`, { fix: `Read the secret with envSecret('${name}') where it is used, or give this plain value text that does not contain the value of "${name}".` });
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* First process: the handover to the second process (ADR-0062). The app configuration file at
|
|
91
|
-
* `file` holds what Load read and the graph's node addresses. With `appSecrets`, which only
|
|
92
|
-
* `prisma dev` passes, the environment also carries the named secrets: the app secrets under
|
|
93
|
-
* the graph's secrets keys, each with text. Refuses when the file would hold any of
|
|
94
|
-
* `knownSecrets`. Every other input is plain data from the graph, such as
|
|
95
|
-
* `graph.appConfigurationRead`, `nodeAddresses(graph)` and `secretsKeys(graph)`, so a caller with
|
|
96
|
-
* its own copy of Composer's core can pass them. The exception is `knownSecrets`, a
|
|
97
|
-
* `KnownSecrets`, which such a caller builds from the testing entry.
|
|
98
|
-
*/
|
|
99
|
-
function prepareSecondProcess(input) {
|
|
100
|
-
const { file, appSecrets } = input;
|
|
101
|
-
refuseSecretsIn(input.appConfigurationRead, input.knownSecrets);
|
|
102
|
-
const contents = {
|
|
103
|
-
appConfigurationRead: input.appConfigurationRead,
|
|
104
|
-
nodeAddresses: input.nodeAddresses
|
|
105
|
-
};
|
|
106
|
-
const env = { [APP_CONFIGURATION_FILE_ENV]: file };
|
|
107
|
-
if (appSecrets !== void 0) {
|
|
108
|
-
const named = {};
|
|
109
|
-
for (const key of input.secretsKeys) {
|
|
110
|
-
const text = appSecrets[key];
|
|
111
|
-
if (text !== void 0 && text !== "") named[key] = text;
|
|
112
|
-
}
|
|
113
|
-
env[NAMED_SECRETS_ENV] = JSON.stringify(named);
|
|
114
|
-
}
|
|
115
|
-
const remove = () => {
|
|
116
|
-
try {
|
|
117
|
-
fs.rmSync(file, { force: true });
|
|
118
|
-
} catch {}
|
|
119
|
-
};
|
|
120
|
-
return {
|
|
121
|
-
env,
|
|
122
|
-
writeFile() {
|
|
123
|
-
fs.rmSync(file, { force: true });
|
|
124
|
-
fs.writeFileSync(file, JSON.stringify(contents), {
|
|
125
|
-
mode: 384,
|
|
126
|
-
flag: "wx"
|
|
127
|
-
});
|
|
128
|
-
process.off("exit", remove);
|
|
129
|
-
process.on("exit", remove);
|
|
130
|
-
},
|
|
131
|
-
removeFile() {
|
|
132
|
-
process.off("exit", remove);
|
|
133
|
-
remove();
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
//#endregion
|
|
138
|
-
export { removeLeftoverAppConfigurationFiles as i, devAppConfigurationFile as n, prepareSecondProcess as r, deployAppConfigurationFile as t };
|
|
139
|
-
|
|
140
|
-
//# sourceMappingURL=app-configuration-file-CeJvBAti-DA4EKwFq.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-configuration-file-CeJvBAti-DA4EKwFq.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/app-configuration-file-CeJvBAti.mjs"],"sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { DEV_DIR } from \"@internal/core/config\";\n//#region src/app-configuration-file.ts\n/** Names the app configuration file the first process wrote for this run (ADR-0062). */\nconst APP_CONFIGURATION_FILE_ENV = \"PRISMA_COMPOSER_APP_CONFIGURATION_FILE\";\n/** `prisma dev` only: the named secrets, as a JSON object. */\nconst NAMED_SECRETS_ENV = \"PRISMA_COMPOSER_NAMED_SECRETS\";\nconst FILE_NAME = /^app-configuration-(\\d+)(-[^/]*)?\\.json$/;\n/** The app configuration file a deploy or destroy run writes: unique per run, so concurrent runs from one checkout never share one. */\nfunction deployAppConfigurationFile(cwd, runId) {\n\treturn path.join(cwd, \".prisma-composer\", `app-configuration-${String(process.pid)}-${runId}.json`);\n}\n/** The app configuration file `prisma dev` writes in an environment's folder. */\nfunction devAppConfigurationFile(devDir) {\n\treturn path.join(devDir, `app-configuration-${String(process.pid)}.json`);\n}\nfunction isRunning(pid) {\n\ttry {\n\t\tprocess.kill(pid, 0);\n\t\treturn true;\n\t} catch (error) {\n\t\treturn error instanceof Error && \"code\" in error && error.code === \"EPERM\";\n\t}\n}\n/**\n* Deletes the app configuration files that earlier runs left in `.prisma-composer/` and in\n* each dev environment's folder: a run killed before its exit handler ran leaves its file. A\n* file is deleted only when its process is not running and it is older than\n* `LEFTOVER_APP_CONFIGURATION_FILE_AGE_MS`. Never throws.\n*/\nfunction removeLeftoverAppConfigurationFiles(cwd) {\n\tconst devRoot = path.join(cwd, DEV_DIR);\n\tconst dirs = [path.join(cwd, \".prisma-composer\")];\n\ttry {\n\t\tfor (const entry of fs.readdirSync(devRoot, { withFileTypes: true })) if (entry.isDirectory()) dirs.push(path.join(devRoot, entry.name));\n\t} catch {}\n\tfor (const dir of dirs) {\n\t\tlet names;\n\t\ttry {\n\t\t\tnames = fs.readdirSync(dir);\n\t\t} catch {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const name of names) {\n\t\t\tconst pid = Number(FILE_NAME.exec(name)?.[1]);\n\t\t\tif (Number.isNaN(pid) || pid === process.pid || isRunning(pid)) continue;\n\t\t\tconst file = path.join(dir, name);\n\t\t\ttry {\n\t\t\t\tif (Date.now() - fs.statSync(file).mtimeMs < 6e5) continue;\n\t\t\t\tfs.rmSync(file, { force: true });\n\t\t\t} catch {}\n\t\t}\n\t}\n}\nfunction textIn(value, at) {\n\tif (typeof value === \"string\") return [{\n\t\tat,\n\t\ttext: value\n\t}];\n\tif (typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"bigint\") return [{\n\t\tat,\n\t\ttext: String(value)\n\t}];\n\tif (Array.isArray(value)) return value.flatMap((member, index) => textIn(member, [...at, String(index)]));\n\tif (typeof value === \"object\" && value !== null) return Object.entries(value).flatMap(([key, member]) => textIn(member, [...at, key]));\n\treturn [];\n}\n/**\n* Refuses when the file would hold a known secret in a plain value, a number or a boolean\n* compared as its text (`KnownSecrets.nameIn`). The message names where and the secrets key,\n* never the value.\n*/\nfunction refuseSecretsIn(read, knownSecrets) {\n\tconst places = [...read.rootInput.flatMap((field) => textIn(field.value, field.path).map(({ at, text }) => ({\n\t\twhere: `Root input field input.${at.join(\".\")}`,\n\t\ttext\n\t}))), ...Object.entries(read.configurationKeyText).map(([key, text]) => ({\n\t\twhere: `Configuration key \"${key}\"`,\n\t\ttext\n\t}))];\n\tfor (const { where, text } of places) {\n\t\tconst name = knownSecrets.nameIn(text);\n\t\tif (name === void 0) continue;\n\t\tthrow new CliStructuredError(\"CONFIG.SECRET_AS_PLAIN_VALUE\", `${where} holds the value of the secret \"${name}\", which an envSecret() in the graph reads. Composer hands the second process every plain value Load read, in a file, and never writes a secret to a file.`, { fix: `Read the secret with envSecret('${name}') where it is used, or give this plain value text that does not contain the value of \"${name}\".` });\n\t}\n}\n/**\n* First process: the handover to the second process (ADR-0062). The app configuration file at\n* `file` holds what Load read and the graph's node addresses. With `appSecrets`, which only\n* `prisma dev` passes, the environment also carries the named secrets: the app secrets under\n* the graph's secrets keys, each with text. Refuses when the file would hold any of\n* `knownSecrets`. Every other input is plain data from the graph, such as\n* `graph.appConfigurationRead`, `nodeAddresses(graph)` and `secretsKeys(graph)`, so a caller with\n* its own copy of Composer's core can pass them. The exception is `knownSecrets`, a\n* `KnownSecrets`, which such a caller builds from the testing entry.\n*/\nfunction prepareSecondProcess(input) {\n\tconst { file, appSecrets } = input;\n\trefuseSecretsIn(input.appConfigurationRead, input.knownSecrets);\n\tconst contents = {\n\t\tappConfigurationRead: input.appConfigurationRead,\n\t\tnodeAddresses: input.nodeAddresses\n\t};\n\tconst env = { [APP_CONFIGURATION_FILE_ENV]: file };\n\tif (appSecrets !== void 0) {\n\t\tconst named = {};\n\t\tfor (const key of input.secretsKeys) {\n\t\t\tconst text = appSecrets[key];\n\t\t\tif (text !== void 0 && text !== \"\") named[key] = text;\n\t\t}\n\t\tenv[NAMED_SECRETS_ENV] = JSON.stringify(named);\n\t}\n\tconst remove = () => {\n\t\ttry {\n\t\t\tfs.rmSync(file, { force: true });\n\t\t} catch {}\n\t};\n\treturn {\n\t\tenv,\n\t\twriteFile() {\n\t\t\tfs.rmSync(file, { force: true });\n\t\t\tfs.writeFileSync(file, JSON.stringify(contents), {\n\t\t\t\tmode: 384,\n\t\t\t\tflag: \"wx\"\n\t\t\t});\n\t\t\tprocess.off(\"exit\", remove);\n\t\t\tprocess.on(\"exit\", remove);\n\t\t},\n\t\tremoveFile() {\n\t\t\tprocess.off(\"exit\", remove);\n\t\t\tremove();\n\t\t}\n\t};\n}\nfunction missingVariable(name, what) {\n\treturn `${name} is not set. This stack file runs as the second process of a Composer deploy, destroy or prisma dev, which ${what}.`;\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction isTextList(value) {\n\treturn Array.isArray(value) && value.every((member) => typeof member === \"string\");\n}\nfunction rootFieldsOf(value) {\n\tif (!Array.isArray(value)) return void 0;\n\tconst fields = [];\n\tfor (const member of value) {\n\t\tif (!isRecord(member) || !isTextList(member[\"path\"])) return void 0;\n\t\tfields.push(\"value\" in member ? {\n\t\t\tpath: member[\"path\"],\n\t\t\tvalue: member[\"value\"]\n\t\t} : { path: member[\"path\"] });\n\t}\n\treturn fields;\n}\nfunction textByKeyOf(value) {\n\tif (!isRecord(value)) return void 0;\n\tconst byKey = {};\n\tfor (const [key, member] of Object.entries(value)) {\n\t\tif (typeof member !== \"string\") return void 0;\n\t\tbyKey[key] = member;\n\t}\n\treturn byKey;\n}\n/** Second process: the app configuration file the first process named in its environment. */\nfunction readAppConfigurationFile(env) {\n\tconst file = env[APP_CONFIGURATION_FILE_ENV];\n\tif (file === void 0 || file === \"\") throw new Error(missingVariable(APP_CONFIGURATION_FILE_ENV, \"names the app configuration file it wrote there\"));\n\tlet text;\n\ttry {\n\t\ttext = fs.readFileSync(file, \"utf8\");\n\t} catch (cause) {\n\t\tconst message = cause instanceof Error ? cause.message : String(cause);\n\t\tthrow new Error(`Could not read the app configuration file ${file}: ${message}. Composer deletes it when the run ends, so a stack file run by hand after that cannot read it; run the command again.`, { cause });\n\t}\n\tconst notComposers = (what) => /* @__PURE__ */ new Error(`The app configuration file ${file} is not one Composer wrote: ${what}.`);\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch {\n\t\tthrow notComposers(\"it is not JSON\");\n\t}\n\tif (!isRecord(parsed)) throw notComposers(\"it is not JSON\");\n\tconst read = parsed[\"appConfigurationRead\"];\n\tif (!isRecord(read)) throw notComposers(\"appConfigurationRead is not an object\");\n\tconst rootInput = rootFieldsOf(read[\"rootInput\"]);\n\tif (rootInput === void 0) throw notComposers(\"rootInput is not a list of fields\");\n\tconst configurationKeyText = textByKeyOf(read[\"configurationKeyText\"]);\n\tif (configurationKeyText === void 0) throw notComposers(\"configurationKeyText is not an object of text\");\n\tconst addresses = parsed[\"nodeAddresses\"];\n\tif (!isTextList(addresses)) throw notComposers(\"nodeAddresses is not a list of node addresses\");\n\treturn {\n\t\tappConfigurationRead: {\n\t\t\trootInput,\n\t\t\tconfigurationKeyText\n\t\t},\n\t\tnodeAddresses: addresses\n\t};\n}\n/** Second process, under `prisma dev`: the named secrets the first process handed it. */\nfunction namedSecretsFromEnvironment(env) {\n\tconst text = env[NAMED_SECRETS_ENV];\n\tif (text === void 0 || text === \"\") throw new Error(missingVariable(NAMED_SECRETS_ENV, \"hands the secrets the local services need there\"));\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch {\n\t\tparsed = void 0;\n\t}\n\tconst byKey = textByKeyOf(parsed);\n\tif (byKey === void 0) throw new Error(`${NAMED_SECRETS_ENV} is not a JSON object of text.`);\n\tconst secrets = Object.create(null);\n\tObject.assign(secrets, byKey);\n\treturn Object.freeze(secrets);\n}\n//#endregion\nexport { readAppConfigurationFile as a, prepareSecondProcess as i, devAppConfigurationFile as n, removeLeftoverAppConfigurationFiles as o, namedSecretsFromEnvironment as r, deployAppConfigurationFile as t };\n\n//# sourceMappingURL=app-configuration-file-CeJvBAti.mjs.map"],"mappings":";;;;;;AAMA,MAAM,6BAA6B;;AAEnC,MAAM,oBAAoB;AAC1B,MAAM,YAAY;;AAElB,SAAS,2BAA2B,KAAK,OAAO;CAC/C,OAAO,KAAK,KAAK,KAAK,oBAAoB,qBAAqB,OAAO,QAAQ,GAAG,EAAE,GAAG,MAAM,MAAM;AACnG;;AAEA,SAAS,wBAAwB,QAAQ;CACxC,OAAO,KAAK,KAAK,QAAQ,qBAAqB,OAAO,QAAQ,GAAG,EAAE,MAAM;AACzE;AACA,SAAS,UAAU,KAAK;CACvB,IAAI;EACH,QAAQ,KA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AAI;GACH,GAAG,OAAO,MAAM,EAAE,OAAO,KAAK,CAAC;EAChC,QAAQ,CAAC;CACV;CACA,OAAO;EACN;EACA,YAAY;GACX,GAAG,OAAO,MAAM,EAAE,OAAO,KAAK,CAAC;GAC/B,GAAG,cAAc,MAAM,KAAK,UAAU,QAAQ,GAAG;IAChD,MAAM;IACN,MAAM;GACP,CAAC;GACD,QAAQ,IAAI,QAAQ,MAAM;GAC1B,QAAQ,GAAG,QAAQ,MAAM;EAC1B;EACA,aAAa;GACZ,QAAQ,IAAI,QAAQ,MAAM;GAC1B,OAAO;EACR;CACD;AACD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-current-wD5YDLjA-CFI8XTAK.mjs","names":[],"sources":["../../../0-framework/3-tooling/cli/dist/dev-current-wD5YDLjA.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/foundation/errors\";\nimport { blindCast } from \"@internal/foundation/casts\";\nimport { notOk, ok } from \"@internal/foundation/result\";\n//#region src/operations/shared.ts\n/**\n* Reads the execution diagnostics an engine-failure error carries in\n* `meta.diagnostics`; undefined for every other failure.\n*/\nfunction executionDiagnostics(f) {\n\tconst diagnostics = f.meta?.[\"diagnostics\"];\n\tif (typeof diagnostics !== \"object\" || diagnostics === null) return void 0;\n\tconst candidate = blindCast(diagnostics);\n\tif (candidate[\"exitCode\"] !== void 0 && typeof candidate[\"exitCode\"] !== \"number\" || candidate[\"signal\"] !== void 0 && typeof candidate[\"signal\"] !== \"string\" || typeof candidate[\"stackFilePath\"] !== \"string\" || typeof candidate[\"reproduceCommand\"] !== \"string\" || typeof candidate[\"cwd\"] !== \"string\") return;\n\treturn blindCast(diagnostics);\n}\n/**\n* Site-specific wrap for foreign extension/environment causes — passthrough\n* when already structured; never a boundary fallback (base-type rule 6(ii)).\n*/\nfunction toStructured(code, error) {\n\treturn CliStructuredError.is(error) ? error : new CliStructuredError(code, error instanceof Error ? error.message : String(error), { cause: error });\n}\n/** A failed executor import: an environmental failure of the consumer's\n* installed tree, not a bug here. The import error rides as the cause. */\nfunction executorLoadFailure(operation, error) {\n\treturn new CliStructuredError(\"DEPS.EXECUTOR_UNLOADABLE\", `Could not load the ${operation} executor: ${error instanceof Error ? error.message : String(error)}`, {\n\t\twhy: `The ${operation} operation's executor imports the deploy engine's provider tree from your app's installed dependencies, and that import failed.`,\n\t\tfix: \"Reinstall your dependencies, and check that `alchemy` is installed and loadable from your app.\",\n\t\tcause: error\n\t});\n}\nconst RUN_OF = {\n\tdeploy: {\n\t\trunning: \"this deploy\",\n\t\truns: \"the deploy\"\n\t},\n\tdestroy: {\n\t\trunning: \"this destroy\",\n\t\truns: \"the destroy\"\n\t},\n\tdev: {\n\t\trunning: \"`prisma dev`\",\n\t\truns: \"`prisma dev`\"\n\t}\n};\n/**\n* An extension older than this Composer stores the input it is given but\n* resolves from a key without `environment`, so it may read every name as\n* production, or, locally, put every environment in one copy. Its\n* `deserialize` rebuilds only the fields it knows, so the container the\n* Alchemy child rebuilds shows which environment it really resolved.\n* Refusing here keeps a mismatched install from deploying into, destroying\n* or running the wrong place.\n*/\nfunction requireContainerForEnvironment(action, extensionId, descriptor, instance, environment) {\n\tlet rebuiltEnvironment;\n\ttry {\n\t\trebuiltEnvironment = descriptor.deserialize(instance.serialize()).input.environment;\n\t} catch {\n\t\trebuiltEnvironment = void 0;\n\t}\n\tif (rebuiltEnvironment === environment) return;\n\tconst { running, runs } = RUN_OF[action];\n\tthrow new CliStructuredError(\"DEPS.EXTENSION_INCOMPATIBLE\", `The extension ${extensionId} is older than the Composer running ${running}, so it would not resolve the environment ${environment}.`, { fix: `Install the same Composer version of ${extensionId} as the Composer that runs ${runs}.` });\n}\n//#endregion\n//#region src/operations/deploy.ts\n/** The environment `deploy` targets when none is named. */\nconst DEFAULT_DEPLOY_ENVIRONMENT = \"production\";\nasync function deploy(input) {\n\treturn deployWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function deployWithDeps(input, deps) {\n\tconst startedAt = performance.now();\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-deploy-destroy-DOzo2Psp.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"deploy\", error));\n\t}\n\tconst result = await executor.executeDeploy(input, deps, cwd);\n\tif (!result.ok) return result;\n\treturn ok({\n\t\t...result.value,\n\t\tdurationMs: Math.round(performance.now() - startedAt)\n\t});\n}\n//#endregion\n//#region src/operations/dev.ts\nasync function dev(input) {\n\treturn devWithDeps(input, {});\n}\n/** In-package variant threading the injection seam, which the family's\n* commands and the unit tests use. Deliberately NOT re-exported through `./control` — the seam mirrors\n* internal types and is not part of the published surface. */\nasync function devWithDeps(input, deps) {\n\tconst cwd = input.cwd ?? process.cwd();\n\tlet executor;\n\ttry {\n\t\texecutor = await import(\"./execute-dev-BIyOI3Ys.mjs\");\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(\"dev\", error));\n\t}\n\treturn executor.executeDev(input, deps, cwd);\n}\n//#endregion\n//#region src/operations/dev-current.ts\nasync function loadExecutor(operation) {\n\ttry {\n\t\treturn ok(await import(\"./execute-dev-current-CKOzjWuO.mjs\"));\n\t} catch (error) {\n\t\treturn notOk(executorLoadFailure(operation, error));\n\t}\n}\n/** Where the node at `input.address` runs locally in the environment. */\nasync function devUrl(input) {\n\tconst executor = await loadExecutor(\"dev url\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevUrl(input, input.cwd ?? process.cwd());\n}\n/** Stops the app's local copy in the environment: its service processes and database servers. Data and ports stay. */\nasync function devStop(input) {\n\tconst executor = await loadExecutor(\"dev stop\");\n\tif (!executor.ok) return executor;\n\treturn executor.value.executeDevStop(input, input.cwd ?? process.cwd());\n}\n//#endregion\nexport { DEFAULT_DEPLOY_ENVIRONMENT as a, executionDiagnostics as c, toStructured as d, devWithDeps as i, executorLoadFailure as l, devUrl as n, deploy as o, dev as r, deployWithDeps as s, devStop as t, requireContainerForEnvironment as u };\n\n//# sourceMappingURL=dev-current-wD5YDLjA.mjs.map"],"mappings":";;;;;;AAQA,SAAS,qBAAqB,GAAG;CAChC,MAAM,cAAc,EAAE,OAAO;CAC7B,IAAI,OAAO,gBAAgB,YAAY,gBAAgB,MAAM,OAAO,KAAK;CACzE,MAAM,YAAY,UAAU,WAAW;CACvC,IAAI,UAAU,gBAAgB,KAAK,KAAK,OAAO,UAAU,gBAAgB,YAAY,UAAU,cAAc,KAAK,KAAK,OAAO,UAAU,cAAc,YAAY,OAAO,UAAU,qBAAqB,YAAY,OAAO,UAAU,wBAAwB,YAAY,OAAO,UAAU,WAAW,UAAU;CAC/S,OAAO,UAAU,WAAW;AAC7B;;;;;AAKA,SAAS,aAAa,MAAM,OAAO;CAClC,OAAO,mBAAmB,GAAG,KAAK,IAAI,QAAQ,IAAI,mBAAmB,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG,EAAE,OAAO,MAAM,CAAC;AACpJ;;;AAGA,SAAS,oBAAoB,WAAW,OAAO;CAC9C,OAAO,IAAI,mBAAmB,4BAA4B,sBAAsB,UAAU,aAAa,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,KAAK;EAChK,KAAK,OAAO,UAAU;EACtB,KAAK;EACL,OAAO;CACR,CAAC;AACF;AACA,MAAM,SAAS;CACd,QAAQ;EACP,SAAS;EACT,MAAM;CACP;CACA,SAAS;EACR,SAAS;EACT,MAAM;CACP;CACA,KAAK;EACJ,SAAS;EACT,MAAM;CACP;AACD;;;;;;;;;;AAUA,SAAS,+BAA+B,QAAQ,aAAa,YAAY,UAAU,aAAa;CAC/F,IAAI;CACJ,IAAI;EACH,qBAAqB,WAAW,YAAY,SAAS,UAAU,CAAC,CAAC,CAAC,MAAM;CACzE,QAAQ;EACP,qBAAqB,KAAK;CAC3B;CACA,IAAI,uBAAuB,aAAa;CACx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U;CAC9C,IAAI,CAAC,SAAS,IAAI,OAAO;CACzB,OAAO,SAAS,MAAM,eAAe,OAAO,MAAM,OAAO,QAAQ,IAAI,CAAC;AACvE"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { i as isBuildOnlyExtension, n as DEV_ENVIRONMENT_NAME_FILE } from "./app-config-CErnR6NK-DnKH4Kqc.mjs";
|
|
2
|
-
import { i as CliStructuredError } from "./result-sR7PBi61.mjs";
|
|
3
|
-
import * as fs from "node:fs";
|
|
4
|
-
import * as path from "node:path";
|
|
5
|
-
import "effect/Layer";
|
|
6
|
-
import "alchemy/State/LocalState";
|
|
7
|
-
//#region ../../0-framework/1-core/core/dist/local-target.mjs
|
|
8
|
-
/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, "dev" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */
|
|
9
|
-
function noLocalTargetSupportError(id) {
|
|
10
|
-
return new CliStructuredError("DEV.TARGET_UNSUPPORTED", `extension "${id}" has no dev support — it declares no \`localTarget\` descriptor (ADR-0041).`);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Resolves every non-build-only configured extension's lazy `localTarget`
|
|
14
|
-
* thunk, once (ADR-0041's lazy local-target reference — operator directive:
|
|
15
|
-
* the production control entry carries only the thunk, never the
|
|
16
|
-
* descriptor, so resolving it is this module's job, not something a deploy
|
|
17
|
-
* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no
|
|
18
|
-
* resources or services and is skipped entirely — never even checked for a
|
|
19
|
-
* `localTarget` thunk. Every other configured extension must be
|
|
20
|
-
* local-target-capable, or the dev command cannot bring the app up at all,
|
|
21
|
-
* so a missing thunk throws naming the extension. The generated dev stack
|
|
22
|
-
* module calls this once and threads the resolved map through every
|
|
23
|
-
* subsequent hook, including `localTargetProviders`.
|
|
24
|
-
*/
|
|
25
|
-
async function resolveLocalTargets(config) {
|
|
26
|
-
const entries = await Promise.all(config.extensions.flatMap((extension) => {
|
|
27
|
-
if (isBuildOnlyExtension(extension)) return [];
|
|
28
|
-
if (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);
|
|
29
|
-
return [extension.localTarget().then((descriptor) => [extension.id, descriptor])];
|
|
30
|
-
}));
|
|
31
|
-
return new Map(entries);
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region ../../0-framework/3-tooling/cli/dist/dev-environment-name-6eEr5PW8.mjs
|
|
35
|
-
/**
|
|
36
|
-
* Each environment's folder records the environment's exact name. On a
|
|
37
|
-
* case-insensitive filesystem `--environment Dev` would otherwise open the
|
|
38
|
-
* folder of `dev` and run, or `--fresh` delete, that copy.
|
|
39
|
-
*/
|
|
40
|
-
function recordedName(devDir) {
|
|
41
|
-
const file = path.join(devDir, DEV_ENVIRONMENT_NAME_FILE);
|
|
42
|
-
return fs.existsSync(file) ? fs.readFileSync(file, "utf8").trim() : void 0;
|
|
43
|
-
}
|
|
44
|
-
function nameMismatch(devDir, recorded, environment) {
|
|
45
|
-
return new CliStructuredError("DEV.ENVIRONMENT_NAME_MISMATCH", `The folder ${devDir} holds the local copy of the environment ${recorded}, not ${environment}.`, {
|
|
46
|
-
why: "On a case-insensitive filesystem, such as the default on macOS, environment names that differ only in case share one folder, so they cannot be separate local copies.",
|
|
47
|
-
fix: `Pass \`--environment ${recorded}\` for that copy, or pick a name that differs from ${recorded} by more than case.`,
|
|
48
|
-
meta: {
|
|
49
|
-
devDir,
|
|
50
|
-
recorded,
|
|
51
|
-
environment
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
/** Fails when the folder records another environment's name; a folder with no name recorded passes. */
|
|
56
|
-
function requireDevEnvironmentName(devDir, environment) {
|
|
57
|
-
const recorded = recordedName(devDir);
|
|
58
|
-
if (recorded !== void 0 && recorded !== environment) throw nameMismatch(devDir, recorded, environment);
|
|
59
|
-
}
|
|
60
|
-
/** Records the environment's name in its folder on first use; fails when the folder records another name. */
|
|
61
|
-
function claimDevEnvironmentName(devDir, environment) {
|
|
62
|
-
const recorded = recordedName(devDir);
|
|
63
|
-
if (recorded === environment) return;
|
|
64
|
-
if (recorded !== void 0) throw nameMismatch(devDir, recorded, environment);
|
|
65
|
-
fs.mkdirSync(devDir, { recursive: true });
|
|
66
|
-
fs.writeFileSync(path.join(devDir, DEV_ENVIRONMENT_NAME_FILE), `${environment}\n`);
|
|
67
|
-
}
|
|
68
|
-
//#endregion
|
|
69
|
-
export { requireDevEnvironmentName as n, resolveLocalTargets as r, claimDevEnvironmentName as t };
|
|
70
|
-
|
|
71
|
-
//# sourceMappingURL=dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-environment-name-6eEr5PW8-Bs4Dl0vW.mjs","names":[],"sources":["../../../0-framework/1-core/core/dist/local-target.mjs","../../../0-framework/3-tooling/cli/dist/dev-environment-name-6eEr5PW8.mjs"],"sourcesContent":["import { a as isBuildOnlyExtension, i as devEnvironmentDir, n as DEV_ENVIRONMENT_NAME_FILE, t as DEV_DIR } from \"./app-config-CErnR6NK.mjs\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport * as Layer from \"effect/Layer\";\nimport { localState } from \"alchemy/State/LocalState\";\n//#region src/control/local-target.ts\n/** The local-target stack's own provider aggregation (ADR-0041; naming, operator 2026-07-23 — the seam is `localTarget`, \"dev\" names the user-facing feature only) — the local-target counterpart of `deploy.ts`'s `mergedProviders`, kept in its own module so `lower()` learns nothing about it (deploy.ts's REVISED — operator review of #162). */\nfunction noLocalTargetSupportError(id) {\n\treturn new CliStructuredError(\"DEV.TARGET_UNSUPPORTED\", `extension \"${id}\" has no dev support — it declares no \\`localTarget\\` descriptor (ADR-0041).`);\n}\n/**\n* Resolves every non-build-only configured extension's lazy `localTarget`\n* thunk, once (ADR-0041's lazy local-target reference — operator directive:\n* the production control entry carries only the thunk, never the\n* descriptor, so resolving it is this module's job, not something a deploy\n* path ever does). A build-only extension (`isBuildOnlyExtension`) owns no\n* resources or services and is skipped entirely — never even checked for a\n* `localTarget` thunk. Every other configured extension must be\n* local-target-capable, or the dev command cannot bring the app up at all,\n* so a missing thunk throws naming the extension. The generated dev stack\n* module calls this once and threads the resolved map through every\n* subsequent hook, including `localTargetProviders`.\n*/\nasync function resolveLocalTargets(config) {\n\tconst entries = await Promise.all(config.extensions.flatMap((extension) => {\n\t\tif (isBuildOnlyExtension(extension)) return [];\n\t\tif (extension.localTarget === void 0) throw noLocalTargetSupportError(extension.id);\n\t\treturn [extension.localTarget().then((descriptor) => [extension.id, descriptor])];\n\t}));\n\treturn new Map(entries);\n}\n/**\n* All configured extensions' local-target providers merged, config array\n* order (ADR-0041), from the ALREADY-RESOLVED descriptor map\n* (`resolveLocalTargets`'s product — this function itself never touches a\n* `localTarget` thunk). The generated dev stack module is this\n* aggregator's one caller, passing the result as `LowerOptions.providers`.\n*/\nfunction localTargetProviders(resolved, containers, devDir, configurationKeyText, namedSecrets) {\n\tconst [first, ...rest] = [...resolved.entries()].map(([id, descriptor]) => descriptor.providers({\n\t\tcontainer: containers.get(id),\n\t\tdevDir,\n\t\tconfigurationKeyText,\n\t\tnamedSecrets\n\t}));\n\treturn first === void 0 ? Layer.empty : Layer.mergeAll(first, ...rest);\n}\n/** The state store `prisma dev` converges against: Alchemy's file store in the app's working directory. */\nfunction devState() {\n\treturn localState();\n}\n//#endregion\nexport { DEV_DIR, DEV_ENVIRONMENT_NAME_FILE, devEnvironmentDir, devState, localTargetProviders, resolveLocalTargets };\n\n//# sourceMappingURL=local-target.mjs.map","import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { CliStructuredError } from \"@internal/foundation/errors\";\nimport { DEV_ENVIRONMENT_NAME_FILE } from \"@internal/core/local-target\";\n//#region src/operations/dev-environment-name.ts\n/**\n* Each environment's folder records the environment's exact name. On a\n* case-insensitive filesystem `--environment Dev` would otherwise open the\n* folder of `dev` and run, or `--fresh` delete, that copy.\n*/\nfunction recordedName(devDir) {\n\tconst file = path.join(devDir, DEV_ENVIRONMENT_NAME_FILE);\n\treturn fs.existsSync(file) ? fs.readFileSync(file, \"utf8\").trim() : void 0;\n}\nfunction nameMismatch(devDir, recorded, environment) {\n\treturn new CliStructuredError(\"DEV.ENVIRONMENT_NAME_MISMATCH\", `The folder ${devDir} holds the local copy of the environment ${recorded}, not ${environment}.`, {\n\t\twhy: \"On a case-insensitive filesystem, such as the default on macOS, environment names that differ only in case share one folder, so they cannot be separate local copies.\",\n\t\tfix: `Pass \\`--environment ${recorded}\\` for that copy, or pick a name that differs from ${recorded} by more than case.`,\n\t\tmeta: {\n\t\t\tdevDir,\n\t\t\trecorded,\n\t\t\tenvironment\n\t\t}\n\t});\n}\n/** Fails when the folder records another environment's name; a folder with no name recorded passes. */\nfunction requireDevEnvironmentName(devDir, environment) {\n\tconst recorded = recordedName(devDir);\n\tif (recorded !== void 0 && recorded !== environment) throw nameMismatch(devDir, recorded, environment);\n}\n/** Records the environment's name in its folder on first use; fails when the folder records another name. */\nfunction claimDevEnvironmentName(devDir, environment) {\n\tconst recorded = recordedName(devDir);\n\tif (recorded === environment) return;\n\tif (recorded !== void 0) throw nameMismatch(devDir, recorded, environment);\n\tfs.mkdirSync(devDir, { recursive: true });\n\tfs.writeFileSync(path.join(devDir, DEV_ENVIRONMENT_NAME_FILE), `${environment}\\n`);\n}\n//#endregion\nexport { requireDevEnvironmentName as n, claimDevEnvironmentName as t };\n\n//# sourceMappingURL=dev-environment-name-6eEr5PW8.mjs.map"],"mappings":";;;;;;;;AAMA,SAAS,0BAA0B,IAAI;CACtC,OAAO,IAAI,mBAAmB,0BAA0B,cAAc,GAAG,6EAA6E;AACvJ;;;;;;;;;;;;;;AAcA,eAAe,oBAAoB,QAAQ;CAC1C,MAAM,UAAU,MAAM,QAAQ,IAAI,OAAO,WAAW,SAAS,cAAc;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