@webiny/project 6.4.3-beta.1 → 6.4.3

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.
@@ -1,8 +1,9 @@
1
- import { CoreBeforeDeploy, IsRemotePulumiBackendService, ProjectSdkParamsService } from "../../abstractions/index.js";
1
+ import { CoreBeforeDeploy, GetProductionEnvironments, IsRemotePulumiBackendService, ProjectSdkParamsService } from "../../abstractions/index.js";
2
2
  declare class ValidateProductionPulumiStateImpl implements CoreBeforeDeploy.Interface {
3
3
  private isRemotePulumiBackendService;
4
4
  private projectSdkParamsService;
5
- constructor(isRemotePulumiBackendService: IsRemotePulumiBackendService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
5
+ private getProductionEnvironments;
6
+ constructor(isRemotePulumiBackendService: IsRemotePulumiBackendService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface, getProductionEnvironments: GetProductionEnvironments.Interface);
6
7
  execute(params: CoreBeforeDeploy.Params): Promise<void>;
7
8
  }
8
9
  export declare const ValidateProductionPulumiState: typeof ValidateProductionPulumiStateImpl & {
@@ -1,18 +1,16 @@
1
- import { CoreBeforeDeploy, IsRemotePulumiBackendService, ProjectSdkParamsService } from "../../abstractions/index.js";
1
+ import { CoreBeforeDeploy, GetProductionEnvironments, IsRemotePulumiBackendService, ProjectSdkParamsService } from "../../abstractions/index.js";
2
2
  import { GracefulError } from "../../index.js";
3
3
  class ValidateProductionPulumiStateImpl {
4
- constructor(isRemotePulumiBackendService, projectSdkParamsService){
4
+ constructor(isRemotePulumiBackendService, projectSdkParamsService, getProductionEnvironments){
5
5
  this.isRemotePulumiBackendService = isRemotePulumiBackendService;
6
6
  this.projectSdkParamsService = projectSdkParamsService;
7
+ this.getProductionEnvironments = getProductionEnvironments;
7
8
  }
8
9
  async execute(params) {
9
10
  const sdkParams = this.projectSdkParamsService.get();
10
11
  const { env } = sdkParams;
11
12
  const { allowLocalStateFiles } = params;
12
- const prodEnvs = [
13
- "prod",
14
- "production"
15
- ];
13
+ const prodEnvs = await this.getProductionEnvironments.execute();
16
14
  const isProdEnv = prodEnvs.includes(env);
17
15
  if (!isProdEnv) return;
18
16
  if (this.isRemotePulumiBackendService.execute()) return;
@@ -26,7 +24,8 @@ const ValidateProductionPulumiState = CoreBeforeDeploy.createImplementation({
26
24
  implementation: ValidateProductionPulumiStateImpl,
27
25
  dependencies: [
28
26
  IsRemotePulumiBackendService,
29
- ProjectSdkParamsService
27
+ ProjectSdkParamsService,
28
+ GetProductionEnvironments
30
29
  ]
31
30
  });
32
31
  export { ValidateProductionPulumiState };
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/Project/ValidateProductionPulumiState.js","sources":["../../../src/extensions/Project/ValidateProductionPulumiState.ts"],"sourcesContent":["import {\n CoreBeforeDeploy,\n IsRemotePulumiBackendService,\n ProjectSdkParamsService\n} from \"~/abstractions/index.js\";\nimport { GracefulError } from \"~/index.js\";\n\nclass ValidateProductionPulumiStateImpl implements CoreBeforeDeploy.Interface {\n constructor(\n private isRemotePulumiBackendService: IsRemotePulumiBackendService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: CoreBeforeDeploy.Params) {\n const sdkParams = this.projectSdkParamsService.get();\n const { env } = sdkParams;\n const { allowLocalStateFiles } = params;\n\n const prodEnvs = [\"prod\", \"production\"];\n const isProdEnv = prodEnvs.includes(env);\n\n if (!isProdEnv) {\n return;\n }\n\n if (this.isRemotePulumiBackendService.execute()) {\n return;\n }\n\n if (allowLocalStateFiles) {\n return;\n }\n\n const error = new Error(\"Cannot deploy to production with local state files.\");\n\n const message = [\n \"Use the %s flag to continue with local Pulumi state files,\",\n \"or configure a remote backend for production deployments.\",\n \"Learn more: https://webiny.link/state-files-production.\"\n ].join(\" \");\n\n throw GracefulError.from(error, message, \"--allow-local-state-files\");\n }\n}\n\nexport const ValidateProductionPulumiState = CoreBeforeDeploy.createImplementation({\n implementation: ValidateProductionPulumiStateImpl,\n dependencies: [IsRemotePulumiBackendService, ProjectSdkParamsService]\n});\n"],"names":["ValidateProductionPulumiStateImpl","isRemotePulumiBackendService","projectSdkParamsService","params","sdkParams","env","allowLocalStateFiles","prodEnvs","isProdEnv","error","Error","message","GracefulError","ValidateProductionPulumiState","CoreBeforeDeploy","IsRemotePulumiBackendService","ProjectSdkParamsService"],"mappings":";;AAOA,MAAMA;IACF,YACYC,4BAAoE,EACpEC,uBAA0D,CACpE;aAFUD,4BAA4B,GAA5BA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAE;QAC3C,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAM,EAAEC,GAAG,EAAE,GAAGD;QAChB,MAAM,EAAEE,oBAAoB,EAAE,GAAGH;QAEjC,MAAMI,WAAW;YAAC;YAAQ;SAAa;QACvC,MAAMC,YAAYD,SAAS,QAAQ,CAACF;QAEpC,IAAI,CAACG,WACD;QAGJ,IAAI,IAAI,CAAC,4BAA4B,CAAC,OAAO,IACzC;QAGJ,IAAIF,sBACA;QAGJ,MAAMG,QAAQ,IAAIC,MAAM;QAExB,MAAMC,UAAU;QAMhB,MAAMC,cAAc,IAAI,CAACH,OAAOE,SAAS;IAC7C;AACJ;AAEO,MAAME,gCAAgCC,iBAAiB,oBAAoB,CAAC;IAC/E,gBAAgBd;IAChB,cAAc;QAACe;QAA8BC;KAAwB;AACzE"}
1
+ {"version":3,"file":"extensions/Project/ValidateProductionPulumiState.js","sources":["../../../src/extensions/Project/ValidateProductionPulumiState.ts"],"sourcesContent":["import {\n CoreBeforeDeploy,\n GetProductionEnvironments,\n IsRemotePulumiBackendService,\n ProjectSdkParamsService\n} from \"~/abstractions/index.js\";\nimport { GracefulError } from \"~/index.js\";\n\nclass ValidateProductionPulumiStateImpl implements CoreBeforeDeploy.Interface {\n constructor(\n private isRemotePulumiBackendService: IsRemotePulumiBackendService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface,\n private getProductionEnvironments: GetProductionEnvironments.Interface\n ) {}\n\n async execute(params: CoreBeforeDeploy.Params) {\n const sdkParams = this.projectSdkParamsService.get();\n const { env } = sdkParams;\n const { allowLocalStateFiles } = params;\n\n const prodEnvs = await this.getProductionEnvironments.execute();\n const isProdEnv = prodEnvs.includes(env);\n\n if (!isProdEnv) {\n return;\n }\n\n if (this.isRemotePulumiBackendService.execute()) {\n return;\n }\n\n if (allowLocalStateFiles) {\n return;\n }\n\n const error = new Error(\"Cannot deploy to production with local state files.\");\n\n const message = [\n \"Use the %s flag to continue with local Pulumi state files,\",\n \"or configure a remote backend for production deployments.\",\n \"Learn more: https://webiny.link/state-files-production.\"\n ].join(\" \");\n\n throw GracefulError.from(error, message, \"--allow-local-state-files\");\n }\n}\n\nexport const ValidateProductionPulumiState = CoreBeforeDeploy.createImplementation({\n implementation: ValidateProductionPulumiStateImpl,\n dependencies: [IsRemotePulumiBackendService, ProjectSdkParamsService, GetProductionEnvironments]\n});\n"],"names":["ValidateProductionPulumiStateImpl","isRemotePulumiBackendService","projectSdkParamsService","getProductionEnvironments","params","sdkParams","env","allowLocalStateFiles","prodEnvs","isProdEnv","error","Error","message","GracefulError","ValidateProductionPulumiState","CoreBeforeDeploy","IsRemotePulumiBackendService","ProjectSdkParamsService","GetProductionEnvironments"],"mappings":";;AAQA,MAAMA;IACF,YACYC,4BAAoE,EACpEC,uBAA0D,EAC1DC,yBAA8D,CACxE;aAHUF,4BAA4B,GAA5BA;aACAC,uBAAuB,GAAvBA;aACAC,yBAAyB,GAAzBA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAE;QAC3C,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAM,EAAEC,GAAG,EAAE,GAAGD;QAChB,MAAM,EAAEE,oBAAoB,EAAE,GAAGH;QAEjC,MAAMI,WAAW,MAAM,IAAI,CAAC,yBAAyB,CAAC,OAAO;QAC7D,MAAMC,YAAYD,SAAS,QAAQ,CAACF;QAEpC,IAAI,CAACG,WACD;QAGJ,IAAI,IAAI,CAAC,4BAA4B,CAAC,OAAO,IACzC;QAGJ,IAAIF,sBACA;QAGJ,MAAMG,QAAQ,IAAIC,MAAM;QAExB,MAAMC,UAAU;QAMhB,MAAMC,cAAc,IAAI,CAACH,OAAOE,SAAS;IAC7C;AACJ;AAEO,MAAME,gCAAgCC,iBAAiB,oBAAoB,CAAC;IAC/E,gBAAgBf;IAChB,cAAc;QAACgB;QAA8BC;QAAyBC;KAA0B;AACpG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/project",
3
- "version": "6.4.3-beta.1",
3
+ "version": "6.4.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -13,17 +13,17 @@
13
13
  "description": "An SDK for managing Webiny projects.",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "@webiny/aws-sdk": "6.4.3-beta.1",
17
- "@webiny/build-tools": "6.4.3-beta.1",
16
+ "@webiny/aws-sdk": "6.4.3",
17
+ "@webiny/build-tools": "6.4.3",
18
18
  "@webiny/di": "1.0.1",
19
- "@webiny/feature-flags": "6.4.3-beta.1",
20
- "@webiny/global-config": "6.4.3-beta.1",
21
- "@webiny/pulumi-sdk": "6.4.3-beta.1",
22
- "@webiny/react-properties": "6.4.3-beta.1",
23
- "@webiny/system-requirements": "6.4.3-beta.1",
24
- "@webiny/telemetry": "6.4.3-beta.1",
25
- "@webiny/utils": "6.4.3-beta.1",
26
- "@webiny/wcp": "6.4.3-beta.1",
19
+ "@webiny/feature-flags": "6.4.3",
20
+ "@webiny/global-config": "6.4.3",
21
+ "@webiny/pulumi-sdk": "6.4.3",
22
+ "@webiny/react-properties": "6.4.3",
23
+ "@webiny/system-requirements": "6.4.3",
24
+ "@webiny/telemetry": "6.4.3",
25
+ "@webiny/utils": "6.4.3",
26
+ "@webiny/wcp": "6.4.3",
27
27
  "chalk": "5.6.2",
28
28
  "chokidar": "5.0.0",
29
29
  "ci-info": "4.4.0",
@@ -2,9 +2,10 @@ import { IsRemotePulumiBackendService } from "../../abstractions/index.js";
2
2
  /**
3
3
  * Service to check if a remote Pulumi backend is configured via environment variables.
4
4
  *
5
- * Checks for the following environment variables in order:
6
- * - WEBINY_CLI_PULUMI_BACKEND
5
+ * Checks for the following environment variables:
6
+ * - WEBINY_CLI_PULUMI_BACKEND (canonical)
7
7
  * - WEBINY_CLI_PULUMI_BACKEND_URL
8
+ * - WEBINY_PULUMI_BACKEND (legacy, kept for backwards compatibility)
8
9
  * - PULUMI_LOGIN (fallback for standard Pulumi configuration)
9
10
  */
10
11
  export declare class DefaultIsRemotePulumiBackendService implements IsRemotePulumiBackendService.Interface {
@@ -2,7 +2,7 @@ import { createImplementation } from "@webiny/di";
2
2
  import { IsRemotePulumiBackendService } from "../../abstractions/index.js";
3
3
  class DefaultIsRemotePulumiBackendService {
4
4
  execute() {
5
- return !!(process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_CLI_PULUMI_BACKEND_URL || process.env.PULUMI_LOGIN);
5
+ return !!(process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_CLI_PULUMI_BACKEND_URL || process.env.WEBINY_PULUMI_BACKEND || process.env.PULUMI_LOGIN);
6
6
  }
7
7
  }
8
8
  const isRemotePulumiBackendService = createImplementation({
@@ -1 +1 @@
1
- {"version":3,"file":"services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js","sources":["../../../src/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { IsRemotePulumiBackendService } from \"~/abstractions/index.js\";\n\n/**\n * Service to check if a remote Pulumi backend is configured via environment variables.\n *\n * Checks for the following environment variables in order:\n * - WEBINY_CLI_PULUMI_BACKEND\n * - WEBINY_CLI_PULUMI_BACKEND_URL\n * - PULUMI_LOGIN (fallback for standard Pulumi configuration)\n */\nexport class DefaultIsRemotePulumiBackendService implements IsRemotePulumiBackendService.Interface {\n execute(): boolean {\n return !!(\n process.env.WEBINY_CLI_PULUMI_BACKEND ||\n process.env.WEBINY_CLI_PULUMI_BACKEND_URL ||\n process.env.PULUMI_LOGIN\n );\n }\n}\n\nexport const isRemotePulumiBackendService = createImplementation({\n abstraction: IsRemotePulumiBackendService,\n implementation: DefaultIsRemotePulumiBackendService,\n dependencies: []\n});\n"],"names":["DefaultIsRemotePulumiBackendService","process","isRemotePulumiBackendService","createImplementation","IsRemotePulumiBackendService"],"mappings":";;AAWO,MAAMA;IACT,UAAmB;QACf,OAAO,CAAC,CACJC,CAAAA,QAAQ,GAAG,CAAC,yBAAyB,IACrCA,QAAQ,GAAG,CAAC,6BAA6B,IACzCA,QAAQ,GAAG,CAAC,YAAW;IAE/B;AACJ;AAEO,MAAMC,+BAA+BC,qBAAqB;IAC7D,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.js","sources":["../../../src/services/IsRemotePulumiBackendService/IsRemotePulumiBackendService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { IsRemotePulumiBackendService } from \"~/abstractions/index.js\";\n\n/**\n * Service to check if a remote Pulumi backend is configured via environment variables.\n *\n * Checks for the following environment variables:\n * - WEBINY_CLI_PULUMI_BACKEND (canonical)\n * - WEBINY_CLI_PULUMI_BACKEND_URL\n * - WEBINY_PULUMI_BACKEND (legacy, kept for backwards compatibility)\n * - PULUMI_LOGIN (fallback for standard Pulumi configuration)\n */\nexport class DefaultIsRemotePulumiBackendService implements IsRemotePulumiBackendService.Interface {\n execute(): boolean {\n return !!(\n process.env.WEBINY_CLI_PULUMI_BACKEND ||\n process.env.WEBINY_CLI_PULUMI_BACKEND_URL ||\n process.env.WEBINY_PULUMI_BACKEND ||\n process.env.PULUMI_LOGIN\n );\n }\n}\n\nexport const isRemotePulumiBackendService = createImplementation({\n abstraction: IsRemotePulumiBackendService,\n implementation: DefaultIsRemotePulumiBackendService,\n dependencies: []\n});\n"],"names":["DefaultIsRemotePulumiBackendService","process","isRemotePulumiBackendService","createImplementation","IsRemotePulumiBackendService"],"mappings":";;AAYO,MAAMA;IACT,UAAmB;QACf,OAAO,CAAC,CACJC,CAAAA,QAAQ,GAAG,CAAC,yBAAyB,IACrCA,QAAQ,GAAG,CAAC,6BAA6B,IACzCA,QAAQ,GAAG,CAAC,qBAAqB,IACjCA,QAAQ,GAAG,CAAC,YAAW;IAE/B;AACJ;AAEO,MAAMC,+BAA+BC,qBAAqB;IAC7D,aAAaC;IACb,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
@@ -17,7 +17,7 @@ class DefaultPulumiLoginService {
17
17
  app
18
18
  });
19
19
  const projectAppRelativePath = path.join("apps", app.name);
20
- let loginUrl = process.env.WEBINY_PULUMI_BACKEND;
20
+ let loginUrl = process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_PULUMI_BACKEND;
21
21
  if (loginUrl) {
22
22
  const selfManagedBackend = SELF_MANAGED_BACKEND.find((item)=>loginUrl.startsWith(item));
23
23
  if (selfManagedBackend) {
@@ -1 +1 @@
1
- {"version":3,"file":"services/PulumiLoginService/PulumiLoginService.js","sources":["../../../src/services/PulumiLoginService/PulumiLoginService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetPulumiService, PulumiLoginService } from \"~/abstractions/index.js\";\nimport { type AppModel } from \"~/models/index.js\";\nimport trimEnd from \"lodash/trimEnd.js\";\nimport fs from \"fs\";\nimport path from \"path\";\n\nconst SELF_MANAGED_BACKEND = [\"s3://\", \"azblob://\", \"gs://\"];\n\nexport class DefaultPulumiLoginService implements PulumiLoginService.Interface {\n constructor(private getPulumiService: GetPulumiService.Interface) {}\n\n async execute(app: AppModel) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n const projectAppRelativePath = path.join(\"apps\", app.name);\n\n // A couple of variations here, just to preserve backwards compatibility.\n let loginUrl = process.env.WEBINY_PULUMI_BACKEND;\n\n if (loginUrl) {\n // If the user passed `s3://my-bucket`, we want to store files in `s3://my-bucket/{project-application-path}`\n const selfManagedBackend = SELF_MANAGED_BACKEND.find(item =>\n loginUrl!.startsWith(item)\n );\n if (selfManagedBackend) {\n loginUrl = trimEnd(loginUrl, \"/\") + \"/\" + projectAppRelativePath;\n loginUrl = loginUrl.replace(/\\\\/g, \"/\");\n }\n } else {\n // By default, we use local file system as backend. All files are stored in project root's\n // `.pulumi` folder, e.g. `.pulumi/apps/admin`.\n const stateFilesFolder = app.paths.localPulumiStateFilesFolder.toString();\n\n if (!fs.existsSync(stateFilesFolder)) {\n fs.mkdirSync(stateFilesFolder, { recursive: true });\n }\n\n loginUrl = `file://${stateFilesFolder}`;\n }\n\n await pulumi.run({ command: [\"login\", loginUrl] });\n\n return { login: loginUrl };\n }\n}\n\nexport const pulumiLoginService = createImplementation({\n abstraction: PulumiLoginService,\n implementation: DefaultPulumiLoginService,\n dependencies: [GetPulumiService]\n});\n"],"names":["SELF_MANAGED_BACKEND","DefaultPulumiLoginService","getPulumiService","app","pulumi","projectAppRelativePath","path","loginUrl","process","selfManagedBackend","item","trimEnd","stateFilesFolder","fs","pulumiLoginService","createImplementation","PulumiLoginService","GetPulumiService"],"mappings":";;;;;AAOA,MAAMA,uBAAuB;IAAC;IAAS;IAAa;CAAQ;AAErD,MAAMC;IACT,YAAoBC,gBAA4C,CAAE;aAA9CA,gBAAgB,GAAhBA;IAA+C;IAEnE,MAAM,QAAQC,GAAa,EAAE;QACzB,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAED;QAAI;QAEzD,MAAME,yBAAyBC,KAAK,IAAI,CAAC,QAAQH,IAAI,IAAI;QAGzD,IAAII,WAAWC,QAAQ,GAAG,CAAC,qBAAqB;QAEhD,IAAID,UAAU;YAEV,MAAME,qBAAqBT,qBAAqB,IAAI,CAACU,CAAAA,OACjDH,SAAU,UAAU,CAACG;YAEzB,IAAID,oBAAoB;gBACpBF,WAAWI,QAAQJ,UAAU,OAAO,MAAMF;gBAC1CE,WAAWA,SAAS,OAAO,CAAC,OAAO;YACvC;QACJ,OAAO;YAGH,MAAMK,mBAAmBT,IAAI,KAAK,CAAC,2BAA2B,CAAC,QAAQ;YAEvE,IAAI,CAACU,GAAG,UAAU,CAACD,mBACfC,GAAG,SAAS,CAACD,kBAAkB;gBAAE,WAAW;YAAK;YAGrDL,WAAW,CAAC,OAAO,EAAEK,kBAAkB;QAC3C;QAEA,MAAMR,OAAO,GAAG,CAAC;YAAE,SAAS;gBAAC;gBAASG;aAAS;QAAC;QAEhD,OAAO;YAAE,OAAOA;QAAS;IAC7B;AACJ;AAEO,MAAMO,qBAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgBf;IAChB,cAAc;QAACgB;KAAiB;AACpC"}
1
+ {"version":3,"file":"services/PulumiLoginService/PulumiLoginService.js","sources":["../../../src/services/PulumiLoginService/PulumiLoginService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { GetPulumiService, PulumiLoginService } from \"~/abstractions/index.js\";\nimport { type AppModel } from \"~/models/index.js\";\nimport trimEnd from \"lodash/trimEnd.js\";\nimport fs from \"fs\";\nimport path from \"path\";\n\nconst SELF_MANAGED_BACKEND = [\"s3://\", \"azblob://\", \"gs://\"];\n\nexport class DefaultPulumiLoginService implements PulumiLoginService.Interface {\n constructor(private getPulumiService: GetPulumiService.Interface) {}\n\n async execute(app: AppModel) {\n const pulumi = await this.getPulumiService.execute({ app });\n\n const projectAppRelativePath = path.join(\"apps\", app.name);\n\n // `WEBINY_CLI_PULUMI_BACKEND` is the canonical variable. We still read the legacy\n // `WEBINY_PULUMI_BACKEND` as a fallback, to preserve backwards compatibility.\n let loginUrl = process.env.WEBINY_CLI_PULUMI_BACKEND || process.env.WEBINY_PULUMI_BACKEND;\n\n if (loginUrl) {\n // If the user passed `s3://my-bucket`, we want to store files in `s3://my-bucket/{project-application-path}`\n const selfManagedBackend = SELF_MANAGED_BACKEND.find(item =>\n loginUrl!.startsWith(item)\n );\n if (selfManagedBackend) {\n loginUrl = trimEnd(loginUrl, \"/\") + \"/\" + projectAppRelativePath;\n loginUrl = loginUrl.replace(/\\\\/g, \"/\");\n }\n } else {\n // By default, we use local file system as backend. All files are stored in project root's\n // `.pulumi` folder, e.g. `.pulumi/apps/admin`.\n const stateFilesFolder = app.paths.localPulumiStateFilesFolder.toString();\n\n if (!fs.existsSync(stateFilesFolder)) {\n fs.mkdirSync(stateFilesFolder, { recursive: true });\n }\n\n loginUrl = `file://${stateFilesFolder}`;\n }\n\n await pulumi.run({ command: [\"login\", loginUrl] });\n\n return { login: loginUrl };\n }\n}\n\nexport const pulumiLoginService = createImplementation({\n abstraction: PulumiLoginService,\n implementation: DefaultPulumiLoginService,\n dependencies: [GetPulumiService]\n});\n"],"names":["SELF_MANAGED_BACKEND","DefaultPulumiLoginService","getPulumiService","app","pulumi","projectAppRelativePath","path","loginUrl","process","selfManagedBackend","item","trimEnd","stateFilesFolder","fs","pulumiLoginService","createImplementation","PulumiLoginService","GetPulumiService"],"mappings":";;;;;AAOA,MAAMA,uBAAuB;IAAC;IAAS;IAAa;CAAQ;AAErD,MAAMC;IACT,YAAoBC,gBAA4C,CAAE;aAA9CA,gBAAgB,GAAhBA;IAA+C;IAEnE,MAAM,QAAQC,GAAa,EAAE;QACzB,MAAMC,SAAS,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAED;QAAI;QAEzD,MAAME,yBAAyBC,KAAK,IAAI,CAAC,QAAQH,IAAI,IAAI;QAIzD,IAAII,WAAWC,QAAQ,GAAG,CAAC,yBAAyB,IAAIA,QAAQ,GAAG,CAAC,qBAAqB;QAEzF,IAAID,UAAU;YAEV,MAAME,qBAAqBT,qBAAqB,IAAI,CAACU,CAAAA,OACjDH,SAAU,UAAU,CAACG;YAEzB,IAAID,oBAAoB;gBACpBF,WAAWI,QAAQJ,UAAU,OAAO,MAAMF;gBAC1CE,WAAWA,SAAS,OAAO,CAAC,OAAO;YACvC;QACJ,OAAO;YAGH,MAAMK,mBAAmBT,IAAI,KAAK,CAAC,2BAA2B,CAAC,QAAQ;YAEvE,IAAI,CAACU,GAAG,UAAU,CAACD,mBACfC,GAAG,SAAS,CAACD,kBAAkB;gBAAE,WAAW;YAAK;YAGrDL,WAAW,CAAC,OAAO,EAAEK,kBAAkB;QAC3C;QAEA,MAAMR,OAAO,GAAG,CAAC;YAAE,SAAS;gBAAC;gBAASG;aAAS;QAAC;QAEhD,OAAO;YAAE,OAAOA;QAAS;IAC7B;AACJ;AAEO,MAAMO,qBAAqBC,qBAAqB;IACnD,aAAaC;IACb,gBAAgBf;IAChB,cAAc;QAACgB;KAAiB;AACpC"}