@webiny/project-aws 6.4.5 → 6.6.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/_templates/appTemplates/api/graphql/package.json +3 -11
  2. package/_templates/appTemplates/api/graphql/src/index.ts +9 -79
  3. package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +10 -93
  4. package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/src/index.ts +19 -12
  5. package/abstractions/ApiGqlClient.js +1 -1
  6. package/abstractions/ApiGqlClient.js.map +1 -1
  7. package/abstractions/InvokeLambdaFunction.js +1 -1
  8. package/abstractions/InvokeLambdaFunction.js.map +1 -1
  9. package/admin.d.ts +6 -0
  10. package/admin.js +4 -2
  11. package/admin.js.map +1 -1
  12. package/api.d.ts +4 -4
  13. package/apps/createAdminApp.d.ts +1 -1
  14. package/apps/createCoreApp.d.ts +13 -13
  15. package/extensions/ApiRoute.d.ts +4 -4
  16. package/extensions/ApiRoute.js +5 -34
  17. package/extensions/ApiRoute.js.map +1 -1
  18. package/extensions/ProjectAws/BuildAppWorkspace.d.ts +3 -2
  19. package/extensions/ProjectAws/BuildAppWorkspace.js +38 -11
  20. package/extensions/ProjectAws/BuildAppWorkspace.js.map +1 -1
  21. package/extensions/ProjectAws/BuildProjectWorkspace.d.ts +12 -0
  22. package/extensions/ProjectAws/BuildProjectWorkspace.js +30 -0
  23. package/extensions/ProjectAws/BuildProjectWorkspace.js.map +1 -0
  24. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +11 -0
  25. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +30 -0
  26. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -0
  27. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +11 -0
  28. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +30 -0
  29. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -0
  30. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +11 -0
  31. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +30 -0
  32. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -0
  33. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +11 -0
  34. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +31 -0
  35. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -0
  36. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +13 -0
  37. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +34 -0
  38. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -0
  39. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +1 -2
  40. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
  41. package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +8 -0
  42. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +14 -0
  43. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -0
  44. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +12 -0
  45. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +31 -0
  46. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -0
  47. package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +12 -0
  48. package/extensions/ProjectAws/ValidateProductionPulumiState.js +33 -0
  49. package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -0
  50. package/extensions/ProjectAws/definitions.js +1 -3
  51. package/extensions/ProjectAws/definitions.js.map +1 -1
  52. package/extensions/ProjectAws.js +18 -4
  53. package/extensions/ProjectAws.js.map +1 -1
  54. package/extensions/definitions.js +0 -2
  55. package/extensions/definitions.js.map +1 -1
  56. package/extensions/index.d.ts +0 -1
  57. package/extensions/index.js +0 -1
  58. package/features/Watch/AwsWatch.d.ts +17 -0
  59. package/features/Watch/AwsWatch.js +108 -0
  60. package/features/Watch/AwsWatch.js.map +1 -0
  61. package/features/Watch/getIotEndpoint.d.ts +2 -0
  62. package/features/Watch/getIotEndpoint.js +18 -0
  63. package/features/Watch/getIotEndpoint.js.map +1 -0
  64. package/features/Watch/handler/handler.zip +0 -0
  65. package/features/Watch/replaceLambdaFunctions.d.ts +19 -0
  66. package/features/Watch/replaceLambdaFunctions.js +72 -0
  67. package/features/Watch/replaceLambdaFunctions.js.map +1 -0
  68. package/index.d.ts +1 -0
  69. package/index.js +1 -0
  70. package/infra.d.ts +15 -0
  71. package/infra.js +5 -2
  72. package/infra.js.map +1 -1
  73. package/package.json +17 -14
  74. package/pulumi/apps/admin/createAdminPulumiApp.d.ts +1 -1
  75. package/pulumi/apps/admin/createAdminPulumiApp.js +2 -2
  76. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  77. package/pulumi/apps/api/ApiOutput.js +1 -1
  78. package/pulumi/apps/api/ApiOutput.js.map +1 -1
  79. package/pulumi/apps/api/createApiPulumiApp.js +2 -2
  80. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  81. package/pulumi/apps/awsUtils.d.ts +1 -1
  82. package/pulumi/apps/awsUtils.js +2 -2
  83. package/pulumi/apps/awsUtils.js.map +1 -1
  84. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +2 -2
  85. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
  86. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js +1 -1
  87. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js.map +1 -1
  88. package/pulumi/apps/common/CoreOutput.js +2 -2
  89. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  90. package/pulumi/apps/core/CoreCognito.d.ts +0 -1
  91. package/pulumi/apps/core/CoreCognito.js +1 -4
  92. package/pulumi/apps/core/CoreCognito.js.map +1 -1
  93. package/pulumi/apps/core/CoreOpenSearch.d.ts +1 -1
  94. package/pulumi/apps/core/cognitoIdentityProviders/configure.js +1 -9
  95. package/pulumi/apps/core/cognitoIdentityProviders/configure.js.map +1 -1
  96. package/pulumi/apps/core/createCorePulumiApp.d.ts +13 -13
  97. package/pulumi/apps/core/createCorePulumiApp.js +3 -19
  98. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  99. package/pulumi/apps/core/webinyWatchCommand/handler.d.ts +1 -1
  100. package/pulumi/apps/extensions/getVpcConfigFromExtension.d.ts +4 -4
  101. package/pulumi/apps/react/createReactPulumiApp.d.ts +1 -1
  102. package/pulumi/apps/react/createReactPulumiApp.js +2 -2
  103. package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
  104. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +2 -2
  105. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
  106. package/pulumi/apps/syncSystem/getSyncSystemOutput.d.ts +1 -1
  107. package/pulumi/apps/syncSystem/getSyncSystemOutput.js +1 -1
  108. package/pulumi/apps/syncSystem/getSyncSystemOutput.js.map +1 -1
  109. package/pulumi/extensions/index.d.ts +2 -2
  110. package/pulumi/getAwsProjectSdk.d.ts +12 -0
  111. package/pulumi/getAwsProjectSdk.js +6 -0
  112. package/pulumi/getAwsProjectSdk.js.map +1 -0
  113. package/pulumi/getStackOutput.d.ts +7 -0
  114. package/pulumi/getStackOutput.js +8 -0
  115. package/pulumi/getStackOutput.js.map +1 -0
  116. package/pulumi/utils/lambdaEnvVariables.js +4 -16
  117. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  118. package/registerAwsProjectFeatures.d.ts +8 -0
  119. package/registerAwsProjectFeatures.js +55 -0
  120. package/registerAwsProjectFeatures.js.map +1 -0
  121. package/services/GetPulumiService/GetPulumiService.d.ts +9 -0
  122. package/services/GetPulumiService/GetPulumiService.js +44 -0
  123. package/services/GetPulumiService/GetPulumiService.js.map +1 -0
  124. package/utils/getPulumiBaseTemplatesFolderPath.d.ts +1 -0
  125. package/utils/getPulumiBaseTemplatesFolderPath.js +10 -0
  126. package/utils/getPulumiBaseTemplatesFolderPath.js.map +1 -0
  127. package/utils/index.d.ts +1 -0
  128. package/utils/index.js +1 -0
  129. package/_templates/appTemplates/api/graphql/src/security.ts +0 -43
  130. package/extensions/Encryption.d.ts +0 -10
  131. package/extensions/Encryption.js +0 -36
  132. package/extensions/Encryption.js.map +0 -1
@@ -1,30 +1,56 @@
1
1
  import path from "path";
2
2
  import fs from "fs";
3
3
  import { replaceInPath } from "replace-in-path";
4
- import { BuildAppWorkspaceService, GetApp, LoggerService } from "@webiny/project/abstractions/index.js";
5
- import { getTemplatesFolderPath } from "../../utils/index.js";
4
+ import { BuildAppWorkspaceService, GetApp, LoggerService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
5
+ import { getPulumiBaseTemplatesFolderPath, getTemplatesFolderPath } from "../../utils/index.js";
6
6
  const wait = ()=>new Promise((resolve)=>setTimeout(resolve, 10));
7
7
  class BuildAppWorkspaceImpl {
8
- constructor(getApp, logger, decoratee){
8
+ constructor(getApp, logger, projectSdkParamsService, decoratee){
9
9
  this.getApp = getApp;
10
10
  this.logger = logger;
11
+ this.projectSdkParamsService = projectSdkParamsService;
11
12
  this.decoratee = decoratee;
12
13
  }
13
14
  async execute(appName, options = {}) {
15
+ const sdkParams = this.projectSdkParamsService.get();
16
+ if (!sdkParams.env) throw new Error('Please specify environment, for example "dev".');
14
17
  await this.decoratee.execute(appName, options);
15
18
  const app = this.getApp.execute(appName);
16
- if (app.paths.workspaceFolder.existsSync()) {
17
- if (true !== options.forceRebuild) return void this.logger.debug({
18
- appName
19
- }, "App workspace already exists, skipping rebuild (project-aws).");
20
- }
19
+ const pulumiYamlExists = fs.existsSync(path.join(app.paths.workspaceFolder.toString(), "Pulumi.yaml"));
20
+ if (pulumiYamlExists && true !== options.forceRebuild) return void this.logger.debug({
21
+ appName
22
+ }, "App workspace already exists, skipping rebuild (project-aws).");
21
23
  this.logger.info({
22
24
  appName,
23
25
  options
24
26
  }, "Building app workspace (project-aws)...");
25
- const templatesFolderPath = getTemplatesFolderPath();
26
27
  const appWorkspaceFolderPath = app.paths.workspaceFolder.toString();
27
- const appTemplateFolderPath = path.join(templatesFolderPath, "appTemplates", app.name);
28
+ const pulumiBaseTemplatePath = path.join(getPulumiBaseTemplatesFolderPath(), "appTemplates", "base");
29
+ fs.cpSync(pulumiBaseTemplatePath, appWorkspaceFolderPath, {
30
+ recursive: true
31
+ });
32
+ await wait();
33
+ const { env, variant } = sdkParams;
34
+ replaceInPath(path.join(appWorkspaceFolderPath, "/**/*.{ts,js,yaml}"), [
35
+ {
36
+ find: "%{PROJECT_ID}",
37
+ replaceWith: app.name
38
+ },
39
+ {
40
+ find: "%{PROJECT_DESCRIPTION}",
41
+ replaceWith: `Webiny's ${env} app.`
42
+ },
43
+ {
44
+ find: "%{DEPLOY_ENV}",
45
+ replaceWith: env
46
+ },
47
+ {
48
+ find: "%{DEPLOY_VARIANT}",
49
+ replaceWith: variant && "undefined" !== variant ? variant : ""
50
+ }
51
+ ]);
52
+ await wait();
53
+ const appTemplateFolderPath = path.join(getTemplatesFolderPath(), "appTemplates", appName);
28
54
  fs.cpSync(appTemplateFolderPath, appWorkspaceFolderPath, {
29
55
  recursive: true
30
56
  });
@@ -53,7 +79,8 @@ const BuildAppWorkspace = BuildAppWorkspaceService.createDecorator({
53
79
  decorator: BuildAppWorkspaceImpl,
54
80
  dependencies: [
55
81
  GetApp,
56
- LoggerService
82
+ LoggerService,
83
+ ProjectSdkParamsService
57
84
  ]
58
85
  });
59
86
  export { BuildAppWorkspace };
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectAws/BuildAppWorkspace.js","sources":["../../../src/extensions/ProjectAws/BuildAppWorkspace.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport { replaceInPath } from \"replace-in-path\";\nimport {\n BuildAppWorkspaceService,\n GetApp,\n LoggerService\n} from \"@webiny/project/abstractions/index.js\";\nimport { getTemplatesFolderPath } from \"~/utils/index.js\";\n\nconst wait = () => new Promise(resolve => setTimeout(resolve, 10));\n\nclass BuildAppWorkspaceImpl implements BuildAppWorkspaceService.Interface {\n constructor(\n private getApp: GetApp.Interface,\n private logger: LoggerService.Interface,\n private decoratee: BuildAppWorkspaceService.Interface\n ) {}\n\n async execute(appName: GetApp.AppName, options: BuildAppWorkspaceService.Options = {}) {\n await this.decoratee.execute(appName, options);\n\n const app = this.getApp.execute(appName);\n\n if (app.paths.workspaceFolder.existsSync()) {\n if (options.forceRebuild !== true) {\n this.logger.debug(\n { appName },\n \"App workspace already exists, skipping rebuild (project-aws).\"\n );\n return;\n }\n }\n\n this.logger.info({ appName, options }, \"Building app workspace (project-aws)...\");\n\n const templatesFolderPath = getTemplatesFolderPath();\n const appWorkspaceFolderPath = app.paths.workspaceFolder.toString();\n const appTemplateFolderPath = path.join(templatesFolderPath, \"appTemplates\", app.name);\n\n // Create app.\n fs.cpSync(appTemplateFolderPath, appWorkspaceFolderPath, { recursive: true });\n\n // Copy `public` folder into `admin` app workspace folder.\n if (appName === \"admin\") {\n const publicFolder = path.join(process.cwd(), \"public\");\n fs.cpSync(publicFolder, path.join(appWorkspaceFolderPath, \"public\"), {\n recursive: true\n });\n\n await wait();\n\n const indexTsx = app.paths.workspaceFolder.join(\"src\", \"index.tsx\").toString();\n const globalCssPath = path.join(publicFolder, \"global.css\");\n\n let globalCss = \"\";\n\n if (fs.existsSync(globalCssPath)) {\n const relativePath = path\n .relative(path.dirname(indexTsx), globalCssPath)\n .replace(/\\\\/g, \"/\");\n globalCss = `import \"${relativePath}\";`;\n } else {\n console.log(\"globalCssPath does not exist\");\n }\n\n replaceInPath(indexTsx, {\n find: \"{GLOBAL_CSS}\",\n replaceWith: globalCss\n });\n }\n\n this.logger.info(\"App workspace built successfully (project-aws).\");\n }\n}\n\nexport const BuildAppWorkspace = BuildAppWorkspaceService.createDecorator({\n decorator: BuildAppWorkspaceImpl,\n dependencies: [GetApp, LoggerService]\n});\n"],"names":["wait","Promise","resolve","setTimeout","BuildAppWorkspaceImpl","getApp","logger","decoratee","appName","options","app","templatesFolderPath","getTemplatesFolderPath","appWorkspaceFolderPath","appTemplateFolderPath","path","fs","publicFolder","process","indexTsx","globalCssPath","globalCss","relativePath","console","replaceInPath","BuildAppWorkspace","BuildAppWorkspaceService","GetApp","LoggerService"],"mappings":";;;;;AAUA,MAAMA,OAAO,IAAM,IAAIC,QAAQC,CAAAA,UAAWC,WAAWD,SAAS;AAE9D,MAAME;IACF,YACYC,MAAwB,EACxBC,MAA+B,EAC/BC,SAA6C,CACvD;aAHUF,MAAM,GAANA;aACAC,MAAM,GAANA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,OAAuB,EAAEC,UAA4C,CAAC,CAAC,EAAE;QACnF,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACD,SAASC;QAEtC,MAAMC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAACF;QAEhC,IAAIE,IAAI,KAAK,CAAC,eAAe,CAAC,UAAU,IACpC;YAAA,IAAID,AAAyB,SAAzBA,QAAQ,YAAY,EAAW,YAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CACb;gBAAED;YAAQ,GACV;QAGR;QAGJ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAEA;YAASC;QAAQ,GAAG;QAEvC,MAAME,sBAAsBC;QAC5B,MAAMC,yBAAyBH,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ;QACjE,MAAMI,wBAAwBC,KAAK,IAAI,CAACJ,qBAAqB,gBAAgBD,IAAI,IAAI;QAGrFM,GAAG,MAAM,CAACF,uBAAuBD,wBAAwB;YAAE,WAAW;QAAK;QAG3E,IAAIL,AAAY,YAAZA,SAAqB;YACrB,MAAMS,eAAeF,KAAK,IAAI,CAACG,QAAQ,GAAG,IAAI;YAC9CF,GAAG,MAAM,CAACC,cAAcF,KAAK,IAAI,CAACF,wBAAwB,WAAW;gBACjE,WAAW;YACf;YAEA,MAAMb;YAEN,MAAMmB,WAAWT,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,aAAa,QAAQ;YAC5E,MAAMU,gBAAgBL,KAAK,IAAI,CAACE,cAAc;YAE9C,IAAII,YAAY;YAEhB,IAAIL,GAAG,UAAU,CAACI,gBAAgB;gBAC9B,MAAME,eAAeP,KAAAA,QACR,CAACA,KAAK,OAAO,CAACI,WAAWC,eACjC,OAAO,CAAC,OAAO;gBACpBC,YAAY,CAAC,QAAQ,EAAEC,aAAa,EAAE,CAAC;YAC3C,OACIC,QAAQ,GAAG,CAAC;YAGhBC,cAAcL,UAAU;gBACpB,MAAM;gBACN,aAAaE;YACjB;QACJ;QAEA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACrB;AACJ;AAEO,MAAMI,oBAAoBC,yBAAyB,eAAe,CAAC;IACtE,WAAWtB;IACX,cAAc;QAACuB;QAAQC;KAAc;AACzC"}
1
+ {"version":3,"file":"extensions/ProjectAws/BuildAppWorkspace.js","sources":["../../../src/extensions/ProjectAws/BuildAppWorkspace.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport { replaceInPath } from \"replace-in-path\";\nimport {\n BuildAppWorkspaceService,\n GetApp,\n LoggerService,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { getTemplatesFolderPath, getPulumiBaseTemplatesFolderPath } from \"~/utils/index.js\";\n\nconst wait = () => new Promise(resolve => setTimeout(resolve, 10));\n\nclass BuildAppWorkspaceImpl implements BuildAppWorkspaceService.Interface {\n constructor(\n private getApp: GetApp.Interface,\n private logger: LoggerService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface,\n private decoratee: BuildAppWorkspaceService.Interface\n ) {}\n\n async execute(appName: GetApp.AppName, options: BuildAppWorkspaceService.Options = {}) {\n const sdkParams = this.projectSdkParamsService.get();\n\n if (!sdkParams.env) {\n throw new Error(`Please specify environment, for example \"dev\".`);\n }\n\n // Base service creates/clears the workspace directory.\n await this.decoratee.execute(appName, options);\n\n const app = this.getApp.execute(appName);\n\n const pulumiYamlExists = fs.existsSync(\n path.join(app.paths.workspaceFolder.toString(), \"Pulumi.yaml\")\n );\n\n if (pulumiYamlExists && options.forceRebuild !== true) {\n this.logger.debug(\n { appName },\n \"App workspace already exists, skipping rebuild (project-aws).\"\n );\n return;\n }\n\n this.logger.info({ appName, options }, \"Building app workspace (project-aws)...\");\n\n const appWorkspaceFolderPath = app.paths.workspaceFolder.toString();\n\n // Copy Pulumi scaffolding (Pulumi.yaml, pulumi/index.js).\n const pulumiBaseTemplatePath = path.join(\n getPulumiBaseTemplatesFolderPath(),\n \"appTemplates\",\n \"base\"\n );\n fs.cpSync(pulumiBaseTemplatePath, appWorkspaceFolderPath, { recursive: true });\n\n await wait();\n\n // Replace Pulumi-specific placeholders.\n const { env, variant } = sdkParams;\n replaceInPath(path.join(appWorkspaceFolderPath, \"/**/*.{ts,js,yaml}\"), [\n { find: \"%{PROJECT_ID}\", replaceWith: app.name },\n { find: \"%{PROJECT_DESCRIPTION}\", replaceWith: `Webiny's ${env} app.` },\n { find: \"%{DEPLOY_ENV}\", replaceWith: env },\n {\n find: \"%{DEPLOY_VARIANT}\",\n replaceWith: !variant || variant === \"undefined\" ? \"\" : variant\n }\n ]);\n\n await wait();\n\n // Copy app source templates (graphql/, admin src/, etc.).\n const appTemplateFolderPath = path.join(getTemplatesFolderPath(), \"appTemplates\", appName);\n fs.cpSync(appTemplateFolderPath, appWorkspaceFolderPath, { recursive: true });\n\n // Copy `public` folder into `admin` app workspace folder.\n if (appName === \"admin\") {\n const publicFolder = path.join(process.cwd(), \"public\");\n fs.cpSync(publicFolder, path.join(appWorkspaceFolderPath, \"public\"), {\n recursive: true\n });\n\n await wait();\n\n const indexTsx = app.paths.workspaceFolder.join(\"src\", \"index.tsx\").toString();\n const globalCssPath = path.join(publicFolder, \"global.css\");\n\n let globalCss = \"\";\n\n if (fs.existsSync(globalCssPath)) {\n const relativePath = path\n .relative(path.dirname(indexTsx), globalCssPath)\n .replace(/\\\\/g, \"/\");\n globalCss = `import \"${relativePath}\";`;\n } else {\n console.log(\"globalCssPath does not exist\");\n }\n\n replaceInPath(indexTsx, {\n find: \"{GLOBAL_CSS}\",\n replaceWith: globalCss\n });\n }\n\n this.logger.info(\"App workspace built successfully (project-aws).\");\n }\n}\n\nexport const BuildAppWorkspace = BuildAppWorkspaceService.createDecorator({\n decorator: BuildAppWorkspaceImpl,\n dependencies: [GetApp, LoggerService, ProjectSdkParamsService]\n});\n"],"names":["wait","Promise","resolve","setTimeout","BuildAppWorkspaceImpl","getApp","logger","projectSdkParamsService","decoratee","appName","options","sdkParams","Error","app","pulumiYamlExists","fs","path","appWorkspaceFolderPath","pulumiBaseTemplatePath","getPulumiBaseTemplatesFolderPath","env","variant","replaceInPath","appTemplateFolderPath","getTemplatesFolderPath","publicFolder","process","indexTsx","globalCssPath","globalCss","relativePath","console","BuildAppWorkspace","BuildAppWorkspaceService","GetApp","LoggerService","ProjectSdkParamsService"],"mappings":";;;;;AAWA,MAAMA,OAAO,IAAM,IAAIC,QAAQC,CAAAA,UAAWC,WAAWD,SAAS;AAE9D,MAAME;IACF,YACYC,MAAwB,EACxBC,MAA+B,EAC/BC,uBAA0D,EAC1DC,SAA6C,CACvD;aAJUH,MAAM,GAANA;aACAC,MAAM,GAANA;aACAC,uBAAuB,GAAvBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,OAAuB,EAAEC,UAA4C,CAAC,CAAC,EAAE;QACnF,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAElD,IAAI,CAACA,UAAU,GAAG,EACd,MAAM,IAAIC,MAAM;QAIpB,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACH,SAASC;QAEtC,MAAMG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAACJ;QAEhC,MAAMK,mBAAmBC,GAAG,UAAU,CAClCC,KAAK,IAAI,CAACH,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ,IAAI;QAGpD,IAAIC,oBAAoBJ,AAAyB,SAAzBA,QAAQ,YAAY,EAAW,YACnD,IAAI,CAAC,MAAM,CAAC,KAAK,CACb;YAAED;QAAQ,GACV;QAKR,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAEA;YAASC;QAAQ,GAAG;QAEvC,MAAMO,yBAAyBJ,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ;QAGjE,MAAMK,yBAAyBF,KAAK,IAAI,CACpCG,oCACA,gBACA;QAEJJ,GAAG,MAAM,CAACG,wBAAwBD,wBAAwB;YAAE,WAAW;QAAK;QAE5E,MAAMjB;QAGN,MAAM,EAAEoB,GAAG,EAAEC,OAAO,EAAE,GAAGV;QACzBW,cAAcN,KAAK,IAAI,CAACC,wBAAwB,uBAAuB;YACnE;gBAAE,MAAM;gBAAiB,aAAaJ,IAAI,IAAI;YAAC;YAC/C;gBAAE,MAAM;gBAA0B,aAAa,CAAC,SAAS,EAAEO,IAAI,KAAK,CAAC;YAAC;YACtE;gBAAE,MAAM;gBAAiB,aAAaA;YAAI;YAC1C;gBACI,MAAM;gBACN,aAAa,AAACC,WAAWA,AAAY,gBAAZA,UAA+BA,UAAL;YACvD;SACH;QAED,MAAMrB;QAGN,MAAMuB,wBAAwBP,KAAK,IAAI,CAACQ,0BAA0B,gBAAgBf;QAClFM,GAAG,MAAM,CAACQ,uBAAuBN,wBAAwB;YAAE,WAAW;QAAK;QAG3E,IAAIR,AAAY,YAAZA,SAAqB;YACrB,MAAMgB,eAAeT,KAAK,IAAI,CAACU,QAAQ,GAAG,IAAI;YAC9CX,GAAG,MAAM,CAACU,cAAcT,KAAK,IAAI,CAACC,wBAAwB,WAAW;gBACjE,WAAW;YACf;YAEA,MAAMjB;YAEN,MAAM2B,WAAWd,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,aAAa,QAAQ;YAC5E,MAAMe,gBAAgBZ,KAAK,IAAI,CAACS,cAAc;YAE9C,IAAII,YAAY;YAEhB,IAAId,GAAG,UAAU,CAACa,gBAAgB;gBAC9B,MAAME,eAAed,KAAAA,QACR,CAACA,KAAK,OAAO,CAACW,WAAWC,eACjC,OAAO,CAAC,OAAO;gBACpBC,YAAY,CAAC,QAAQ,EAAEC,aAAa,EAAE,CAAC;YAC3C,OACIC,QAAQ,GAAG,CAAC;YAGhBT,cAAcK,UAAU;gBACpB,MAAM;gBACN,aAAaE;YACjB;QACJ;QAEA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACrB;AACJ;AAEO,MAAMG,oBAAoBC,yBAAyB,eAAe,CAAC;IACtE,WAAW7B;IACX,cAAc;QAAC8B;QAAQC;QAAeC;KAAwB;AAClE"}
@@ -0,0 +1,12 @@
1
+ import { BuildProjectWorkspaceService, GetProjectService, LoggerService } from "@webiny/project/abstractions/index.js";
2
+ declare class BuildProjectWorkspaceImpl implements BuildProjectWorkspaceService.Interface {
3
+ private getProjectService;
4
+ private logger;
5
+ private decoratee;
6
+ constructor(getProjectService: GetProjectService.Interface, logger: LoggerService.Interface, decoratee: BuildProjectWorkspaceService.Interface);
7
+ execute(): Promise<void>;
8
+ }
9
+ export declare const BuildProjectWorkspace: typeof BuildProjectWorkspaceImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/services/BuildProjectWorkspaceService").IBuildProjectWorkspaceService>;
11
+ };
12
+ export {};
@@ -0,0 +1,30 @@
1
+ import path from "path";
2
+ import fs from "fs";
3
+ import { BuildProjectWorkspaceService, GetProjectService, LoggerService } from "@webiny/project/abstractions/index.js";
4
+ import { getPulumiBaseTemplatesFolderPath } from "../../utils/index.js";
5
+ class BuildProjectWorkspaceImpl {
6
+ constructor(getProjectService, logger, decoratee){
7
+ this.getProjectService = getProjectService;
8
+ this.logger = logger;
9
+ this.decoratee = decoratee;
10
+ }
11
+ async execute() {
12
+ await this.decoratee.execute();
13
+ this.logger.trace("Copying webiny.config.base.tsx (project-aws)...");
14
+ const templatesFolderPath = getPulumiBaseTemplatesFolderPath();
15
+ const webinyConfigBaseTemplatePath = path.join(templatesFolderPath, "webiny.config.base.tsx");
16
+ const project = this.getProjectService.execute();
17
+ const dest = project.paths.webinyConfigBaseFile.toString();
18
+ fs.cpSync(webinyConfigBaseTemplatePath, dest);
19
+ }
20
+ }
21
+ const BuildProjectWorkspace = BuildProjectWorkspaceService.createDecorator({
22
+ decorator: BuildProjectWorkspaceImpl,
23
+ dependencies: [
24
+ GetProjectService,
25
+ LoggerService
26
+ ]
27
+ });
28
+ export { BuildProjectWorkspace };
29
+
30
+ //# sourceMappingURL=BuildProjectWorkspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/BuildProjectWorkspace.js","sources":["../../../src/extensions/ProjectAws/BuildProjectWorkspace.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport {\n BuildProjectWorkspaceService,\n GetProjectService,\n LoggerService\n} from \"@webiny/project/abstractions/index.js\";\nimport { getPulumiBaseTemplatesFolderPath } from \"~/utils/index.js\";\n\nclass BuildProjectWorkspaceImpl implements BuildProjectWorkspaceService.Interface {\n constructor(\n private getProjectService: GetProjectService.Interface,\n private logger: LoggerService.Interface,\n private decoratee: BuildProjectWorkspaceService.Interface\n ) {}\n\n async execute() {\n await this.decoratee.execute();\n\n this.logger.trace(\"Copying webiny.config.base.tsx (project-aws)...\");\n\n const templatesFolderPath = getPulumiBaseTemplatesFolderPath();\n const webinyConfigBaseTemplatePath = path.join(\n templatesFolderPath,\n \"webiny.config.base.tsx\"\n );\n\n const project = this.getProjectService.execute();\n const dest = project.paths.webinyConfigBaseFile.toString();\n\n fs.cpSync(webinyConfigBaseTemplatePath, dest);\n }\n}\n\nexport const BuildProjectWorkspace = BuildProjectWorkspaceService.createDecorator({\n decorator: BuildProjectWorkspaceImpl,\n dependencies: [GetProjectService, LoggerService]\n});\n"],"names":["BuildProjectWorkspaceImpl","getProjectService","logger","decoratee","templatesFolderPath","getPulumiBaseTemplatesFolderPath","webinyConfigBaseTemplatePath","path","project","dest","fs","BuildProjectWorkspace","BuildProjectWorkspaceService","GetProjectService","LoggerService"],"mappings":";;;;AASA,MAAMA;IACF,YACYC,iBAA8C,EAC9CC,MAA+B,EAC/BC,SAAiD,CAC3D;aAHUF,iBAAiB,GAAjBA;aACAC,MAAM,GAANA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO;QAE5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAElB,MAAMC,sBAAsBC;QAC5B,MAAMC,+BAA+BC,KAAK,IAAI,CAC1CH,qBACA;QAGJ,MAAMI,UAAU,IAAI,CAAC,iBAAiB,CAAC,OAAO;QAC9C,MAAMC,OAAOD,QAAQ,KAAK,CAAC,oBAAoB,CAAC,QAAQ;QAExDE,GAAG,MAAM,CAACJ,8BAA8BG;IAC5C;AACJ;AAEO,MAAME,wBAAwBC,6BAA6B,eAAe,CAAC;IAC9E,WAAWZ;IACX,cAAc;QAACa;QAAmBC;KAAc;AACpD"}
@@ -0,0 +1,11 @@
1
+ import { AdminBeforeBuild, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureApiDeployedBeforeAdminBuildImpl implements AdminBeforeBuild.Interface {
3
+ private getAppStackOutput;
4
+ private projectSdkParamsService;
5
+ constructor(getAppStackOutput: GetAppStackOutput.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
6
+ execute(params: AdminBeforeBuild.Params): Promise<void>;
7
+ }
8
+ export declare const EnsureApiDeployedBeforeAdminBuild: typeof EnsureApiDeployedBeforeAdminBuildImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IAdminBeforeBuild>;
10
+ };
11
+ export {};
@@ -0,0 +1,30 @@
1
+ import { AdminBeforeBuild, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ const NO_DEPLOYMENT_CHECKS_FLAG_NAME = "--no-deployment-checks";
4
+ class EnsureApiDeployedBeforeAdminBuildImpl {
5
+ constructor(getAppStackOutput, projectSdkParamsService){
6
+ this.getAppStackOutput = getAppStackOutput;
7
+ this.projectSdkParamsService = projectSdkParamsService;
8
+ }
9
+ async execute(params) {
10
+ if (false === params.deploymentChecks) return;
11
+ const output = await this.getAppStackOutput.execute("api");
12
+ const apiDeployed = output && Object.keys(output).length > 0;
13
+ if (apiDeployed) return;
14
+ const sdkParams = this.projectSdkParamsService.get();
15
+ const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;
16
+ const error = new Error("Cannot build Admin before deploying API.");
17
+ const message = "Before building %s, please build %s first by running: %s. If you think this is a mistake, you can also try skipping deployment checks by appending the %s flag. Learn more: https://webiny.link/deployment-checks";
18
+ throw GracefulError.from(error, message, "Admin", "API", cmd, NO_DEPLOYMENT_CHECKS_FLAG_NAME);
19
+ }
20
+ }
21
+ const EnsureApiDeployedBeforeAdminBuild = AdminBeforeBuild.createImplementation({
22
+ implementation: EnsureApiDeployedBeforeAdminBuildImpl,
23
+ dependencies: [
24
+ GetAppStackOutput,
25
+ ProjectSdkParamsService
26
+ ]
27
+ });
28
+ export { EnsureApiDeployedBeforeAdminBuild };
29
+
30
+ //# sourceMappingURL=EnsureApiDeployedBeforeAdminBuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.ts"],"sourcesContent":["import {\n AdminBeforeBuild,\n GetAppStackOutput,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst NO_DEPLOYMENT_CHECKS_FLAG_NAME = \"--no-deployment-checks\";\n\nclass EnsureApiDeployedBeforeAdminBuildImpl implements AdminBeforeBuild.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: AdminBeforeBuild.Params) {\n // Just in case, we want to allow users to skip the system requirements check.\n if (params.deploymentChecks === false) {\n return;\n }\n\n const output = await this.getAppStackOutput.execute(\"api\");\n const apiDeployed = output && Object.keys(output).length > 0;\n if (apiDeployed) {\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n const error = new Error(\"Cannot build Admin before deploying API.\");\n const message = [\n `Before building %s, please build %s first by running: %s.`,\n `If you think this is a mistake, you can also try skipping`,\n `deployment checks by appending the %s flag.`,\n `Learn more: https://webiny.link/deployment-checks`\n ].join(\" \");\n\n throw GracefulError.from(\n error,\n message,\n \"Admin\",\n \"API\",\n cmd,\n NO_DEPLOYMENT_CHECKS_FLAG_NAME\n );\n }\n}\n\nexport const EnsureApiDeployedBeforeAdminBuild = AdminBeforeBuild.createImplementation({\n implementation: EnsureApiDeployedBeforeAdminBuildImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["NO_DEPLOYMENT_CHECKS_FLAG_NAME","EnsureApiDeployedBeforeAdminBuildImpl","getAppStackOutput","projectSdkParamsService","params","output","apiDeployed","Object","sdkParams","cmd","error","Error","message","GracefulError","EnsureApiDeployedBeforeAdminBuild","AdminBeforeBuild","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;AAOA,MAAMA,iCAAiC;AAEvC,MAAMC;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAE;QAE3C,IAAIA,AAA4B,UAA5BA,OAAO,gBAAgB,EACvB;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QACpD,MAAMC,cAAcD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC3D,IAAIC,aACA;QAGJ,MAAME,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,UAAU;QAOhB,MAAMC,cAAc,IAAI,CACpBH,OACAE,SACA,SACA,OACAH,KACAT;IAER;AACJ;AAEO,MAAMc,oCAAoCC,iBAAiB,oBAAoB,CAAC;IACnF,gBAAgBd;IAChB,cAAc;QAACe;QAAmBC;KAAwB;AAC9D"}
@@ -0,0 +1,11 @@
1
+ import { AdminBeforeWatch, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureApiDeployedBeforeAdminWatchImpl implements AdminBeforeWatch.Interface {
3
+ private getAppStackOutput;
4
+ private projectSdkParamsService;
5
+ constructor(getAppStackOutput: GetAppStackOutput.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
6
+ execute(params: AdminBeforeWatch.Params): Promise<void>;
7
+ }
8
+ export declare const EnsureApiDeployedBeforeAdminWatch: typeof EnsureApiDeployedBeforeAdminWatchImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IAdminBeforeWatch>;
10
+ };
11
+ export {};
@@ -0,0 +1,30 @@
1
+ import { AdminBeforeWatch, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ const NO_DEPLOYMENT_CHECKS_FLAG_NAME = "--no-deployment-checks";
4
+ class EnsureApiDeployedBeforeAdminWatchImpl {
5
+ constructor(getAppStackOutput, projectSdkParamsService){
6
+ this.getAppStackOutput = getAppStackOutput;
7
+ this.projectSdkParamsService = projectSdkParamsService;
8
+ }
9
+ async execute(params) {
10
+ if (false === params.deploymentChecks) return;
11
+ const output = await this.getAppStackOutput.execute("api");
12
+ const apiDeployed = output && Object.keys(output).length > 0;
13
+ if (apiDeployed) return;
14
+ const sdkParams = this.projectSdkParamsService.get();
15
+ const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;
16
+ const error = new Error("Cannot watch Admin before deploying API.");
17
+ const message = "Before watching %s, please build %s first by running: %s. If you think this is a mistake, you can also try skipping deployment checks by appending the %s flag. Learn more: https://webiny.link/deployment-checks";
18
+ throw GracefulError.from(error, message, "Admin", "API", cmd, NO_DEPLOYMENT_CHECKS_FLAG_NAME);
19
+ }
20
+ }
21
+ const EnsureApiDeployedBeforeAdminWatch = AdminBeforeWatch.createImplementation({
22
+ implementation: EnsureApiDeployedBeforeAdminWatchImpl,
23
+ dependencies: [
24
+ GetAppStackOutput,
25
+ ProjectSdkParamsService
26
+ ]
27
+ });
28
+ export { EnsureApiDeployedBeforeAdminWatch };
29
+
30
+ //# sourceMappingURL=EnsureApiDeployedBeforeAdminWatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.ts"],"sourcesContent":["import {\n AdminBeforeWatch,\n GetAppStackOutput,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst NO_DEPLOYMENT_CHECKS_FLAG_NAME = \"--no-deployment-checks\";\n\nclass EnsureApiDeployedBeforeAdminWatchImpl implements AdminBeforeWatch.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: AdminBeforeWatch.Params) {\n // Just in case, we want to allow users to skip the system requirements check.\n if (params.deploymentChecks === false) {\n return;\n }\n\n const output = await this.getAppStackOutput.execute(\"api\");\n const apiDeployed = output && Object.keys(output).length > 0;\n if (apiDeployed) {\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n const error = new Error(`Cannot watch Admin before deploying API.`);\n const message = [\n `Before watching %s, please build %s first by running: %s.`,\n `If you think this is a mistake, you can also try skipping`,\n `deployment checks by appending the %s flag.`,\n `Learn more: https://webiny.link/deployment-checks`\n ].join(\" \");\n\n throw GracefulError.from(\n error,\n message,\n \"Admin\",\n \"API\",\n cmd,\n NO_DEPLOYMENT_CHECKS_FLAG_NAME\n );\n }\n}\n\nexport const EnsureApiDeployedBeforeAdminWatch = AdminBeforeWatch.createImplementation({\n implementation: EnsureApiDeployedBeforeAdminWatchImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["NO_DEPLOYMENT_CHECKS_FLAG_NAME","EnsureApiDeployedBeforeAdminWatchImpl","getAppStackOutput","projectSdkParamsService","params","output","apiDeployed","Object","sdkParams","cmd","error","Error","message","GracefulError","EnsureApiDeployedBeforeAdminWatch","AdminBeforeWatch","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;AAOA,MAAMA,iCAAiC;AAEvC,MAAMC;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAE;QAE3C,IAAIA,AAA4B,UAA5BA,OAAO,gBAAgB,EACvB;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QACpD,MAAMC,cAAcD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC3D,IAAIC,aACA;QAGJ,MAAME,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,UAAU;QAOhB,MAAMC,cAAc,IAAI,CACpBH,OACAE,SACA,SACA,OACAH,KACAT;IAER;AACJ;AAEO,MAAMc,oCAAoCC,iBAAiB,oBAAoB,CAAC;IACnF,gBAAgBd;IAChB,cAAc;QAACe;QAAmBC;KAAwB;AAC9D"}
@@ -0,0 +1,11 @@
1
+ import { ApiBeforeWatch, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureApiDeployedBeforeWatchImpl implements ApiBeforeWatch.Interface {
3
+ private getAppStackOutput;
4
+ private projectSdkParamsService;
5
+ constructor(getAppStackOutput: GetAppStackOutput.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
6
+ execute(params: ApiBeforeWatch.Params): Promise<void>;
7
+ }
8
+ export declare const EnsureApiDeployedBeforeWatch: typeof EnsureApiDeployedBeforeWatchImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IApiBeforeWatch>;
10
+ };
11
+ export {};
@@ -0,0 +1,30 @@
1
+ import { ApiBeforeWatch, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ const NO_DEPLOYMENT_CHECKS_FLAG_NAME = "--no-deployment-checks";
4
+ class EnsureApiDeployedBeforeWatchImpl {
5
+ constructor(getAppStackOutput, projectSdkParamsService){
6
+ this.getAppStackOutput = getAppStackOutput;
7
+ this.projectSdkParamsService = projectSdkParamsService;
8
+ }
9
+ async execute(params) {
10
+ if (false === params.deploymentChecks) return;
11
+ const output = await this.getAppStackOutput.execute("api");
12
+ const apiDeployed = output && Object.keys(output).length > 0;
13
+ if (apiDeployed) return;
14
+ const error = new Error("Cannot watch API before deploying it.");
15
+ const sdkParams = this.projectSdkParamsService.get();
16
+ const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;
17
+ const message = "Before watching %s, please deploy it first by running: %s. If you think this is a mistake, you can also try skipping deployment checks by appending the %s flag. Learn more: https://webiny.link/deployment-checks";
18
+ throw GracefulError.from(error, message, "API", cmd, NO_DEPLOYMENT_CHECKS_FLAG_NAME);
19
+ }
20
+ }
21
+ const EnsureApiDeployedBeforeWatch = ApiBeforeWatch.createImplementation({
22
+ implementation: EnsureApiDeployedBeforeWatchImpl,
23
+ dependencies: [
24
+ GetAppStackOutput,
25
+ ProjectSdkParamsService
26
+ ]
27
+ });
28
+ export { EnsureApiDeployedBeforeWatch };
29
+
30
+ //# sourceMappingURL=EnsureApiDeployedBeforeWatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.ts"],"sourcesContent":["import {\n ApiBeforeWatch,\n GetAppStackOutput,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst NO_DEPLOYMENT_CHECKS_FLAG_NAME = \"--no-deployment-checks\";\n\nclass EnsureApiDeployedBeforeWatchImpl implements ApiBeforeWatch.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: ApiBeforeWatch.Params) {\n // Just in case, we want to allow users to skip the system requirements check.\n if (params.deploymentChecks === false) {\n return;\n }\n\n const output = await this.getAppStackOutput.execute(\"api\");\n const apiDeployed = output && Object.keys(output).length > 0;\n if (apiDeployed) {\n return;\n }\n\n const error = new Error(`Cannot watch API before deploying it.`);\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n const message = [\n `Before watching %s, please deploy it first by running: %s.`,\n `If you think this is a mistake, you can also try skipping`,\n `deployment checks by appending the %s flag.`,\n `Learn more: https://webiny.link/deployment-checks`\n ].join(\" \");\n\n throw GracefulError.from(error, message, \"API\", cmd, NO_DEPLOYMENT_CHECKS_FLAG_NAME);\n }\n}\n\nexport const EnsureApiDeployedBeforeWatch = ApiBeforeWatch.createImplementation({\n implementation: EnsureApiDeployedBeforeWatchImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["NO_DEPLOYMENT_CHECKS_FLAG_NAME","EnsureApiDeployedBeforeWatchImpl","getAppStackOutput","projectSdkParamsService","params","output","apiDeployed","Object","error","Error","sdkParams","cmd","message","GracefulError","EnsureApiDeployedBeforeWatch","ApiBeforeWatch","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;AAOA,MAAMA,iCAAiC;AAEvC,MAAMC;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA6B,EAAE;QAEzC,IAAIA,AAA4B,UAA5BA,OAAO,gBAAgB,EACvB;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QACpD,MAAMC,cAAcD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC3D,IAAIC,aACA;QAGJ,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,UAAU;QAOhB,MAAMC,cAAc,IAAI,CAACL,OAAOI,SAAS,OAAOD,KAAKX;IACzD;AACJ;AAEO,MAAMc,+BAA+BC,eAAe,oBAAoB,CAAC;IAC5E,gBAAgBd;IAChB,cAAc;QAACe;QAAmBC;KAAwB;AAC9D"}
@@ -0,0 +1,11 @@
1
+ import { ApiBeforeDeploy, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureCoreDeployedBeforeApiDeployImpl implements ApiBeforeDeploy.Interface {
3
+ private getAppStackOutput;
4
+ private projectSdkParamsService;
5
+ constructor(getAppStackOutput: GetAppStackOutput.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
6
+ execute(): Promise<void>;
7
+ }
8
+ export declare const EnsureCoreDeployedBeforeApiDeploy: typeof EnsureCoreDeployedBeforeApiDeployImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IApiBeforeDeploy>;
10
+ };
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import { ApiBeforeDeploy, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ class EnsureCoreDeployedBeforeApiDeployImpl {
4
+ constructor(getAppStackOutput, projectSdkParamsService){
5
+ this.getAppStackOutput = getAppStackOutput;
6
+ this.projectSdkParamsService = projectSdkParamsService;
7
+ }
8
+ async execute() {
9
+ const output = await this.getAppStackOutput.execute("core");
10
+ const coreDeployed = output && Object.keys(output).length > 0;
11
+ if (coreDeployed) return;
12
+ const sdkParams = this.projectSdkParamsService.get();
13
+ const { variant, env } = sdkParams;
14
+ let variantCmd = "";
15
+ if (variant) variantCmd = ` --variant ${variant}`;
16
+ const error = new Error("Cannot deploy API before deploying Core.");
17
+ const message = "Before deploying %s, please deploy %s first by running: %s.";
18
+ const cmd = `yarn webiny deploy core --env ${env}${variantCmd}`;
19
+ throw GracefulError.from(error, message, "API", "Core", cmd);
20
+ }
21
+ }
22
+ const EnsureCoreDeployedBeforeApiDeploy = ApiBeforeDeploy.createImplementation({
23
+ implementation: EnsureCoreDeployedBeforeApiDeployImpl,
24
+ dependencies: [
25
+ GetAppStackOutput,
26
+ ProjectSdkParamsService
27
+ ]
28
+ });
29
+ export { EnsureCoreDeployedBeforeApiDeploy };
30
+
31
+ //# sourceMappingURL=EnsureCoreDeployedBeforeApiDeploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js","sources":["../../../src/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.ts"],"sourcesContent":["import {\n ApiBeforeDeploy,\n GetAppStackOutput,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nclass EnsureCoreDeployedBeforeApiDeployImpl implements ApiBeforeDeploy.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute() {\n const output = await this.getAppStackOutput.execute(\"core\");\n\n const coreDeployed = output && Object.keys(output).length > 0;\n if (coreDeployed) {\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const { variant, env } = sdkParams;\n\n let variantCmd = \"\";\n if (variant) {\n variantCmd = ` --variant ${variant}`;\n }\n\n const error = new Error(`Cannot deploy API before deploying Core.`);\n\n const message = [`Before deploying %s, please`, `deploy %s first by running: %s.`].join(\n \" \"\n );\n\n const cmd = `yarn webiny deploy core --env ${env}${variantCmd}`;\n throw GracefulError.from(error, message, \"API\", \"Core\", cmd);\n }\n}\n\nexport const EnsureCoreDeployedBeforeApiDeploy = ApiBeforeDeploy.createImplementation({\n implementation: EnsureCoreDeployedBeforeApiDeployImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["EnsureCoreDeployedBeforeApiDeployImpl","getAppStackOutput","projectSdkParamsService","output","coreDeployed","Object","sdkParams","variant","env","variantCmd","error","Error","message","cmd","GracefulError","EnsureCoreDeployedBeforeApiDeploy","ApiBeforeDeploy","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;AAOA,MAAMA;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QAEpD,MAAMC,eAAeD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC5D,IAAIC,cACA;QAGJ,MAAME,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAM,EAAEC,OAAO,EAAEC,GAAG,EAAE,GAAGF;QAEzB,IAAIG,aAAa;QACjB,IAAIF,SACAE,aAAa,CAAC,WAAW,EAAEF,SAAS;QAGxC,MAAMG,QAAQ,IAAIC,MAAM;QAExB,MAAMC,UAAU;QAIhB,MAAMC,MAAM,CAAC,8BAA8B,EAAEL,MAAMC,YAAY;QAC/D,MAAMK,cAAc,IAAI,CAACJ,OAAOE,SAAS,OAAO,QAAQC;IAC5D;AACJ;AAEO,MAAME,oCAAoCC,gBAAgB,oBAAoB,CAAC;IAClF,gBAAgBhB;IAChB,cAAc;QAACiB;QAAmBC;KAAwB;AAC9D"}
@@ -0,0 +1,13 @@
1
+ import { BeforeDeploy, IsCi, IsTelemetryEnabled, IsWcpEnabled, IsWebinyJsRepo } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureTelemetryEnabledForOssImpl implements BeforeDeploy.Interface {
3
+ private isTelemetryEnabled;
4
+ private isWcpEnabled;
5
+ private isWebinyJsRepo;
6
+ private isCi;
7
+ constructor(isTelemetryEnabled: IsTelemetryEnabled.Interface, isWcpEnabled: IsWcpEnabled.Interface, isWebinyJsRepo: IsWebinyJsRepo.Interface, isCi: IsCi.Interface);
8
+ execute(): Promise<void>;
9
+ }
10
+ export declare const EnsureTelemetryEnabledForOss: typeof EnsureTelemetryEnabledForOssImpl & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IBeforeDeploy>;
12
+ };
13
+ export {};
@@ -0,0 +1,34 @@
1
+ import { BeforeDeploy, IsCi, IsTelemetryEnabled, IsWcpEnabled, IsWebinyJsRepo } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ class EnsureTelemetryEnabledForOssImpl {
4
+ constructor(isTelemetryEnabled, isWcpEnabled, isWebinyJsRepo, isCi){
5
+ this.isTelemetryEnabled = isTelemetryEnabled;
6
+ this.isWcpEnabled = isWcpEnabled;
7
+ this.isWebinyJsRepo = isWebinyJsRepo;
8
+ this.isCi = isCi;
9
+ }
10
+ async execute() {
11
+ if (this.isCi.execute()) return;
12
+ const isDevRepo = this.isWebinyJsRepo.execute();
13
+ if (isDevRepo) return;
14
+ const telemetryEnabled = await this.isTelemetryEnabled.execute();
15
+ const wcpEnabled = await this.isWcpEnabled.execute();
16
+ if (!telemetryEnabled && !wcpEnabled) {
17
+ const message = "You are trying to deploy your project, but telemetry is currently disabled. The open-source edition of Webiny requires telemetry to be enabled. To proceed with the deployment, please re-enable telemetry or upgrade your project via https://www.webiny.com/pricing. Learn more: https://webiny.link/telemetry-oss";
18
+ const error = new Error("Cannot deploy with telemetry disabled in OSS edition.");
19
+ throw GracefulError.from(error, message);
20
+ }
21
+ }
22
+ }
23
+ const EnsureTelemetryEnabledForOss = BeforeDeploy.createImplementation({
24
+ implementation: EnsureTelemetryEnabledForOssImpl,
25
+ dependencies: [
26
+ IsTelemetryEnabled,
27
+ IsWcpEnabled,
28
+ IsWebinyJsRepo,
29
+ IsCi
30
+ ]
31
+ });
32
+ export { EnsureTelemetryEnabledForOss };
33
+
34
+ //# sourceMappingURL=EnsureTelemetryEnabledForOss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureTelemetryEnabledForOss.js","sources":["../../../src/extensions/ProjectAws/EnsureTelemetryEnabledForOss.ts"],"sourcesContent":["import {\n BeforeDeploy,\n IsCi,\n IsTelemetryEnabled,\n IsWcpEnabled,\n IsWebinyJsRepo\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nclass EnsureTelemetryEnabledForOssImpl implements BeforeDeploy.Interface {\n constructor(\n private isTelemetryEnabled: IsTelemetryEnabled.Interface,\n private isWcpEnabled: IsWcpEnabled.Interface,\n private isWebinyJsRepo: IsWebinyJsRepo.Interface,\n private isCi: IsCi.Interface\n ) {}\n\n async execute() {\n // Skip telemetry checks in CI environments\n if (this.isCi.execute()) {\n return;\n }\n\n // Don't enforce telemetry validation in the webiny-js development repository\n const isDevRepo = this.isWebinyJsRepo.execute();\n if (isDevRepo) {\n return;\n }\n\n const telemetryEnabled = await this.isTelemetryEnabled.execute();\n const wcpEnabled = await this.isWcpEnabled.execute();\n\n // If telemetry is disabled and WCP is not connected, throw an error\n if (!telemetryEnabled && !wcpEnabled) {\n const message = [\n `You are trying to deploy your project, but telemetry is currently disabled.`,\n `The open-source edition of Webiny requires telemetry to be enabled.`,\n `To proceed with the deployment, please re-enable telemetry or upgrade your project via https://www.webiny.com/pricing.`,\n `Learn more: https://webiny.link/telemetry-oss`\n ].join(\" \");\n\n const error = new Error(\"Cannot deploy with telemetry disabled in OSS edition.\");\n\n throw GracefulError.from(error, message);\n }\n }\n}\n\nexport const EnsureTelemetryEnabledForOss = BeforeDeploy.createImplementation({\n implementation: EnsureTelemetryEnabledForOssImpl,\n dependencies: [IsTelemetryEnabled, IsWcpEnabled, IsWebinyJsRepo, IsCi]\n});\n"],"names":["EnsureTelemetryEnabledForOssImpl","isTelemetryEnabled","isWcpEnabled","isWebinyJsRepo","isCi","isDevRepo","telemetryEnabled","wcpEnabled","message","error","Error","GracefulError","EnsureTelemetryEnabledForOss","BeforeDeploy","IsTelemetryEnabled","IsWcpEnabled","IsWebinyJsRepo","IsCi"],"mappings":";;AASA,MAAMA;IACF,YACYC,kBAAgD,EAChDC,YAAoC,EACpCC,cAAwC,EACxCC,IAAoB,CAC9B;aAJUH,kBAAkB,GAAlBA;aACAC,YAAY,GAAZA;aACAC,cAAc,GAAdA;aACAC,IAAI,GAAJA;IACT;IAEH,MAAM,UAAU;QAEZ,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,IACjB;QAIJ,MAAMC,YAAY,IAAI,CAAC,cAAc,CAAC,OAAO;QAC7C,IAAIA,WACA;QAGJ,MAAMC,mBAAmB,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO;QAC9D,MAAMC,aAAa,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO;QAGlD,IAAI,CAACD,oBAAoB,CAACC,YAAY;YAClC,MAAMC,UAAU;YAOhB,MAAMC,QAAQ,IAAIC,MAAM;YAExB,MAAMC,cAAc,IAAI,CAACF,OAAOD;QACpC;IACJ;AACJ;AAEO,MAAMI,+BAA+BC,aAAa,oBAAoB,CAAC;IAC1E,gBAAgBb;IAChB,cAAc;QAACc;QAAoBC;QAAcC;QAAgBC;KAAK;AAC1E"}
@@ -16,8 +16,7 @@ class SetAdminEnvVars {
16
16
  const apiOutput = await apiStackOutputService.execute();
17
17
  if (apiOutput) {
18
18
  process.env.REACT_APP_USER_POOL_REGION = apiOutput.region;
19
- process.env.REACT_APP_GRAPHQL_API_URL = `${apiOutput.apiUrl}/graphql`;
20
- process.env.REACT_APP_API_URL = apiOutput.apiUrl;
19
+ process.env.WEBINY_ADMIN_API_URL = apiOutput.apiUrl;
21
20
  process.env.REACT_APP_USER_POOL_ID = apiOutput.cognitoUserPoolId;
22
21
  process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID = apiOutput.cognitoAppClientId;
23
22
  process.env.REACT_APP_USER_POOL_PASSWORD_POLICY = JSON.stringify(apiOutput.cognitoUserPoolPasswordPolicy);
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js","sources":["../../../../src/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.ts"],"sourcesContent":["import { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { CoreStackOutputService, ApiStackOutputService } from \"../../../abstractions/index.js\";\n\ninterface ISetAdminEnvVarsDi {\n projectSdkParamsService: ProjectSdkParamsService.Interface;\n coreStackOutputService: CoreStackOutputService.Interface;\n apiStackOutputService: ApiStackOutputService.Interface;\n}\n\nexport class SetAdminEnvVars {\n di: ISetAdminEnvVarsDi;\n\n constructor(di: ISetAdminEnvVarsDi) {\n this.di = di;\n }\n\n async execute() {\n const { projectSdkParamsService, coreStackOutputService, apiStackOutputService } = this.di;\n const sdkParams = projectSdkParamsService.get();\n\n // Set basic admin env vars\n process.env.PORT = process.env.PORT || \"3001\";\n process.env.WEBINY_ADMIN_ENV = sdkParams.env;\n process.env.WEBINY_ADMIN_TRASH_BIN_RETENTION_PERIOD_DAYS =\n process.env.WEBINY_TRASH_BIN_RETENTION_PERIOD_DAYS || \"\";\n\n // Load Core app stack output (automatically uses env/variant/region from ProjectSdkParamsService)\n const coreOutput = await coreStackOutputService.execute<{\n deploymentId: string;\n cognitoUserPoolDomain?: string;\n }>();\n\n if (coreOutput) {\n process.env.WEBINY_ADMIN_DEPLOYMENT_ID = coreOutput.deploymentId;\n\n // Set Cognito user pool domain if available\n if (coreOutput.cognitoUserPoolDomain) {\n process.env.REACT_APP_USER_POOL_DOMAIN = coreOutput.cognitoUserPoolDomain;\n }\n }\n\n // Load API app stack output (automatically uses env/variant/region from ProjectSdkParamsService)\n const apiOutput = await apiStackOutputService.execute<{\n region: string;\n apiUrl: string;\n cognitoUserPoolId: string;\n cognitoAppClientId: string;\n cognitoUserPoolPasswordPolicy: any;\n websocketApiUrl: string;\n }>();\n\n if (apiOutput) {\n process.env.REACT_APP_USER_POOL_REGION = apiOutput.region;\n process.env.REACT_APP_GRAPHQL_API_URL = `${apiOutput.apiUrl}/graphql`;\n process.env.REACT_APP_API_URL = apiOutput.apiUrl;\n process.env.REACT_APP_USER_POOL_ID = apiOutput.cognitoUserPoolId;\n process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID = apiOutput.cognitoAppClientId;\n process.env.REACT_APP_USER_POOL_PASSWORD_POLICY = JSON.stringify(\n apiOutput.cognitoUserPoolPasswordPolicy\n );\n process.env.REACT_APP_WEBSOCKET_URL = apiOutput.websocketApiUrl;\n }\n }\n}\n"],"names":["SetAdminEnvVars","di","projectSdkParamsService","coreStackOutputService","apiStackOutputService","sdkParams","process","coreOutput","apiOutput","JSON"],"mappings":"AASO,MAAMA;IAGT,YAAYC,EAAsB,CAAE;QAChC,IAAI,CAAC,EAAE,GAAGA;IACd;IAEA,MAAM,UAAU;QACZ,MAAM,EAAEC,uBAAuB,EAAEC,sBAAsB,EAAEC,qBAAqB,EAAE,GAAG,IAAI,CAAC,EAAE;QAC1F,MAAMC,YAAYH,wBAAwB,GAAG;QAG7CI,QAAQ,GAAG,CAAC,IAAI,GAAGA,QAAQ,GAAG,CAAC,IAAI,IAAI;QACvCA,QAAQ,GAAG,CAAC,gBAAgB,GAAGD,UAAU,GAAG;QAC5CC,QAAQ,GAAG,CAAC,4CAA4C,GACpDA,QAAQ,GAAG,CAAC,sCAAsC,IAAI;QAG1D,MAAMC,aAAa,MAAMJ,uBAAuB,OAAO;QAKvD,IAAII,YAAY;YACZD,QAAQ,GAAG,CAAC,0BAA0B,GAAGC,WAAW,YAAY;YAGhE,IAAIA,WAAW,qBAAqB,EAChCD,QAAQ,GAAG,CAAC,0BAA0B,GAAGC,WAAW,qBAAqB;QAEjF;QAGA,MAAMC,YAAY,MAAMJ,sBAAsB,OAAO;QASrD,IAAII,WAAW;YACXF,QAAQ,GAAG,CAAC,0BAA0B,GAAGE,UAAU,MAAM;YACzDF,QAAQ,GAAG,CAAC,yBAAyB,GAAG,GAAGE,UAAU,MAAM,CAAC,QAAQ,CAAC;YACrEF,QAAQ,GAAG,CAAC,iBAAiB,GAAGE,UAAU,MAAM;YAChDF,QAAQ,GAAG,CAAC,sBAAsB,GAAGE,UAAU,iBAAiB;YAChEF,QAAQ,GAAG,CAAC,iCAAiC,GAAGE,UAAU,kBAAkB;YAC5EF,QAAQ,GAAG,CAAC,mCAAmC,GAAGG,KAAK,SAAS,CAC5DD,UAAU,6BAA6B;YAE3CF,QAAQ,GAAG,CAAC,uBAAuB,GAAGE,UAAU,eAAe;QACnE;IACJ;AACJ"}
1
+ {"version":3,"file":"extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js","sources":["../../../../src/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.ts"],"sourcesContent":["import { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { CoreStackOutputService, ApiStackOutputService } from \"../../../abstractions/index.js\";\n\ninterface ISetAdminEnvVarsDi {\n projectSdkParamsService: ProjectSdkParamsService.Interface;\n coreStackOutputService: CoreStackOutputService.Interface;\n apiStackOutputService: ApiStackOutputService.Interface;\n}\n\nexport class SetAdminEnvVars {\n di: ISetAdminEnvVarsDi;\n\n constructor(di: ISetAdminEnvVarsDi) {\n this.di = di;\n }\n\n async execute() {\n const { projectSdkParamsService, coreStackOutputService, apiStackOutputService } = this.di;\n const sdkParams = projectSdkParamsService.get();\n\n // Set basic admin env vars\n process.env.PORT = process.env.PORT || \"3001\";\n process.env.WEBINY_ADMIN_ENV = sdkParams.env;\n process.env.WEBINY_ADMIN_TRASH_BIN_RETENTION_PERIOD_DAYS =\n process.env.WEBINY_TRASH_BIN_RETENTION_PERIOD_DAYS || \"\";\n\n // Load Core app stack output (automatically uses env/variant/region from ProjectSdkParamsService)\n const coreOutput = await coreStackOutputService.execute<{\n deploymentId: string;\n cognitoUserPoolDomain?: string;\n }>();\n\n if (coreOutput) {\n process.env.WEBINY_ADMIN_DEPLOYMENT_ID = coreOutput.deploymentId;\n\n // Set Cognito user pool domain if available\n if (coreOutput.cognitoUserPoolDomain) {\n process.env.REACT_APP_USER_POOL_DOMAIN = coreOutput.cognitoUserPoolDomain;\n }\n }\n\n // Load API app stack output (automatically uses env/variant/region from ProjectSdkParamsService)\n const apiOutput = await apiStackOutputService.execute<{\n region: string;\n apiUrl: string;\n cognitoUserPoolId: string;\n cognitoAppClientId: string;\n cognitoUserPoolPasswordPolicy: any;\n websocketApiUrl: string;\n }>();\n\n if (apiOutput) {\n process.env.REACT_APP_USER_POOL_REGION = apiOutput.region;\n // Admin API URL, read by createRootContainer / Admin.tsx / playgrounds / api-info.\n process.env.WEBINY_ADMIN_API_URL = apiOutput.apiUrl;\n process.env.REACT_APP_USER_POOL_ID = apiOutput.cognitoUserPoolId;\n process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID = apiOutput.cognitoAppClientId;\n process.env.REACT_APP_USER_POOL_PASSWORD_POLICY = JSON.stringify(\n apiOutput.cognitoUserPoolPasswordPolicy\n );\n process.env.REACT_APP_WEBSOCKET_URL = apiOutput.websocketApiUrl;\n }\n }\n}\n"],"names":["SetAdminEnvVars","di","projectSdkParamsService","coreStackOutputService","apiStackOutputService","sdkParams","process","coreOutput","apiOutput","JSON"],"mappings":"AASO,MAAMA;IAGT,YAAYC,EAAsB,CAAE;QAChC,IAAI,CAAC,EAAE,GAAGA;IACd;IAEA,MAAM,UAAU;QACZ,MAAM,EAAEC,uBAAuB,EAAEC,sBAAsB,EAAEC,qBAAqB,EAAE,GAAG,IAAI,CAAC,EAAE;QAC1F,MAAMC,YAAYH,wBAAwB,GAAG;QAG7CI,QAAQ,GAAG,CAAC,IAAI,GAAGA,QAAQ,GAAG,CAAC,IAAI,IAAI;QACvCA,QAAQ,GAAG,CAAC,gBAAgB,GAAGD,UAAU,GAAG;QAC5CC,QAAQ,GAAG,CAAC,4CAA4C,GACpDA,QAAQ,GAAG,CAAC,sCAAsC,IAAI;QAG1D,MAAMC,aAAa,MAAMJ,uBAAuB,OAAO;QAKvD,IAAII,YAAY;YACZD,QAAQ,GAAG,CAAC,0BAA0B,GAAGC,WAAW,YAAY;YAGhE,IAAIA,WAAW,qBAAqB,EAChCD,QAAQ,GAAG,CAAC,0BAA0B,GAAGC,WAAW,qBAAqB;QAEjF;QAGA,MAAMC,YAAY,MAAMJ,sBAAsB,OAAO;QASrD,IAAII,WAAW;YACXF,QAAQ,GAAG,CAAC,0BAA0B,GAAGE,UAAU,MAAM;YAEzDF,QAAQ,GAAG,CAAC,oBAAoB,GAAGE,UAAU,MAAM;YACnDF,QAAQ,GAAG,CAAC,sBAAsB,GAAGE,UAAU,iBAAiB;YAChEF,QAAQ,GAAG,CAAC,iCAAiC,GAAGE,UAAU,kBAAkB;YAC5EF,QAAQ,GAAG,CAAC,mCAAmC,GAAGG,KAAK,SAAS,CAC5DD,UAAU,6BAA6B;YAE3CF,QAAQ,GAAG,CAAC,uBAAuB,GAAGE,UAAU,eAAe;QACnE;IACJ;AACJ"}
@@ -0,0 +1,8 @@
1
+ import { AdminAfterDeploy } from "@webiny/project/abstractions/index.js";
2
+ declare class TelemetryNoLongerNewUserImpl implements AdminAfterDeploy.Interface {
3
+ execute(): Promise<void>;
4
+ }
5
+ export declare const TelemetryNoLongerNewUser: typeof TelemetryNoLongerNewUserImpl & {
6
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IAdminAfterDeploy>;
7
+ };
8
+ export {};
@@ -0,0 +1,14 @@
1
+ import { AdminAfterDeploy } from "@webiny/project/abstractions/index.js";
2
+ import { globalConfig } from "@webiny/global-config";
3
+ class TelemetryNoLongerNewUserImpl {
4
+ async execute() {
5
+ globalConfig.set("newUser", false);
6
+ }
7
+ }
8
+ const TelemetryNoLongerNewUser = AdminAfterDeploy.createImplementation({
9
+ implementation: TelemetryNoLongerNewUserImpl,
10
+ dependencies: []
11
+ });
12
+ export { TelemetryNoLongerNewUser };
13
+
14
+ //# sourceMappingURL=TelemetryNoLongerNewUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/TelemetryNoLongerNewUser.js","sources":["../../../src/extensions/ProjectAws/TelemetryNoLongerNewUser.ts"],"sourcesContent":["import { AdminAfterDeploy } from \"@webiny/project/abstractions/index.js\";\nimport { globalConfig } from \"@webiny/global-config\";\n\nclass TelemetryNoLongerNewUserImpl implements AdminAfterDeploy.Interface {\n async execute() {\n // Mark the user as no longer new.\n globalConfig.set(\"newUser\", false);\n }\n}\n\nexport const TelemetryNoLongerNewUser = AdminAfterDeploy.createImplementation({\n implementation: TelemetryNoLongerNewUserImpl,\n dependencies: []\n});\n"],"names":["TelemetryNoLongerNewUserImpl","globalConfig","TelemetryNoLongerNewUser","AdminAfterDeploy"],"mappings":";;AAGA,MAAMA;IACF,MAAM,UAAU;QAEZC,aAAa,GAAG,CAAC,WAAW;IAChC;AACJ;AAEO,MAAMC,2BAA2BC,iBAAiB,oBAAoB,CAAC;IAC1E,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,12 @@
1
+ import { BeforeDeploy, GetProductionEnvironments, GetProjectConfig, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class ValidateEncryptionBeforeDeployImpl implements BeforeDeploy.Interface {
3
+ private getProductionEnvironments;
4
+ private projectSdkParamsService;
5
+ private getProjectConfig;
6
+ constructor(getProductionEnvironments: GetProductionEnvironments.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface, getProjectConfig: GetProjectConfig.Interface);
7
+ execute(): Promise<void>;
8
+ }
9
+ export declare const ValidateEncryptionBeforeDeploy: typeof ValidateEncryptionBeforeDeployImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IBeforeDeploy>;
11
+ };
12
+ export {};
@@ -0,0 +1,31 @@
1
+ import { BeforeDeploy, GetProductionEnvironments, GetProjectConfig, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ class ValidateEncryptionBeforeDeployImpl {
4
+ constructor(getProductionEnvironments, projectSdkParamsService, getProjectConfig){
5
+ this.getProductionEnvironments = getProductionEnvironments;
6
+ this.projectSdkParamsService = projectSdkParamsService;
7
+ this.getProjectConfig = getProjectConfig;
8
+ }
9
+ async execute() {
10
+ const { env } = this.projectSdkParamsService.get();
11
+ const prodEnvs = await this.getProductionEnvironments.execute();
12
+ if (!prodEnvs.includes(env)) return;
13
+ const projectConfig = await this.getProjectConfig.execute();
14
+ const [encryption] = projectConfig.extensionsByType("Infra/Encryption");
15
+ if (encryption) return;
16
+ const error = new Error("Encryption is not configured for production environment.");
17
+ const message = "Deploying to a production environment requires encryption to be configured. Set the %s environment variable and add %s to your project config. Learn more: https://webiny.link/encryption";
18
+ throw GracefulError.from(error, message, "WEBINY_ENCRYPTION_PASSPHRASE", "<Infra.Encryption>");
19
+ }
20
+ }
21
+ const ValidateEncryptionBeforeDeploy = BeforeDeploy.createImplementation({
22
+ implementation: ValidateEncryptionBeforeDeployImpl,
23
+ dependencies: [
24
+ GetProductionEnvironments,
25
+ ProjectSdkParamsService,
26
+ GetProjectConfig
27
+ ]
28
+ });
29
+ export { ValidateEncryptionBeforeDeploy };
30
+
31
+ //# sourceMappingURL=ValidateEncryptionBeforeDeploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js","sources":["../../../src/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.ts"],"sourcesContent":["import {\n BeforeDeploy,\n GetProductionEnvironments,\n GetProjectConfig,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nclass ValidateEncryptionBeforeDeployImpl implements BeforeDeploy.Interface {\n constructor(\n private getProductionEnvironments: GetProductionEnvironments.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface,\n private getProjectConfig: GetProjectConfig.Interface\n ) {}\n\n async execute() {\n const { env } = this.projectSdkParamsService.get();\n const prodEnvs = await this.getProductionEnvironments.execute();\n\n if (!prodEnvs.includes(env)) {\n return;\n }\n\n const projectConfig = await this.getProjectConfig.execute();\n const [encryption] = projectConfig.extensionsByType(\"Infra/Encryption\");\n\n if (encryption) {\n return;\n }\n\n const error = new Error(\"Encryption is not configured for production environment.\");\n\n const message = [\n \"Deploying to a production environment requires encryption to be configured.\",\n \"Set the %s environment variable and add %s to your project config.\",\n \"Learn more: https://webiny.link/encryption\"\n ].join(\" \");\n\n throw GracefulError.from(\n error,\n message,\n \"WEBINY_ENCRYPTION_PASSPHRASE\",\n \"<Infra.Encryption>\"\n );\n }\n}\n\nexport const ValidateEncryptionBeforeDeploy = BeforeDeploy.createImplementation({\n implementation: ValidateEncryptionBeforeDeployImpl,\n dependencies: [GetProductionEnvironments, ProjectSdkParamsService, GetProjectConfig]\n});\n"],"names":["ValidateEncryptionBeforeDeployImpl","getProductionEnvironments","projectSdkParamsService","getProjectConfig","env","prodEnvs","projectConfig","encryption","error","Error","message","GracefulError","ValidateEncryptionBeforeDeploy","BeforeDeploy","GetProductionEnvironments","ProjectSdkParamsService","GetProjectConfig"],"mappings":";;AAQA,MAAMA;IACF,YACYC,yBAA8D,EAC9DC,uBAA0D,EAC1DC,gBAA4C,CACtD;aAHUF,yBAAyB,GAAzBA;aACAC,uBAAuB,GAAvBA;aACAC,gBAAgB,GAAhBA;IACT;IAEH,MAAM,UAAU;QACZ,MAAM,EAAEC,GAAG,EAAE,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAChD,MAAMC,WAAW,MAAM,IAAI,CAAC,yBAAyB,CAAC,OAAO;QAE7D,IAAI,CAACA,SAAS,QAAQ,CAACD,MACnB;QAGJ,MAAME,gBAAgB,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO;QACzD,MAAM,CAACC,WAAW,GAAGD,cAAc,gBAAgB,CAAC;QAEpD,IAAIC,YACA;QAGJ,MAAMC,QAAQ,IAAIC,MAAM;QAExB,MAAMC,UAAU;QAMhB,MAAMC,cAAc,IAAI,CACpBH,OACAE,SACA,gCACA;IAER;AACJ;AAEO,MAAME,iCAAiCC,aAAa,oBAAoB,CAAC;IAC5E,gBAAgBb;IAChB,cAAc;QAACc;QAA2BC;QAAyBC;KAAiB;AACxF"}
@@ -0,0 +1,12 @@
1
+ import { CoreBeforeDeploy, GetProductionEnvironments, IsRemotePulumiBackendService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class ValidateProductionPulumiStateImpl implements CoreBeforeDeploy.Interface {
3
+ private isRemotePulumiBackendService;
4
+ private projectSdkParamsService;
5
+ private getProductionEnvironments;
6
+ constructor(isRemotePulumiBackendService: IsRemotePulumiBackendService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface, getProductionEnvironments: GetProductionEnvironments.Interface);
7
+ execute(params: CoreBeforeDeploy.Params): Promise<void>;
8
+ }
9
+ export declare const ValidateProductionPulumiState: typeof ValidateProductionPulumiStateImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").ICoreBeforeDeploy>;
11
+ };
12
+ export {};
@@ -0,0 +1,33 @@
1
+ import { CoreBeforeDeploy, GetProductionEnvironments, IsRemotePulumiBackendService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ class ValidateProductionPulumiStateImpl {
4
+ constructor(isRemotePulumiBackendService, projectSdkParamsService, getProductionEnvironments){
5
+ this.isRemotePulumiBackendService = isRemotePulumiBackendService;
6
+ this.projectSdkParamsService = projectSdkParamsService;
7
+ this.getProductionEnvironments = getProductionEnvironments;
8
+ }
9
+ async execute(params) {
10
+ const sdkParams = this.projectSdkParamsService.get();
11
+ const { env } = sdkParams;
12
+ const { allowLocalStateFiles } = params;
13
+ const prodEnvs = await this.getProductionEnvironments.execute();
14
+ const isProdEnv = prodEnvs.includes(env);
15
+ if (!isProdEnv) return;
16
+ if (this.isRemotePulumiBackendService.execute()) return;
17
+ if (allowLocalStateFiles) return;
18
+ const error = new Error("Cannot deploy to production with local state files.");
19
+ const message = "Use the %s flag to continue with local Pulumi state files, or configure a remote backend for production deployments. Learn more: https://webiny.link/state-files-production.";
20
+ throw GracefulError.from(error, message, "--allow-local-state-files");
21
+ }
22
+ }
23
+ const ValidateProductionPulumiState = CoreBeforeDeploy.createImplementation({
24
+ implementation: ValidateProductionPulumiStateImpl,
25
+ dependencies: [
26
+ IsRemotePulumiBackendService,
27
+ ProjectSdkParamsService,
28
+ GetProductionEnvironments
29
+ ]
30
+ });
31
+ export { ValidateProductionPulumiState };
32
+
33
+ //# sourceMappingURL=ValidateProductionPulumiState.js.map