@prisma/composer-cli 0.36.0-dev.6 → 0.36.0-dev.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{app-config-CErnR6NK-6QjHJ7q5.mjs → app-config-CErnR6NK-DnKH4Kqc.mjs} +2 -2
  2. package/dist/{app-config-CErnR6NK-6QjHJ7q5.mjs.map → app-config-CErnR6NK-DnKH4Kqc.mjs.map} +1 -1
  3. package/dist/app-configuration-file-CeJvBAti-Dk65W3Az.mjs +140 -0
  4. package/dist/app-configuration-file-CeJvBAti-Dk65W3Az.mjs.map +1 -0
  5. package/dist/{dev-current-BurA9uhA-l_XeUl5Z.mjs → dev-current-D0Kn6Mf4-DaV3DWR6.mjs} +5 -5
  6. package/dist/{dev-current-BurA9uhA-l_XeUl5Z.mjs.map → dev-current-D0Kn6Mf4-DaV3DWR6.mjs.map} +1 -1
  7. package/dist/{dev-environment-name-6eEr5PW8-YyPDRApO.mjs → dev-environment-name-6eEr5PW8-DpdGjmTb.mjs} +2 -2
  8. package/dist/dev-environment-name-6eEr5PW8-DpdGjmTb.mjs.map +1 -0
  9. package/dist/{dist-BsONwZNR.mjs → dist-DizJD76s.mjs} +2 -2
  10. package/dist/{dist-BsONwZNR.mjs.map → dist-DizJD76s.mjs.map} +1 -1
  11. package/dist/{execute-deploy-destroy-Cww6zOSC-CDUytyCE.mjs → execute-deploy-destroy-Dh1CQ9X6-XpXuMPxj.mjs} +58 -66
  12. package/dist/execute-deploy-destroy-Dh1CQ9X6-XpXuMPxj.mjs.map +1 -0
  13. package/dist/{execute-dev-4KYkqSMh-Djcb8USA.mjs → execute-dev-Bl-5Q-Av-DK5AoRw1.mjs} +69 -41
  14. package/dist/{execute-dev-4KYkqSMh-Djcb8USA.mjs.map → execute-dev-Bl-5Q-Av-DK5AoRw1.mjs.map} +1 -1
  15. package/dist/{execute-dev-current-Cd4YEUZk-Fh0OVyxg.mjs → execute-dev-current-D3USgHJ4-frlaz_BC.mjs} +6 -6
  16. package/dist/{execute-dev-current-Cd4YEUZk-Fh0OVyxg.mjs.map → execute-dev-current-D3USgHJ4-frlaz_BC.mjs.map} +1 -1
  17. package/dist/family.d.mts +2 -2
  18. package/dist/family.mjs +8 -6
  19. package/dist/family.mjs.map +1 -1
  20. package/dist/{generate-dev-stack-DS6U_JHX-wDTViqdg.mjs → generate-dev-stack-Cag2Bd4s-CQLqIUWA.mjs} +11 -10
  21. package/dist/generate-dev-stack-Cag2Bd4s-CQLqIUWA.mjs.map +1 -0
  22. package/dist/{list-deployed-BK4w-dYP.mjs → list-deployed-CzFAEH6j.mjs} +4 -4
  23. package/dist/{list-deployed-BK4w-dYP.mjs.map → list-deployed-CzFAEH6j.mjs.map} +1 -1
  24. package/dist/{family-DACJfaA5-CctidqIb.d.mts → redaction-Bf8FvTFH-M5hYsi--.d.mts} +185 -126
  25. package/dist/redaction-Bf8FvTFH-M5hYsi--.d.mts.map +1 -0
  26. package/dist/redaction-HnbkSFrK-BjFRb2aC.mjs +534 -0
  27. package/dist/redaction-HnbkSFrK-BjFRb2aC.mjs.map +1 -0
  28. package/dist/{run-alchemy-B-Z6i3cD-f0MXFCG8.mjs → run-alchemy-OS_ix5g0-BzkuReFx.mjs} +29 -12
  29. package/dist/run-alchemy-OS_ix5g0-BzkuReFx.mjs.map +1 -0
  30. package/dist/testing.d.mts +31 -2
  31. package/dist/testing.d.mts.map +1 -1
  32. package/dist/testing.mjs +7 -4
  33. package/dist/testing.mjs.map +1 -1
  34. package/dist/{validate-environment-BNZC6W46-WaMtThfc.mjs → validate-environment-D_dECxgO-fg8lfCME.mjs} +888 -88
  35. package/dist/validate-environment-D_dECxgO-fg8lfCME.mjs.map +1 -0
  36. package/package.json +7 -7
  37. package/src/exports/testing.ts +3 -2
  38. package/dist/config-adapters-BA_IeiX0-CiRnz7z8.mjs +0 -590
  39. package/dist/config-adapters-BA_IeiX0-CiRnz7z8.mjs.map +0 -1
  40. package/dist/dev-environment-name-6eEr5PW8-YyPDRApO.mjs.map +0 -1
  41. package/dist/execute-deploy-destroy-Cww6zOSC-CDUytyCE.mjs.map +0 -1
  42. package/dist/family-DACJfaA5-CctidqIb.d.mts.map +0 -1
  43. package/dist/generate-dev-stack-DS6U_JHX-wDTViqdg.mjs.map +0 -1
  44. package/dist/run-alchemy-B-Z6i3cD-f0MXFCG8.mjs.map +0 -1
  45. package/dist/validate-environment-BNZC6W46-WaMtThfc.mjs.map +0 -1
@@ -1,11 +1,13 @@
1
+ import { a as nodeAddresses, i as validateEnvironmentName, o as secretsKeys, r as runPipeline } from "./validate-environment-D_dECxgO-fg8lfCME.mjs";
2
+ import { a as redactDevEvent, c as redactThrown, n as SecretRedaction, o as redactError } from "./redaction-HnbkSFrK-BjFRb2aC.mjs";
1
3
  import { i as CliStructuredError, n as ok, t as notOk } from "./result-sR7PBi61.mjs";
2
- import { i as validateEnvironmentName, r as runPipeline } from "./validate-environment-BNZC6W46-WaMtThfc.mjs";
3
- import { c as toStructured, s as requireContainerForEnvironment } from "./dev-current-BurA9uhA-l_XeUl5Z.mjs";
4
- import { i as spawnAlchemy, n as alchemyInvocation, r as reproduceCommand } from "./run-alchemy-B-Z6i3cD-f0MXFCG8.mjs";
4
+ import { c as toStructured, s as requireContainerForEnvironment } from "./dev-current-D0Kn6Mf4-DaV3DWR6.mjs";
5
+ import { i as spawnAlchemy, n as alchemyInvocation, r as reproduceCommand } from "./run-alchemy-OS_ix5g0-BzkuReFx.mjs";
5
6
  import { n as preflightEnvVarName, r as containerEnv, t as preflightEnv } from "./config-DiZaanS3.mjs";
6
- import { n as devEnvironmentDir } from "./app-config-CErnR6NK-6QjHJ7q5.mjs";
7
- import { r as writeDevStackFile, t as devStackRelativePath } from "./generate-dev-stack-DS6U_JHX-wDTViqdg.mjs";
8
- import { n as requireDevEnvironmentName, r as resolveLocalTargets, t as claimDevEnvironmentName } from "./dev-environment-name-6eEr5PW8-YyPDRApO.mjs";
7
+ import { r as devEnvironmentDir } from "./app-config-CErnR6NK-DnKH4Kqc.mjs";
8
+ import { i as removeLeftoverAppConfigurationFiles, n as devAppConfigurationFile, r as prepareSecondProcess } from "./app-configuration-file-CeJvBAti-Dk65W3Az.mjs";
9
+ import { r as writeDevStackFile, t as devStackRelativePath } from "./generate-dev-stack-Cag2Bd4s-CQLqIUWA.mjs";
10
+ import { n as requireDevEnvironmentName, r as resolveLocalTargets, t as claimDevEnvironmentName } from "./dev-environment-name-6eEr5PW8-DpdGjmTb.mjs";
9
11
  import * as fs from "node:fs";
10
12
  import * as path from "node:path";
11
13
  import { join, relative, resolve, sep } from "node:path";
@@ -1595,7 +1597,7 @@ var esm_default = {
1595
1597
  FSWatcher
1596
1598
  };
1597
1599
  //#endregion
1598
- //#region ../../0-framework/3-tooling/cli/dist/execute-dev-4KYkqSMh.mjs
1600
+ //#region ../../0-framework/3-tooling/cli/dist/execute-dev-Bl-5Q-Av.mjs
1599
1601
  /**
1600
1602
  * Local-dev spec § 6 `watch.ts`: watches each assembled bundle's declared
1601
1603
  * `watch` paths and every authoring module (ADR-0056) — a directory watched
@@ -1793,14 +1795,24 @@ function contentHash(file) {
1793
1795
  return;
1794
1796
  }
1795
1797
  }
1796
- function samePools(started, now) {
1797
- return isDeepStrictEqual(started.config, now.config) && isDeepStrictEqual(started.secrets, now.secrets);
1798
+ function sameValues(started, now) {
1799
+ return isDeepStrictEqual(started.configuration, now.configuration) && isDeepStrictEqual(started.secrets, now.secrets);
1798
1800
  }
1799
1801
  async function executeDev(input, deps, cwd) {
1802
+ const redaction = new SecretRedaction(process.env);
1803
+ try {
1804
+ const result = await executeDevInner(input, deps, cwd, redaction);
1805
+ return result.ok ? result : notOk(redactError(result.failure, redaction));
1806
+ } catch (error) {
1807
+ throw redactThrown(error, redaction);
1808
+ }
1809
+ }
1810
+ async function executeDevInner(input, deps, cwd, redaction) {
1800
1811
  if (process.platform === "win32") return notOk(new CliStructuredError("DEV.PLATFORM_UNSUPPORTED", "local dev is not supported on Windows yet."));
1801
1812
  const { onEvent } = input;
1802
1813
  const environment = input.environment ?? "dev";
1803
1814
  const devDir = path.join(cwd, devEnvironmentDir(environment));
1815
+ removeLeftoverAppConfigurationFiles(cwd);
1804
1816
  let pipeline;
1805
1817
  let resolved;
1806
1818
  const containers = /* @__PURE__ */ new Map();
@@ -1808,7 +1820,7 @@ async function executeDev(input, deps, cwd) {
1808
1820
  const attachmentsById = /* @__PURE__ */ new Map();
1809
1821
  const emit = (event) => {
1810
1822
  try {
1811
- onEvent?.(event);
1823
+ onEvent?.(redactDevEvent(event, redaction));
1812
1824
  } catch {}
1813
1825
  };
1814
1826
  try {
@@ -1816,7 +1828,8 @@ async function executeDev(input, deps, cwd) {
1816
1828
  const pipelineDeps = {
1817
1829
  runAssembler: deps.runAssembler,
1818
1830
  devServers: true,
1819
- readSecrets: true
1831
+ readSecrets: true,
1832
+ redaction
1820
1833
  };
1821
1834
  pipeline = await runPipeline(input.entry, input.name, environment, cwd, input.config, pipelineDeps);
1822
1835
  const { graph, name } = pipeline;
@@ -1855,7 +1868,8 @@ async function executeDev(input, deps, cwd) {
1855
1868
  graph,
1856
1869
  container: containers.get(id),
1857
1870
  environment,
1858
- pools: pipeline.pools,
1871
+ configuration: pipeline.configuration,
1872
+ secrets: pipeline.secrets,
1859
1873
  warn: (message) => emit({
1860
1874
  kind: "target-warning",
1861
1875
  message
@@ -1904,26 +1918,43 @@ async function executeDev(input, deps, cwd) {
1904
1918
  if (CliStructuredError.is(error)) return notOk(error);
1905
1919
  throw error;
1906
1920
  }
1907
- const invocation = alchemyInvocation({
1908
- command: "deploy",
1909
- stackFileRelativePath: devStackRelativePath(environment),
1910
- cwd,
1911
- stage: environment,
1912
- containerEnv: containerEnv(containers),
1913
- preflightEnv: preflightTransportEnv
1914
- });
1915
- const converge = async () => {
1921
+ const invocationFor = (p) => {
1922
+ const handover = prepareSecondProcess({
1923
+ file: devAppConfigurationFile(devDir),
1924
+ appConfigurationRead: p.graph.appConfigurationRead,
1925
+ nodeAddresses: nodeAddresses(p.graph),
1926
+ secretsKeys: secretsKeys(p.graph),
1927
+ knownSecrets: redaction.knownSecrets,
1928
+ appSecrets: p.secrets
1929
+ });
1930
+ return {
1931
+ invocation: alchemyInvocation({
1932
+ command: "deploy",
1933
+ stackFileRelativePath: devStackRelativePath(environment),
1934
+ cwd,
1935
+ stage: environment,
1936
+ containerEnv: containerEnv(containers),
1937
+ preflightEnv: preflightTransportEnv,
1938
+ env: handover.env,
1939
+ redactedValues: redaction.allValues()
1940
+ }),
1941
+ handover
1942
+ };
1943
+ };
1944
+ const converge = async (p) => {
1945
+ const { invocation, handover } = invocationFor(p);
1916
1946
  let stackPath;
1917
1947
  try {
1918
1948
  claimDevEnvironmentName(devDir, environment);
1919
1949
  stackPath = writeDevStackFile({
1920
- entryPath: pipeline.entryModule.path,
1950
+ entryPath: p.entryModule.path,
1921
1951
  cwd,
1922
1952
  environment,
1923
- configFile: pipeline.configSource.file,
1924
- name: pipeline.name,
1925
- assembled: pipeline.assembled
1953
+ configFile: p.configSource.file,
1954
+ name: p.name,
1955
+ assembled: p.assembled
1926
1956
  });
1957
+ handover.writeFile();
1927
1958
  } catch (error) {
1928
1959
  throw toStructured("DEV.STACK_WRITE_FAILED", error);
1929
1960
  }
@@ -1941,10 +1972,13 @@ async function executeDev(input, deps, cwd) {
1941
1972
  cwd
1942
1973
  } }
1943
1974
  });
1975
+ } finally {
1976
+ handover.removeFile();
1944
1977
  }
1945
1978
  return {
1946
1979
  outcome,
1947
- stackPath
1980
+ stackPath,
1981
+ invocation
1948
1982
  };
1949
1983
  };
1950
1984
  const stopStartedServices = async () => {
@@ -1968,7 +2002,8 @@ async function executeDev(input, deps, cwd) {
1968
2002
  address,
1969
2003
  node,
1970
2004
  server,
1971
- pools: pipeline.pools
2005
+ configuration: pipeline.configuration,
2006
+ secrets: pipeline.secrets
1972
2007
  })));
1973
2008
  } catch (error) {
1974
2009
  throw toStructured("DEV.SERVICE_START_FAILED", error);
@@ -1978,7 +2013,7 @@ async function executeDev(input, deps, cwd) {
1978
2013
  };
1979
2014
  let first;
1980
2015
  try {
1981
- first = await converge();
2016
+ first = await converge(pipeline);
1982
2017
  } catch (error) {
1983
2018
  await stopStartedServices();
1984
2019
  if (CliStructuredError.is(error)) return notOk(error);
@@ -1993,7 +2028,7 @@ async function executeDev(input, deps, cwd) {
1993
2028
  exitCode: firstStatus ?? void 0,
1994
2029
  ...first.outcome.signal !== null ? { signal: first.outcome.signal } : {},
1995
2030
  stackFilePath: first.stackPath,
1996
- reproduceCommand: reproduceCommand(invocation, first.outcome),
2031
+ reproduceCommand: reproduceCommand(first.invocation, first.outcome),
1997
2032
  cwd
1998
2033
  }
1999
2034
  } }));
@@ -2056,7 +2091,8 @@ async function executeDev(input, deps, cwd) {
2056
2091
  const watchDeps = {
2057
2092
  runAssembler: deps.runAssembler,
2058
2093
  devServers: true,
2059
- readSecrets: true
2094
+ readSecrets: true,
2095
+ redaction
2060
2096
  };
2061
2097
  const watchFiles = deps.watch ?? startWatch;
2062
2098
  const onWatchError = (error) => emit({
@@ -2084,20 +2120,12 @@ async function executeDev(input, deps, cwd) {
2084
2120
  const rebuild = async () => {
2085
2121
  try {
2086
2122
  const rePipeline = await runPipeline(input.entry, input.name, environment, cwd, input.config, watchDeps);
2087
- if (!samePools(pipeline.pools, rePipeline.pools)) {
2123
+ if (!sameValues(pipeline, rePipeline)) {
2088
2124
  if (!valuesChanged) emit({ kind: "values-changed" });
2089
2125
  valuesChanged = true;
2090
2126
  return;
2091
2127
  }
2092
- const stackPath = writeDevStackFile({
2093
- entryPath: rePipeline.entryModule.path,
2094
- cwd,
2095
- environment,
2096
- configFile: rePipeline.configSource.file,
2097
- name: rePipeline.name,
2098
- assembled: rePipeline.assembled
2099
- });
2100
- const outcome = await (deps.alchemy ?? spawnAlchemy)(invocation);
2128
+ const { outcome, stackPath, invocation } = await converge(rePipeline);
2101
2129
  if (outcome.signal !== null || outcome.exitCode !== 0) {
2102
2130
  emit({
2103
2131
  kind: "converge-failed",
@@ -2188,4 +2216,4 @@ async function executeDev(input, deps, cwd) {
2188
2216
  //#endregion
2189
2217
  export { executeDev };
2190
2218
 
2191
- //# sourceMappingURL=execute-dev-4KYkqSMh-Djcb8USA.mjs.map
2219
+ //# sourceMappingURL=execute-dev-Bl-5Q-Av-DK5AoRw1.mjs.map