@webiny/project 6.0.0 → 6.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstractions/features/DeployApp.d.ts +0 -1
- package/abstractions/features/DeployApp.js.map +1 -1
- package/abstractions/features/pulumi/AdminPulumi.d.ts +3 -0
- package/abstractions/features/pulumi/AdminPulumi.js +3 -0
- package/abstractions/features/pulumi/AdminPulumi.js.map +1 -1
- package/abstractions/features/pulumi/ApiPulumi.d.ts +3 -0
- package/abstractions/features/pulumi/ApiPulumi.js +3 -0
- package/abstractions/features/pulumi/ApiPulumi.js.map +1 -1
- package/abstractions/features/pulumi/CorePulumi.d.ts +3 -0
- package/abstractions/features/pulumi/CorePulumi.js +3 -0
- package/abstractions/features/pulumi/CorePulumi.js.map +1 -1
- package/defineExtension/models/ExtensionDefinitionModel.d.ts +4 -4
- package/defineExtension/models/ExtensionDefinitionModel.js.map +1 -1
- package/defineExtension/models/ExtensionInstanceModel.js +1 -1
- package/defineExtension/models/ExtensionInstanceModel.js.map +1 -1
- package/defineExtension/zodTypes/zodSrcPath.d.ts +1 -1
- package/exports/infra.d.ts +8 -0
- package/exports/infra.js +10 -0
- package/exports/{infra/index.js.map → infra.js.map} +1 -1
- package/extensions/AdminBuildParam.d.ts +2 -8
- package/extensions/AdminBuildParam.js +1 -1
- package/extensions/AdminBuildParam.js.map +1 -1
- package/extensions/AdminExtension.d.ts +2 -8
- package/extensions/ApiBuildParam.d.ts +2 -8
- package/extensions/ApiBuildParam.js +1 -1
- package/extensions/ApiBuildParam.js.map +1 -1
- package/extensions/ApiExtension.d.ts +2 -8
- package/extensions/DatabaseSetup.d.ts +6 -6
- package/extensions/EnvVar.d.ts +4 -7
- package/extensions/EnvVar.js +4 -0
- package/extensions/EnvVar.js.map +1 -1
- package/extensions/ExtensionDefinitions.d.ts +1 -5
- package/extensions/FeatureFlags.d.ts +5 -79
- package/extensions/ProjectDecorator.d.ts +2 -6
- package/extensions/ProjectId.d.ts +2 -6
- package/extensions/ProjectImplementation.d.ts +2 -8
- package/extensions/Telemetry.d.ts +1 -5
- package/extensions/hooks/AdminAfterBuild.d.ts +2 -6
- package/extensions/hooks/AdminAfterDeploy.d.ts +2 -6
- package/extensions/hooks/AdminBeforeBuild.d.ts +2 -6
- package/extensions/hooks/AdminBeforeDeploy.d.ts +2 -6
- package/extensions/hooks/AdminBeforeWatch.d.ts +2 -6
- package/extensions/hooks/AfterBuild.d.ts +2 -6
- package/extensions/hooks/AfterDeploy.d.ts +2 -6
- package/extensions/hooks/ApiAfterBuild.d.ts +2 -6
- package/extensions/hooks/ApiAfterDeploy.d.ts +2 -6
- package/extensions/hooks/ApiBeforeBuild.d.ts +2 -6
- package/extensions/hooks/ApiBeforeDeploy.d.ts +2 -6
- package/extensions/hooks/ApiBeforeWatch.d.ts +2 -6
- package/extensions/hooks/BeforeBuild.d.ts +2 -6
- package/extensions/hooks/BeforeDeploy.d.ts +2 -6
- package/extensions/hooks/BeforeWatch.d.ts +2 -6
- package/extensions/hooks/CoreAfterBuild.d.ts +2 -6
- package/extensions/hooks/CoreAfterDeploy.d.ts +2 -6
- package/extensions/hooks/CoreBeforeBuild.d.ts +2 -6
- package/extensions/hooks/CoreBeforeDeploy.d.ts +2 -6
- package/extensions/hooks/CoreBeforeWatch.d.ts +2 -6
- package/extensions/index.d.ts +24 -140
- package/extensions/infra/Ci.d.ts +14 -0
- package/extensions/infra/Ci.js +29 -0
- package/extensions/infra/Ci.js.map +1 -0
- package/extensions/infra/index.d.ts +1 -0
- package/extensions/infra/index.js +1 -0
- package/extensions/infra/index.js.map +1 -1
- package/extensions/pulumi/AdminPulumi.d.ts +2 -6
- package/extensions/pulumi/AdminStackOutputValue.d.ts +1 -7
- package/extensions/pulumi/ApiPulumi.d.ts +2 -6
- package/extensions/pulumi/ApiStackOutputValue.d.ts +1 -7
- package/extensions/pulumi/CorePulumi.d.ts +2 -6
- package/extensions/pulumi/CoreStackOutputValue.d.ts +1 -7
- package/extensions/pulumi/ProductionEnvironments.d.ts +2 -6
- package/extensions/pulumi/PulumiResourceNamePrefix.d.ts +1 -5
- package/features/BuildApp/PackagesBuilder/worker.js +1 -1
- package/features/BuildApp/PackagesBuilder/worker.js.map +1 -1
- package/features/GetFeatureFlags/GetFeatureFlags.d.ts +1 -2
- package/features/GetFeatureFlags/GetFeatureFlags.js +1 -2
- package/features/GetFeatureFlags/GetFeatureFlags.js.map +1 -1
- package/features/Watch/localInvocationWorker.js +5 -1
- package/features/Watch/localInvocationWorker.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +27 -26
- package/services/GetProjectConfigService/GetProjectConfigService.js +2 -1
- package/services/GetProjectConfigService/GetProjectConfigService.js.map +1 -1
- package/services/GetProjectConfigService/renderConfigWorker.js +12 -3
- package/services/GetProjectConfigService/renderConfigWorker.js.map +1 -1
- package/services/GetProjectService/GetProjectService.js +2 -2
- package/services/GetProjectService/GetProjectService.js.map +1 -1
- package/services/GetProjectVersionService/GetProjectVersionService.js +2 -2
- package/services/GetProjectVersionService/GetProjectVersionService.js.map +1 -1
- package/services/InstallExtensionService/types.d.ts +4 -0
- package/services/InstallExtensionService/types.js.map +1 -1
- package/services/InstallExtensionService/updateWebinyConfig.js +74 -47
- package/services/InstallExtensionService/updateWebinyConfig.js.map +1 -1
- package/utils/ExtensionSrcResolver.js +2 -1
- package/utils/ExtensionSrcResolver.js.map +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/index.js.map +1 -1
- package/utils/requireConfig.js +9 -5
- package/utils/requireConfig.js.map +1 -1
- package/utils/toImportSpecifier.d.ts +5 -0
- package/utils/toImportSpecifier.js +12 -0
- package/utils/toImportSpecifier.js.map +1 -0
- package/exports/infra/index.d.ts +0 -8
- package/exports/infra/index.js +0 -10
- package/features/BuildApp/PackagesBuilder/utils/requireConfig.d.ts +0 -18
- package/features/BuildApp/PackagesBuilder/utils/requireConfig.js +0 -15
- package/features/BuildApp/PackagesBuilder/utils/requireConfig.js.map +0 -1
- package/features/Watch/watchers/utils/requireConfig.d.ts +0 -18
- package/features/Watch/watchers/utils/requireConfig.js +0 -15
- package/features/Watch/watchers/utils/requireConfig.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["requireConfigWithExecute","serializeError","sendError","err","response","type","error","process","send","sendSuccess","on","reason","Error","String","workerData","JSON","parse","argv","package","pkg","env","variant","region","debug","options","cwd","paths","packageFolder","config","webinyConfigFile","hasBuild","commands","build"],"sources":["worker.ts"],"sourcesContent":["import \"tsx/esm\";\nimport { requireConfigWithExecute } from \"
|
|
1
|
+
{"version":3,"names":["requireConfigWithExecute","serializeError","sendError","err","response","type","error","process","send","sendSuccess","on","reason","Error","String","workerData","JSON","parse","argv","package","pkg","env","variant","region","debug","options","cwd","paths","packageFolder","config","webinyConfigFile","hasBuild","commands","build"],"sources":["worker.ts"],"sourcesContent":["import \"tsx/esm\";\nimport { requireConfigWithExecute } from \"~/utils/index.js\";\nimport { serializeError } from \"serialize-error\";\n\nconst sendError = (err: Error) => {\n const response = {\n type: \"error\",\n error: serializeError(err)\n };\n\n process.send!(response);\n};\n\nconst sendSuccess = () => {\n const response = {\n type: \"success\",\n error: null\n };\n\n process.send!(response);\n};\n\nprocess.on(\"uncaughtException\", err => {\n sendError(err);\n});\n\nprocess.on(\"unhandledRejection\", reason => {\n const err = reason instanceof Error ? reason : new Error(String(reason));\n sendError(err);\n});\n\nconst workerData = JSON.parse(process.argv[2]);\n\nconst { package: pkg, env, variant, region, debug } = workerData;\nconst options = {\n cwd: pkg.paths.packageFolder,\n env,\n variant,\n region,\n debug\n};\n\nconst config = await requireConfigWithExecute(pkg.paths.webinyConfigFile, {\n options\n});\n\nconst hasBuild = config.commands && typeof config.commands.build === \"function\";\nif (!hasBuild) {\n throw new Error(\"Build command not found.\");\n}\n\nawait config.commands.build(options);\n\nsendSuccess();\n"],"mappings":"AAAA,OA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,QAAQ,GAAGF,MAAM,CAACG,QAAQ,IAAI,OAAOH,MAAM,CAACG,QAAQ,CAACC,KAAK,KAAK,UAAU;AAC/E,IAAI,CAACF,QAAQ,EAAE;EACX,MAAM,IAAIlB,KAAK,CAAC,0BAA0B,CAAC;AAC/C;AAEA,MAAMgB,MAAM,CAACG,QAAQ,CAACC,KAAK,CAACR,OAAO,CAAC;AAEpCf,WAAW,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FeatureFlags } from "@webiny/feature-flags";
|
|
2
|
-
import { GetFeatureFlags } from "../../abstractions/index.js";
|
|
3
|
-
import { GetProjectConfig } from "../../abstractions/index.js";
|
|
2
|
+
import { GetFeatureFlags, GetProjectConfig } from "../../abstractions/index.js";
|
|
4
3
|
declare class DefaultGetFeatureFlags implements GetFeatureFlags.Interface {
|
|
5
4
|
private getProjectConfig;
|
|
6
5
|
constructor(getProjectConfig: GetProjectConfig.Interface);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
2
|
import { FeatureFlags } from "@webiny/feature-flags";
|
|
3
|
-
import { GetFeatureFlags } from "../../abstractions/index.js";
|
|
4
|
-
import { GetProjectConfig } from "../../abstractions/index.js";
|
|
3
|
+
import { GetFeatureFlags, GetProjectConfig } from "../../abstractions/index.js";
|
|
5
4
|
import { FeatureFlags as FeatureFlagsExtension } from "../../extensions/FeatureFlags.js";
|
|
6
5
|
class DefaultGetFeatureFlags {
|
|
7
6
|
constructor(getProjectConfig) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createImplementation","FeatureFlags","GetFeatureFlags","GetProjectConfig","FeatureFlagsExtension","DefaultGetFeatureFlags","constructor","getProjectConfig","execute","projectConfig","tags","runtimeContext","extensions","extensionsByType","length","fromDto","params","features","getFeatureFlags","abstraction","implementation","dependencies"],"sources":["GetFeatureFlags.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { FeatureFlags } from \"@webiny/feature-flags\";\nimport { GetFeatureFlags
|
|
1
|
+
{"version":3,"names":["createImplementation","FeatureFlags","GetFeatureFlags","GetProjectConfig","FeatureFlagsExtension","DefaultGetFeatureFlags","constructor","getProjectConfig","execute","projectConfig","tags","runtimeContext","extensions","extensionsByType","length","fromDto","params","features","getFeatureFlags","abstraction","implementation","dependencies"],"sources":["GetFeatureFlags.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { FeatureFlags } from \"@webiny/feature-flags\";\nimport { GetFeatureFlags, GetProjectConfig } from \"~/abstractions/index.js\";\nimport { FeatureFlags as FeatureFlagsExtension } from \"~/extensions/FeatureFlags.js\";\n\nclass DefaultGetFeatureFlags implements GetFeatureFlags.Interface {\n constructor(private getProjectConfig: GetProjectConfig.Interface) {}\n\n async execute(): Promise<FeatureFlags> {\n const projectConfig = await this.getProjectConfig.execute({\n tags: { runtimeContext: \"project\" }\n });\n\n const extensions = projectConfig.extensionsByType(FeatureFlagsExtension);\n\n if (extensions.length === 0) {\n return new FeatureFlags({});\n }\n\n return FeatureFlags.fromDto(extensions[0].params.features);\n }\n}\n\nexport const getFeatureFlags = createImplementation({\n abstraction: GetFeatureFlags,\n implementation: DefaultGetFeatureFlags,\n dependencies: [GetProjectConfig]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,YAAY,QAAQ,uBAAuB;AACpD,SAASC,eAAe,EAAEC,gBAAgB;AAC1C,SAASF,YAAY,IAAIG,qBAAqB;AAE9C,MAAMC,sBAAsB,CAAsC;EAC9DC,WAAWA,CAASC,gBAA4C,EAAE;IAAA,KAA9CA,gBAA4C,GAA5CA,gBAA4C;EAAG;EAEnE,MAAMC,OAAOA,CAAA,EAA0B;IACnC,MAAMC,aAAa,GAAG,MAAM,IAAI,CAACF,gBAAgB,CAACC,OAAO,CAAC;MACtDE,IAAI,EAAE;QAAEC,cAAc,EAAE;MAAU;IACtC,CAAC,CAAC;IAEF,MAAMC,UAAU,GAAGH,aAAa,CAACI,gBAAgB,CAACT,qBAAqB,CAAC;IAExE,IAAIQ,UAAU,CAACE,MAAM,KAAK,CAAC,EAAE;MACzB,OAAO,IAAIb,YAAY,CAAC,CAAC,CAAC,CAAC;IAC/B;IAEA,OAAOA,YAAY,CAACc,OAAO,CAACH,UAAU,CAAC,CAAC,CAAC,CAACI,MAAM,CAACC,QAAQ,CAAC;EAC9D;AACJ;AAEA,OAAO,MAAMC,eAAe,GAAGlB,oBAAoB,CAAC;EAChDmB,WAAW,EAAEjB,eAAe;EAC5BkB,cAAc,EAAEf,sBAAsB;EACtCgB,YAAY,EAAE,CAAClB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { parentPort, workerData } from "worker_threads";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import path from "node:path";
|
|
2
4
|
const {
|
|
3
5
|
handler: handlerParams
|
|
4
6
|
} = workerData;
|
|
5
7
|
try {
|
|
8
|
+
const handlerPath = handlerParams.path;
|
|
9
|
+
const importSpecifier = path.isAbsolute(handlerPath) ? pathToFileURL(handlerPath).href : handlerPath;
|
|
6
10
|
const {
|
|
7
11
|
handler
|
|
8
|
-
} = await import(
|
|
12
|
+
} = await import(importSpecifier);
|
|
9
13
|
const result = await handler(...handlerParams.args);
|
|
10
14
|
parentPort.postMessage(JSON.stringify({
|
|
11
15
|
success: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["parentPort","workerData","handler","handlerParams","
|
|
1
|
+
{"version":3,"names":["parentPort","workerData","pathToFileURL","path","handler","handlerParams","handlerPath","importSpecifier","isAbsolute","href","result","args","postMessage","JSON","stringify","success","error","message","code","data","stack","process","exit"],"sources":["localInvocationWorker.ts"],"sourcesContent":["import { parentPort, workerData } from \"worker_threads\";\nimport { pathToFileURL } from \"node:url\";\nimport path from \"node:path\";\n\nconst { handler: handlerParams } = workerData;\n\ntry {\n const handlerPath = handlerParams.path;\n const importSpecifier = path.isAbsolute(handlerPath)\n ? pathToFileURL(handlerPath).href\n : handlerPath;\n const { handler } = await import(importSpecifier);\n\n const result = await handler(...handlerParams.args);\n parentPort!.postMessage(JSON.stringify({ success: true, result, error: null }));\n} catch (error) {\n const { message, code, data, stack } = error;\n\n parentPort!.postMessage(\n JSON.stringify({\n success: false,\n result: null,\n error: { message, code, data, stack }\n })\n );\n} finally {\n process.exit(0);\n}\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,UAAU,QAAQ,gBAAgB;AACvD,SAASC,aAAa,QAAQ,UAAU;AACxC,OAAOC,IAAI,MAAM,WAAW;AAE5B,MAAM;EAAEC,OAAO,EAAEC;AAAc,CAAC,GAAGJ,UAAU;AAE7C,IAAI;EACA,MAAMK,WAAW,GAAGD,aAAa,CAACF,IAAI;EACtC,MAAMI,eAAe,GAAGJ,IAAI,CAACK,UAAU,CAACF,WAAW,CAAC,GAC9CJ,aAAa,CAACI,WAAW,CAAC,CAACG,IAAI,GAC/BH,WAAW;EACjB,MAAM;IAAEF;EAAQ,CAAC,GAAG,MAAM,MAAM,CAACG,eAAe,CAAC;EAEjD,MAAMG,MAAM,GAAG,MAAMN,OAAO,CAAC,GAAGC,aAAa,CAACM,IAAI,CAAC;EACnDX,UAAU,CAAEY,WAAW,CAACC,IAAI,CAACC,SAAS,CAAC;IAAEC,OAAO,EAAE,IAAI;IAAEL,MAAM;IAAEM,KAAK,EAAE;EAAK,CAAC,CAAC,CAAC;AACnF,CAAC,CAAC,OAAOA,KAAK,EAAE;EACZ,MAAM;IAAEC,OAAO;IAAEC,IAAI;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGJ,KAAK;EAE5ChB,UAAU,CAAEY,WAAW,CACnBC,IAAI,CAACC,SAAS,CAAC;IACXC,OAAO,EAAE,KAAK;IACdL,MAAM,EAAE,IAAI;IACZM,KAAK,EAAE;MAAEC,OAAO;MAAEC,IAAI;MAAEC,IAAI;MAAEC;IAAM;EACxC,CAAC,CACL,CAAC;AACL,CAAC,SAAS;EACNC,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;AACnB","ignoreList":[]}
|
package/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ export { PackageJson } from "@webiny/build-tools/utils/PackageJson.js";
|
|
|
11
11
|
export { createPathResolver } from "./utils/createPathResolver.js";
|
|
12
12
|
export { ExtensionSrcResolver } from "./utils/ExtensionSrcResolver.js";
|
|
13
13
|
export { GracefulError } from "./GracefulError.js";
|
|
14
|
+
export { toImportSpecifier } from "./utils/toImportSpecifier.js";
|
|
14
15
|
export { Wcp } from "./components/Wcp.js";
|
|
15
16
|
export { WcpProjectLicenseProvider, useWcpProjectLicense } from "./services/GetProjectConfigService/WcpProjectLicenseContext.js";
|
package/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { PackageJson } from "@webiny/build-tools/utils/PackageJson.js";
|
|
|
14
14
|
export { createPathResolver } from "./utils/createPathResolver.js";
|
|
15
15
|
export { ExtensionSrcResolver } from "./utils/ExtensionSrcResolver.js";
|
|
16
16
|
export { GracefulError } from "./GracefulError.js";
|
|
17
|
+
export { toImportSpecifier } from "./utils/toImportSpecifier.js";
|
|
17
18
|
export { Wcp } from "./components/Wcp.js";
|
|
18
19
|
export { WcpProjectLicenseProvider, useWcpProjectLicense } from "./services/GetProjectConfigService/WcpProjectLicenseContext.js";
|
|
19
20
|
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ProjectSdk","getProjectSdk","params","init","getStackOutput","appName","sdk","getAppStackOutput","PackageJson","createPathResolver","ExtensionSrcResolver","GracefulError","Wcp","WcpProjectLicenseProvider","useWcpProjectLicense"],"sources":["index.ts"],"sourcesContent":["import { ProjectSdk } from \"./ProjectSdk.js\";\nimport { type GetAppStackOutput } from \"~/abstractions/index.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\n\nexport const getProjectSdk = (...params: Parameters<(typeof ProjectSdk)[\"init\"]>) => {\n return ProjectSdk.init(...params);\n};\n\n// A temporary convenience function to get the stack output for a specific app. We might revisit this in the\n// future and double check if there's a better way to expose this functionality.\nexport const getStackOutput = async <\n TOutput extends GetAppStackOutput.StackOutput = GetAppStackOutput.StackOutput\n>(\n appName: AppName\n) => {\n const sdk = await getProjectSdk();\n return sdk.getAppStackOutput<TOutput>(appName);\n};\n\nexport { ProjectSdk };\n\nexport type { AppName } from \"./abstractions/types.js\";\nexport type * from \"./abstractions/models/index.js\";\n\nexport type { IStackOutput } from \"~/abstractions/features/GetAppStackOutput.js\";\n\nexport { PackageJson } from \"@webiny/build-tools/utils/PackageJson.js\";\n\nexport { createPathResolver } from \"./utils/createPathResolver.js\";\n\nexport { ExtensionSrcResolver } from \"./utils/ExtensionSrcResolver.js\";\n\nexport { GracefulError } from \"./GracefulError.js\";\n\nexport { Wcp } from \"./components/Wcp.js\";\nexport {\n WcpProjectLicenseProvider,\n useWcpProjectLicense\n} from \"./services/GetProjectConfigService/WcpProjectLicenseContext.js\";\n"],"mappings":"AAAA,SAASA,UAAU;AAInB,OAAO,MAAMC,aAAa,GAAGA,CAAC,GAAGC,MAA+C,KAAK;EACjF,OAAOF,UAAU,CAACG,IAAI,CAAC,GAAGD,MAAM,CAAC;AACrC,CAAC;;AAED;AACA;AACA,OAAO,MAAME,cAAc,GAAG,MAG1BC,OAAgB,IACf;EACD,MAAMC,GAAG,GAAG,MAAML,aAAa,CAAC,CAAC;EACjC,OAAOK,GAAG,CAACC,iBAAiB,CAAUF,OAAO,CAAC;AAClD,CAAC;AAED,SAASL,UAAU;AAOnB,SAASQ,WAAW,QAAQ,0CAA0C;AAEtE,SAASC,kBAAkB;AAE3B,SAASC,oBAAoB;AAE7B,SAASC,aAAa;AAEtB,SAASC,GAAG;AACZ,SACIC,yBAAyB,EACzBC,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ProjectSdk","getProjectSdk","params","init","getStackOutput","appName","sdk","getAppStackOutput","PackageJson","createPathResolver","ExtensionSrcResolver","GracefulError","toImportSpecifier","Wcp","WcpProjectLicenseProvider","useWcpProjectLicense"],"sources":["index.ts"],"sourcesContent":["import { ProjectSdk } from \"./ProjectSdk.js\";\nimport { type GetAppStackOutput } from \"~/abstractions/index.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\n\nexport const getProjectSdk = (...params: Parameters<(typeof ProjectSdk)[\"init\"]>) => {\n return ProjectSdk.init(...params);\n};\n\n// A temporary convenience function to get the stack output for a specific app. We might revisit this in the\n// future and double check if there's a better way to expose this functionality.\nexport const getStackOutput = async <\n TOutput extends GetAppStackOutput.StackOutput = GetAppStackOutput.StackOutput\n>(\n appName: AppName\n) => {\n const sdk = await getProjectSdk();\n return sdk.getAppStackOutput<TOutput>(appName);\n};\n\nexport { ProjectSdk };\n\nexport type { AppName } from \"./abstractions/types.js\";\nexport type * from \"./abstractions/models/index.js\";\n\nexport type { IStackOutput } from \"~/abstractions/features/GetAppStackOutput.js\";\n\nexport { PackageJson } from \"@webiny/build-tools/utils/PackageJson.js\";\n\nexport { createPathResolver } from \"./utils/createPathResolver.js\";\n\nexport { ExtensionSrcResolver } from \"./utils/ExtensionSrcResolver.js\";\n\nexport { GracefulError } from \"./GracefulError.js\";\n\nexport { toImportSpecifier } from \"./utils/toImportSpecifier.js\";\n\nexport { Wcp } from \"./components/Wcp.js\";\nexport {\n WcpProjectLicenseProvider,\n useWcpProjectLicense\n} from \"./services/GetProjectConfigService/WcpProjectLicenseContext.js\";\n"],"mappings":"AAAA,SAASA,UAAU;AAInB,OAAO,MAAMC,aAAa,GAAGA,CAAC,GAAGC,MAA+C,KAAK;EACjF,OAAOF,UAAU,CAACG,IAAI,CAAC,GAAGD,MAAM,CAAC;AACrC,CAAC;;AAED;AACA;AACA,OAAO,MAAME,cAAc,GAAG,MAG1BC,OAAgB,IACf;EACD,MAAMC,GAAG,GAAG,MAAML,aAAa,CAAC,CAAC;EACjC,OAAOK,GAAG,CAACC,iBAAiB,CAAUF,OAAO,CAAC;AAClD,CAAC;AAED,SAASL,UAAU;AAOnB,SAASQ,WAAW,QAAQ,0CAA0C;AAEtE,SAASC,kBAAkB;AAE3B,SAASC,oBAAoB;AAE7B,SAASC,aAAa;AAEtB,SAASC,iBAAiB;AAE1B,SAASC,GAAG;AACZ,SACIC,yBAAyB,EACzBC,oBAAoB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/project",
|
|
3
|
-
"version": "6.0.0",
|
|
3
|
+
"version": "6.1.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -10,56 +10,57 @@
|
|
|
10
10
|
"description": "An SDK for managing Webiny projects.",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@webiny/aws-sdk": "6.0.0",
|
|
14
|
-
"@webiny/build-tools": "6.0.0",
|
|
13
|
+
"@webiny/aws-sdk": "6.1.0-beta.0",
|
|
14
|
+
"@webiny/build-tools": "6.1.0-beta.0",
|
|
15
15
|
"@webiny/di": "0.2.3",
|
|
16
|
-
"@webiny/feature-flags": "6.0.0",
|
|
17
|
-
"@webiny/global-config": "6.0.0",
|
|
18
|
-
"@webiny/pulumi-sdk": "6.0.0",
|
|
19
|
-
"@webiny/react-properties": "6.0.0",
|
|
20
|
-
"@webiny/system-requirements": "6.0.0",
|
|
21
|
-
"@webiny/telemetry": "6.0.0",
|
|
22
|
-
"@webiny/utils": "6.0.0",
|
|
23
|
-
"@webiny/wcp": "6.0.0",
|
|
24
|
-
"chalk": "
|
|
25
|
-
"chokidar": "
|
|
16
|
+
"@webiny/feature-flags": "6.1.0-beta.0",
|
|
17
|
+
"@webiny/global-config": "6.1.0-beta.0",
|
|
18
|
+
"@webiny/pulumi-sdk": "6.1.0-beta.0",
|
|
19
|
+
"@webiny/react-properties": "6.1.0-beta.0",
|
|
20
|
+
"@webiny/system-requirements": "6.1.0-beta.0",
|
|
21
|
+
"@webiny/telemetry": "6.1.0-beta.0",
|
|
22
|
+
"@webiny/utils": "6.1.0-beta.0",
|
|
23
|
+
"@webiny/wcp": "6.1.0-beta.0",
|
|
24
|
+
"chalk": "5.6.2",
|
|
25
|
+
"chokidar": "5.0.0",
|
|
26
26
|
"ci-info": "4.4.0",
|
|
27
|
-
"debounce": "
|
|
27
|
+
"debounce": "3.0.0",
|
|
28
28
|
"deepmerge": "4.3.1",
|
|
29
29
|
"dotenv": "17.3.1",
|
|
30
30
|
"execa": "5.1.1",
|
|
31
|
-
"exit-hook": "
|
|
31
|
+
"exit-hook": "5.1.0",
|
|
32
32
|
"fast-glob": "3.3.3",
|
|
33
|
-
"find-up": "
|
|
34
|
-
"get-tsconfig": "4.13.
|
|
33
|
+
"find-up": "8.0.0",
|
|
34
|
+
"get-tsconfig": "4.13.7",
|
|
35
35
|
"graphql-request": "7.4.0",
|
|
36
36
|
"humanize-duration": "3.33.2",
|
|
37
|
+
"jsdom": "29.0.1",
|
|
37
38
|
"load-json-file": "7.0.1",
|
|
38
39
|
"lodash": "4.17.23",
|
|
39
40
|
"minimatch": "10.2.4",
|
|
40
|
-
"mqtt": "5.15.
|
|
41
|
+
"mqtt": "5.15.1",
|
|
41
42
|
"neverthrow": "8.2.0",
|
|
42
43
|
"p-retry": "7.1.1",
|
|
43
|
-
"pino": "
|
|
44
|
-
"pino-pretty": "
|
|
44
|
+
"pino": "10.3.1",
|
|
45
|
+
"pino-pretty": "13.1.3",
|
|
45
46
|
"react": "18.2.0",
|
|
46
|
-
"react-
|
|
47
|
+
"react-dom": "18.2.0",
|
|
47
48
|
"read-json-sync": "2.0.1",
|
|
48
49
|
"replace-in-path": "1.1.0",
|
|
49
|
-
"serialize-error": "
|
|
50
|
+
"serialize-error": "13.0.1",
|
|
50
51
|
"ts-morph": "27.0.2",
|
|
51
52
|
"tsx": "4.21.0",
|
|
52
53
|
"write-json-file": "7.0.0",
|
|
53
|
-
"zod": "3.
|
|
54
|
+
"zod": "4.3.6"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@types/debounce": "1.2.4",
|
|
57
58
|
"@types/humanize-duration": "3.27.4",
|
|
59
|
+
"@types/jsdom": "28.0.1",
|
|
58
60
|
"@types/lodash": "4.17.24",
|
|
59
|
-
"@types/react-test-renderer": "18.3.1",
|
|
60
61
|
"@types/read-json-sync": "2.0.3",
|
|
61
62
|
"rimraf": "6.1.3",
|
|
62
|
-
"type-fest": "5.
|
|
63
|
+
"type-fest": "5.5.0",
|
|
63
64
|
"typescript": "5.9.3"
|
|
64
65
|
},
|
|
65
66
|
"adio": {
|
|
@@ -76,5 +77,5 @@
|
|
|
76
77
|
"access": "public",
|
|
77
78
|
"directory": "dist"
|
|
78
79
|
},
|
|
79
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "a3bd3695c66c79238e380d7360d9731b5fcf9c87"
|
|
80
81
|
}
|
|
@@ -3,6 +3,7 @@ import { GetProjectConfigService, GetProjectService, LoggerService, ProjectSdkPa
|
|
|
3
3
|
import { ExtensionDefinitions as ExtensionDefinitionsExtension } from "../../extensions/ExtensionDefinitions.js";
|
|
4
4
|
import { ExtensionInstanceModel } from "../../defineExtension/index.js";
|
|
5
5
|
import { ProjectConfigModel } from "../../models/ProjectConfigModel.js";
|
|
6
|
+
import { toImportSpecifier } from "../../utils/index.js";
|
|
6
7
|
import { renderConfig } from "./renderConfig.js";
|
|
7
8
|
export class DefaultGetProjectConfigService {
|
|
8
9
|
cachedRenderedConfigs = {};
|
|
@@ -62,7 +63,7 @@ export class DefaultGetProjectConfigService {
|
|
|
62
63
|
// Treat as absolute path.
|
|
63
64
|
importPath = filePath;
|
|
64
65
|
}
|
|
65
|
-
return import(importPath);
|
|
66
|
+
return import(toImportSpecifier(importPath));
|
|
66
67
|
};
|
|
67
68
|
const tagsFilters = params?.tags || {};
|
|
68
69
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createImplementation","GetProjectConfigService","GetProjectService","LoggerService","ProjectSdkParamsService","ExtensionDefinitions","ExtensionDefinitionsExtension","ExtensionInstanceModel","ProjectConfigModel","renderConfig","DefaultGetProjectConfigService","cachedRenderedConfigs","constructor","getProjectService","projectSdkParamsService","loggerService","execute","params","project","currentTime","Date","now","cacheKey","JSON","stringify","renderArgs","info","projectSdkParams","get","args","sdkParams","err","error","Error","message","renderedConfig","debug","config","hydratedConfig","hydrateConfig","model","create","duration","configDto","importFromPath","filePath","importPath","startsWith","paths","rootFolder","join","toString","tagsFilters","tags","extensionDefinitionsType","def","type","extensionsTypes","Object","keys","filter","key","allExtensionDefinitions","extensions","extensionDefinitionsExtensions","ext","default","importedExtensionDefinitions","src","push","scopesFilter","reduce","acc","extensionType","oneOrMoreExtensions","extensionsArray","Array","isArray","matchedExtensions","map","extensionParams","extDef","find","e","warn","length","extDefTags","hasMatchingTags","every","tag","filterValue","extDefValue","Boolean","getProjectConfigService","abstraction","implementation","dependencies"],"sources":["GetProjectConfigService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n GetProjectConfigService,\n GetProjectService,\n LoggerService,\n ProjectSdkParamsService\n} from \"~/abstractions/index.js\";\nimport {\n type ExtensionDto,\n type ExtensionType,\n type IHydratedProjectConfig,\n type IProjectConfigDto\n} from \"~/abstractions/models/index.js\";\nimport { ExtensionDefinitions as ExtensionDefinitionsExtension } from \"~/extensions/ExtensionDefinitions.js\";\nimport { ExtensionInstanceModel } from \"~/defineExtension/index.js\";\nimport { ProjectConfigModel } from \"~/models/ProjectConfigModel.js\";\nimport { renderConfig } from \"./renderConfig.js\";\n\nexport class DefaultGetProjectConfigService implements GetProjectConfigService.Interface {\n cachedRenderedConfigs: Record<string, IProjectConfigDto> = {};\n\n constructor(\n private readonly getProjectService: GetProjectService.Interface,\n private readonly projectSdkParamsService: ProjectSdkParamsService.Interface,\n private readonly loggerService: LoggerService.Interface\n ) {}\n\n async execute(\n params: GetProjectConfigService.Params = {}\n ): Promise<GetProjectConfigService.Result> {\n const project = this.getProjectService.execute();\n\n const currentTime = Date.now();\n const cacheKey = JSON.stringify(params.renderArgs);\n if (!this.cachedRenderedConfigs[cacheKey]) {\n this.loggerService.info(\n { renderArgs: params.renderArgs },\n `Rendering project config...`\n );\n\n try {\n const projectSdkParams = this.projectSdkParamsService.get();\n this.cachedRenderedConfigs[cacheKey] = await renderConfig({\n project,\n args: params.renderArgs,\n sdkParams: projectSdkParams\n });\n } catch (err) {\n this.loggerService.error(\n { err },\n `There was an error while rendering the project config. `\n );\n\n throw new Error(\n `An error occurred while rendering \"webiny.config.tsx\" config file:\\n${err.message}`\n );\n }\n } else {\n this.loggerService.info(\n { renderArgs: params.renderArgs },\n `Skipping rendering project config (cache hit)...`\n );\n }\n\n const renderedConfig = this.cachedRenderedConfigs[cacheKey];\n this.loggerService.debug({ config: renderedConfig }, `Project config rendering complete.`);\n\n const hydratedConfig = await this.hydrateConfig(renderedConfig, params);\n this.loggerService.debug({ config: hydratedConfig }, `Project config hydration complete.`);\n\n const model = ProjectConfigModel.create(hydratedConfig);\n\n const duration = Date.now() - currentTime;\n this.loggerService.info(`Project config rendered and hydrated in ${duration}ms.`);\n\n return model;\n }\n\n private async hydrateConfig(\n configDto: IProjectConfigDto,\n params: GetProjectConfigService.Params\n ): Promise<IHydratedProjectConfig> {\n const projectSdkParams = this.projectSdkParamsService.get();\n const project = this.getProjectService.execute();\n\n const importFromPath = (filePath: string) => {\n let importPath: string;\n if (filePath.startsWith(\"/extensions/\")) {\n // Resolve from project root.\n importPath = project.paths.rootFolder.join(filePath).toString();\n } else {\n // Treat as absolute path.\n importPath = filePath;\n }\n\n return import(importPath);\n };\n\n const tagsFilters = params?.tags || {};\n\n // Exclude extra extension definitions because we are handling these separately.\n const extensionDefinitionsType = ExtensionDefinitionsExtension.def.type;\n\n const extensionsTypes = Object.keys(configDto).filter(\n key => key !== extensionDefinitionsType\n ) as ExtensionType[];\n\n const allExtensionDefinitions = projectSdkParams.extensions;\n\n // Extra definitions registered via config (e.g. `packages/project-aws/src/Webiny.tsx`).\n const extensionDefinitionsExtensions = (configDto[extensionDefinitionsType] ||\n []) as ExtensionDto[];\n\n for (const ext of extensionDefinitionsExtensions) {\n // Load the extension from give `src`.\n const { default: importedExtensionDefinitions } = await importFromPath(ext.src);\n\n allExtensionDefinitions?.push(...importedExtensionDefinitions);\n }\n\n this.loggerService.info({ scopesFilter: tagsFilters }, `Hydrating project config...`);\n\n return extensionsTypes.reduce<IHydratedProjectConfig>(\n (acc, extensionType: ExtensionType) => {\n const oneOrMoreExtensions = configDto[extensionType];\n const extensionsArray = Array.isArray(oneOrMoreExtensions)\n ? [...oneOrMoreExtensions]\n : [oneOrMoreExtensions];\n\n const matchedExtensions = extensionsArray\n .map(extensionParams => {\n const extDef = projectSdkParams.extensions?.find(e => {\n return e.type === extensionType;\n });\n\n if (!extDef) {\n this.loggerService.warn(\n `Could not find extension definition for type: ${extensionType}. Skipping...`\n );\n return null;\n }\n\n if (Object.keys(tagsFilters).length > 0) {\n const extDefTags = extDef.tags;\n\n const hasMatchingTags = Object.keys(tagsFilters).every(tag => {\n const filterValue = tagsFilters[tag];\n const extDefValue = extDefTags[tag];\n\n // Otherwise, check for strict equality.\n return extDefValue === filterValue;\n });\n\n if (!hasMatchingTags) {\n return null;\n }\n }\n\n return new ExtensionInstanceModel(extDef, extensionParams, { project });\n })\n .filter(Boolean) as ExtensionInstanceModel<any>[];\n\n if (matchedExtensions.length > 0) {\n acc[extensionType] = matchedExtensions;\n }\n\n return acc;\n },\n {} as IHydratedProjectConfig\n );\n }\n}\n\nexport const getProjectConfigService = createImplementation({\n abstraction: GetProjectConfigService,\n implementation: DefaultGetProjectConfigService,\n dependencies: [GetProjectService, ProjectSdkParamsService, LoggerService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SACIC,uBAAuB,EACvBC,iBAAiB,EACjBC,aAAa,EACbC,uBAAu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ClE,aAAa,CAACqE,IAAI,CACnB,iDAAiDX,aAAa,eAClE,CAAC;UACD,OAAO,IAAI;QACf;QAEA,IAAIf,MAAM,CAACC,IAAI,CAACP,WAAW,CAAC,CAACiC,MAAM,GAAG,CAAC,EAAE;UACrC,MAAMC,UAAU,GAAGL,MAAM,CAAC5B,IAAI;UAE9B,MAAMkC,eAAe,GAAG7B,MAAM,CAACC,IAAI,CAACP,WAAW,CAAC,CAACoC,KAAK,CAACC,GAAG,IAAI;YAC1D,MAAMC,WAAW,GAAGtC,WAAW,CAACqC,GAAG,CAAC;YACpC,MAAME,WAAW,GAAGL,UAAU,CAACG,GAAG,CAAC;;YAEnC;YACA,OAAOE,WAAW,KAAKD,WAAW;UACtC,CAAC,CAAC;UAEF,IAAI,CAACH,eAAe,EAAE;YAClB,OAAO,IAAI;UACf;QACJ;QAEA,OAAO,IAAIhF,sBAAsB,CAAC0E,MAAM,EAAED,eAAe,EAAE;UAAE9D;QAAQ,CAAC,CAAC;MAC3E,CAAC,CAAC,CACD0C,MAAM,CAACgC,OAAO,CAAkC;MAErD,IAAId,iBAAiB,CAACO,MAAM,GAAG,CAAC,EAAE;QAC9Bb,GAAG,CAACC,aAAa,CAAC,GAAGK,iBAAiB;MAC1C;MAEA,OAAON,GAAG;IACd,CAAC,EACD,CAAC,CACL,CAAC;EACL;AACJ;AAEA,OAAO,MAAMqB,uBAAuB,GAAG7F,oBAAoB,CAAC;EACxD8F,WAAW,EAAE7F,uBAAuB;EACpC8F,cAAc,EAAErF,8BAA8B;EAC9CsF,YAAY,EAAE,CAAC9F,iBAAiB,EAAEE,uBAAuB,EAAED,aAAa;AAC5E,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["createImplementation","GetProjectConfigService","GetProjectService","LoggerService","ProjectSdkParamsService","ExtensionDefinitions","ExtensionDefinitionsExtension","ExtensionInstanceModel","ProjectConfigModel","toImportSpecifier","renderConfig","DefaultGetProjectConfigService","cachedRenderedConfigs","constructor","getProjectService","projectSdkParamsService","loggerService","execute","params","project","currentTime","Date","now","cacheKey","JSON","stringify","renderArgs","info","projectSdkParams","get","args","sdkParams","err","error","Error","message","renderedConfig","debug","config","hydratedConfig","hydrateConfig","model","create","duration","configDto","importFromPath","filePath","importPath","startsWith","paths","rootFolder","join","toString","tagsFilters","tags","extensionDefinitionsType","def","type","extensionsTypes","Object","keys","filter","key","allExtensionDefinitions","extensions","extensionDefinitionsExtensions","ext","default","importedExtensionDefinitions","src","push","scopesFilter","reduce","acc","extensionType","oneOrMoreExtensions","extensionsArray","Array","isArray","matchedExtensions","map","extensionParams","extDef","find","e","warn","length","extDefTags","hasMatchingTags","every","tag","filterValue","extDefValue","Boolean","getProjectConfigService","abstraction","implementation","dependencies"],"sources":["GetProjectConfigService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport {\n GetProjectConfigService,\n GetProjectService,\n LoggerService,\n ProjectSdkParamsService\n} from \"~/abstractions/index.js\";\nimport {\n type ExtensionDto,\n type ExtensionType,\n type IHydratedProjectConfig,\n type IProjectConfigDto\n} from \"~/abstractions/models/index.js\";\nimport { ExtensionDefinitions as ExtensionDefinitionsExtension } from \"~/extensions/ExtensionDefinitions.js\";\nimport { ExtensionInstanceModel } from \"~/defineExtension/index.js\";\nimport { ProjectConfigModel } from \"~/models/ProjectConfigModel.js\";\nimport { toImportSpecifier } from \"~/utils/index.js\";\nimport { renderConfig } from \"./renderConfig.js\";\n\nexport class DefaultGetProjectConfigService implements GetProjectConfigService.Interface {\n cachedRenderedConfigs: Record<string, IProjectConfigDto> = {};\n\n constructor(\n private readonly getProjectService: GetProjectService.Interface,\n private readonly projectSdkParamsService: ProjectSdkParamsService.Interface,\n private readonly loggerService: LoggerService.Interface\n ) {}\n\n async execute(\n params: GetProjectConfigService.Params = {}\n ): Promise<GetProjectConfigService.Result> {\n const project = this.getProjectService.execute();\n\n const currentTime = Date.now();\n const cacheKey = JSON.stringify(params.renderArgs);\n if (!this.cachedRenderedConfigs[cacheKey]) {\n this.loggerService.info(\n { renderArgs: params.renderArgs },\n `Rendering project config...`\n );\n\n try {\n const projectSdkParams = this.projectSdkParamsService.get();\n this.cachedRenderedConfigs[cacheKey] = await renderConfig({\n project,\n args: params.renderArgs,\n sdkParams: projectSdkParams\n });\n } catch (err) {\n this.loggerService.error(\n { err },\n `There was an error while rendering the project config. `\n );\n\n throw new Error(\n `An error occurred while rendering \"webiny.config.tsx\" config file:\\n${err.message}`\n );\n }\n } else {\n this.loggerService.info(\n { renderArgs: params.renderArgs },\n `Skipping rendering project config (cache hit)...`\n );\n }\n\n const renderedConfig = this.cachedRenderedConfigs[cacheKey];\n this.loggerService.debug({ config: renderedConfig }, `Project config rendering complete.`);\n\n const hydratedConfig = await this.hydrateConfig(renderedConfig, params);\n this.loggerService.debug({ config: hydratedConfig }, `Project config hydration complete.`);\n\n const model = ProjectConfigModel.create(hydratedConfig);\n\n const duration = Date.now() - currentTime;\n this.loggerService.info(`Project config rendered and hydrated in ${duration}ms.`);\n\n return model;\n }\n\n private async hydrateConfig(\n configDto: IProjectConfigDto,\n params: GetProjectConfigService.Params\n ): Promise<IHydratedProjectConfig> {\n const projectSdkParams = this.projectSdkParamsService.get();\n const project = this.getProjectService.execute();\n\n const importFromPath = (filePath: string) => {\n let importPath: string;\n if (filePath.startsWith(\"/extensions/\")) {\n // Resolve from project root.\n importPath = project.paths.rootFolder.join(filePath).toString();\n } else {\n // Treat as absolute path.\n importPath = filePath;\n }\n\n return import(toImportSpecifier(importPath));\n };\n\n const tagsFilters = params?.tags || {};\n\n // Exclude extra extension definitions because we are handling these separately.\n const extensionDefinitionsType = ExtensionDefinitionsExtension.def.type;\n\n const extensionsTypes = Object.keys(configDto).filter(\n key => key !== extensionDefinitionsType\n ) as ExtensionType[];\n\n const allExtensionDefinitions = projectSdkParams.extensions;\n\n // Extra definitions registered via config (e.g. `packages/project-aws/src/Webiny.tsx`).\n const extensionDefinitionsExtensions = (configDto[extensionDefinitionsType] ||\n []) as ExtensionDto[];\n\n for (const ext of extensionDefinitionsExtensions) {\n // Load the extension from give `src`.\n const { default: importedExtensionDefinitions } = await importFromPath(ext.src);\n\n allExtensionDefinitions?.push(...importedExtensionDefinitions);\n }\n\n this.loggerService.info({ scopesFilter: tagsFilters }, `Hydrating project config...`);\n\n return extensionsTypes.reduce<IHydratedProjectConfig>(\n (acc, extensionType: ExtensionType) => {\n const oneOrMoreExtensions = configDto[extensionType];\n const extensionsArray = Array.isArray(oneOrMoreExtensions)\n ? [...oneOrMoreExtensions]\n : [oneOrMoreExtensions];\n\n const matchedExtensions = extensionsArray\n .map(extensionParams => {\n const extDef = projectSdkParams.extensions?.find(e => {\n return e.type === extensionType;\n });\n\n if (!extDef) {\n this.loggerService.warn(\n `Could not find extension definition for type: ${extensionType}. Skipping...`\n );\n return null;\n }\n\n if (Object.keys(tagsFilters).length > 0) {\n const extDefTags = extDef.tags;\n\n const hasMatchingTags = Object.keys(tagsFilters).every(tag => {\n const filterValue = tagsFilters[tag];\n const extDefValue = extDefTags[tag];\n\n // Otherwise, check for strict equality.\n return extDefValue === filterValue;\n });\n\n if (!hasMatchingTags) {\n return null;\n }\n }\n\n return new ExtensionInstanceModel(extDef, extensionParams, { project });\n })\n .filter(Boolean) as ExtensionInstanceModel<any>[];\n\n if (matchedExtensions.length > 0) {\n acc[extensionType] = matchedExtensions;\n }\n\n return acc;\n },\n {} as IHydratedProjectConfig\n );\n }\n}\n\nexport const getProjectConfigService = createImplementation({\n abstraction: GetProjectConfigService,\n implementation: DefaultGetProjectConfigService,\n dependencies: [GetProjectService, ProjectSdkParamsService, LoggerService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SACIC,uBAAuB,EACvBC,iBAAiB,EACjBC,aAAa,EACbC,uBAAuB;AAQ3B,SAASC,oBAAoB,IAAIC,6BAA6B;AAC9D,SAASC,sBAAsB;AAC/B,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AA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IAAIf,MAAM,CAACC,IAAI,CAACP,WAAW,CAAC,CAACiC,MAAM,GAAG,CAAC,EAAE;UACrC,MAAMC,UAAU,GAAGL,MAAM,CAAC5B,IAAI;UAE9B,MAAMkC,eAAe,GAAG7B,MAAM,CAACC,IAAI,CAACP,WAAW,CAAC,CAACoC,KAAK,CAACC,GAAG,IAAI;YAC1D,MAAMC,WAAW,GAAGtC,WAAW,CAACqC,GAAG,CAAC;YACpC,MAAME,WAAW,GAAGL,UAAU,CAACG,GAAG,CAAC;;YAEnC;YACA,OAAOE,WAAW,KAAKD,WAAW;UACtC,CAAC,CAAC;UAEF,IAAI,CAACH,eAAe,EAAE;YAClB,OAAO,IAAI;UACf;QACJ;QAEA,OAAO,IAAIjF,sBAAsB,CAAC2E,MAAM,EAAED,eAAe,EAAE;UAAE9D;QAAQ,CAAC,CAAC;MAC3E,CAAC,CAAC,CACD0C,MAAM,CAACgC,OAAO,CAAkC;MAErD,IAAId,iBAAiB,CAACO,MAAM,GAAG,CAAC,EAAE;QAC9Bb,GAAG,CAACC,aAAa,CAAC,GAAGK,iBAAiB;MAC1C;MAEA,OAAON,GAAG;IACd,CAAC,EACD,CAAC,CACL,CAAC;EACL;AACJ;AAEA,OAAO,MAAMqB,uBAAuB,GAAG9F,oBAAoB,CAAC;EACxD+F,WAAW,EAAE9F,uBAAuB;EACpC+F,cAAc,EAAErF,8BAA8B;EAC9CsF,YAAY,EAAE,CAAC/F,iBAAiB,EAAEE,uBAAuB,EAAED,aAAa;AAC5E,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,9 +2,11 @@ import "tsx/esm";
|
|
|
2
2
|
import { Properties, toObject } from "@webiny/react-properties";
|
|
3
3
|
import debounce from "debounce";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import
|
|
5
|
+
import { createRoot } from "react-dom/client";
|
|
6
|
+
import { JSDOM } from "jsdom";
|
|
6
7
|
import { serializeError } from "serialize-error";
|
|
7
8
|
import { ProjectModel } from "../../models/ProjectModel.js";
|
|
9
|
+
import { toImportSpecifier } from "../../utils/index.js";
|
|
8
10
|
import { EnvProvider } from "./EnvContext.js";
|
|
9
11
|
import { WcpProjectLicenseProvider } from "./WcpProjectLicenseContext.js";
|
|
10
12
|
const sendError = err => {
|
|
@@ -46,12 +48,19 @@ const {
|
|
|
46
48
|
const project = ProjectModel.fromDto(projectModelDto);
|
|
47
49
|
const {
|
|
48
50
|
Extensions
|
|
49
|
-
} = await import(project.paths.webinyConfigBaseFile.toString());
|
|
51
|
+
} = await import(toImportSpecifier(project.paths.webinyConfigBaseFile.toString()));
|
|
50
52
|
const onChange = debounce(value => {
|
|
51
53
|
sendSuccess(toObject(value));
|
|
52
54
|
process.exit(0);
|
|
53
55
|
});
|
|
54
|
-
|
|
56
|
+
const {
|
|
57
|
+
window
|
|
58
|
+
} = new JSDOM(`<div id="root"/>`);
|
|
59
|
+
global.window = window;
|
|
60
|
+
global.document = window.document;
|
|
61
|
+
const root = window.document.getElementById("root");
|
|
62
|
+
const reactRoot = createRoot(root);
|
|
63
|
+
reactRoot.render(/*#__PURE__*/React.createElement(WcpProjectLicenseProvider, null, /*#__PURE__*/React.createElement(EnvProvider, null, /*#__PURE__*/React.createElement(Properties, {
|
|
55
64
|
onChange: onChange
|
|
56
65
|
}, /*#__PURE__*/React.createElement(Extensions, null)))));
|
|
57
66
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Properties","toObject","debounce","React","
|
|
1
|
+
{"version":3,"names":["Properties","toObject","debounce","React","createRoot","JSDOM","serializeError","ProjectModel","toImportSpecifier","EnvProvider","WcpProjectLicenseProvider","sendError","err","message","type","error","data","process","send","console","sendSuccess","log","on","exit","reason","Error","String","project","projectModelDto","JSON","parse","argv","fromDto","Extensions","paths","webinyConfigBaseFile","toString","onChange","value","window","global","document","root","getElementById","reactRoot","render","createElement"],"sources":["renderConfigWorker.tsx"],"sourcesContent":["import \"tsx/esm\";\nimport { Properties, toObject } from \"@webiny/react-properties\";\nimport debounce from \"debounce\";\nimport React from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { JSDOM } from \"jsdom\";\nimport { serializeError } from \"serialize-error\";\nimport type { RenderConfigParamsDto, RenderConfigWorkerMessageDto } from \"./renderConfig.js\";\nimport { ProjectModel } from \"~/models/ProjectModel.js\";\nimport { toImportSpecifier } from \"~/utils/index.js\";\nimport { EnvProvider } from \"./EnvContext.js\";\nimport { WcpProjectLicenseProvider } from \"./WcpProjectLicenseContext.js\";\n\nconst sendError = (err: Error) => {\n const message: RenderConfigWorkerMessageDto = {\n type: \"error\",\n error: serializeError(err),\n data: null\n };\n\n if (process.send) {\n process.send!(message);\n } else {\n console.error(message);\n }\n};\n\nconst sendSuccess = (data: Record<string, any> = {}) => {\n const message: RenderConfigWorkerMessageDto = {\n type: \"success\",\n error: null,\n data\n };\n\n if (process.send) {\n process.send!(message);\n } else {\n console.log(message);\n }\n};\n\nprocess.on(\"uncaughtException\", err => {\n sendError(err);\n process.exit(1);\n});\n\nprocess.on(\"unhandledRejection\", reason => {\n const err = reason instanceof Error ? reason : new Error(String(reason));\n sendError(err);\n process.exit(1);\n});\n\nconst { project: projectModelDto } = JSON.parse(process.argv[2]) as RenderConfigParamsDto;\nconst project = ProjectModel.fromDto(projectModelDto);\n\nconst { Extensions } = await import(\n toImportSpecifier(project.paths.webinyConfigBaseFile.toString())\n);\n\nconst onChange = debounce((value: any) => {\n sendSuccess(toObject(value));\n process.exit(0);\n});\n\nconst { window } = new JSDOM(`<div id=\"root\"/>`);\n\n(global as any).window = window;\n\n(global as any).document = window.document;\n\nconst root = window.document.getElementById(\"root\")!;\n\nconst reactRoot = createRoot(root);\n\nreactRoot.render(\n <WcpProjectLicenseProvider>\n <EnvProvider>\n <Properties onChange={onChange}>\n <Extensions />\n </Properties>\n </EnvProvider>\n </WcpProjectLicenseProvider>\n);\n"],"mappings":"AAAA,OAAO,SAAS;AAChB,SAASA,UAAU,EAAEC,QAAQ,QAAQ,0BAA0B;AAC/D,OAAO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ync } from "find-up";
|
|
3
3
|
import { dirname } from "path";
|
|
4
4
|
import { GetCwdService, GetProjectService, GetProjectVersionService } from "../../abstractions/index.js";
|
|
5
5
|
import { ProjectModel } from "../../models/ProjectModel.js";
|
|
@@ -16,7 +16,7 @@ export class DefaultGetProjectService {
|
|
|
16
16
|
return this.cachedProject;
|
|
17
17
|
}
|
|
18
18
|
const cwd = this.getCwdService.execute();
|
|
19
|
-
const webinyConfigFilePathString =
|
|
19
|
+
const webinyConfigFilePathString = findUpSync("webiny.config.tsx", {
|
|
20
20
|
cwd
|
|
21
21
|
});
|
|
22
22
|
if (!webinyConfigFilePathString) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createImplementation","
|
|
1
|
+
{"version":3,"names":["createImplementation","findUpSync","dirname","GetCwdService","GetProjectService","GetProjectVersionService","ProjectModel","PathModel","path","DefaultGetProjectService","cachedProject","constructor","getProjectVersionService","getCwdService","execute","cwd","webinyConfigFilePathString","Error","webinyConfigFilePath","from","projectRootFolderPath","toString","dotWebinyFolderPath","join","workspaceFolderPath","webinyConfigBaseFilePath","localPulumiStateFilesFolderPath","tsConfigFilePath","projectVersion","name","basename","version","paths","dotWebinyFolder","rootFolder","webinyConfigFile","webinyConfigBaseFile","workspaceFolder","localPulumiStateFilesFolder","tsConfigFile","getProjectService","abstraction","implementation","dependencies"],"sources":["GetProjectService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { findUpSync } from \"find-up\";\nimport { dirname } from \"path\";\nimport {\n GetCwdService,\n GetProjectService,\n GetProjectVersionService\n} from \"~/abstractions/index.js\";\nimport { ProjectModel } from \"~/models/ProjectModel.js\";\nimport { PathModel } from \"~/models/PathModel.js\";\nimport path from \"path\";\n\nexport class DefaultGetProjectService implements GetProjectService.Interface {\n cachedProject: ProjectModel | null = null;\n\n constructor(\n private getProjectVersionService: GetProjectVersionService.Interface,\n private getCwdService: GetCwdService.Interface\n ) {}\n\n execute() {\n if (this.cachedProject) {\n return this.cachedProject;\n }\n\n const cwd = this.getCwdService.execute();\n const webinyConfigFilePathString = findUpSync(\"webiny.config.tsx\", { cwd });\n if (!webinyConfigFilePathString) {\n throw new Error(`Could not detect project in given directory (${cwd}).`);\n }\n\n const webinyConfigFilePath = PathModel.from(webinyConfigFilePathString);\n const projectRootFolderPath = PathModel.from(\n dirname(webinyConfigFilePathString.toString())\n );\n const dotWebinyFolderPath = projectRootFolderPath.join(\".webiny\");\n const workspaceFolderPath = projectRootFolderPath.join(\".webiny\", \"workspace\");\n const webinyConfigBaseFilePath = workspaceFolderPath.join(\"webiny.config.base.tsx\");\n const localPulumiStateFilesFolderPath = projectRootFolderPath.join(\".pulumi\");\n const tsConfigFilePath = projectRootFolderPath.join(\"tsconfig.json\");\n const projectVersion = this.getProjectVersionService.execute();\n\n this.cachedProject = new ProjectModel({\n // TODO: read project name from config file.\n name: path.basename(projectRootFolderPath.toString()),\n version: projectVersion,\n paths: {\n dotWebinyFolder: dotWebinyFolderPath,\n rootFolder: projectRootFolderPath,\n webinyConfigFile: webinyConfigFilePath,\n webinyConfigBaseFile: webinyConfigBaseFilePath,\n workspaceFolder: workspaceFolderPath,\n localPulumiStateFilesFolder: localPulumiStateFilesFolderPath,\n tsConfigFile: tsConfigFilePath\n }\n });\n\n return this.cachedProject;\n }\n}\n\nexport const getProjectService = createImplementation({\n abstraction: GetProjectService,\n implementation: DefaultGetProjectService,\n dependencies: [GetProjectVersionService, GetCwdService]\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,OAAO,QAAQ,MAAM;AAC9B,SACIC,aAAa,EACbC,iBAAiB,EACjBC,wBAAwB;AAE5B,SAASC,YAAY;AACrB,SAASC,SAAS;AAClB,OAAOC,IAAI,MAAM,MAAM;AAEvB,OAAO,MAAMC,wBAAwB,CAAwC;EACzEC,aAAa,GAAwB,IAAI;EAEzCC,WAAWA,CACCC,wBAA4D,EAC5D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AK,EAAE;QACHC,eAAe,EAAEX,mBAAmB;QACpCY,UAAU,EAAEd,qBAAqB;QACjCe,gBAAgB,EAAEjB,oBAAoB;QACtCkB,oBAAoB,EAAEX,wBAAwB;QAC9CY,eAAe,EAAEb,mBAAmB;QACpCc,2BAA2B,EAAEZ,+BAA+B;QAC5Da,YAAY,EAAEZ;MAClB;IACJ,CAAC,CAAC;IAEF,OAAO,IAAI,CAACjB,aAAa;EAC7B;AACJ;AAEA,OAAO,MAAM8B,iBAAiB,GAAGxC,oBAAoB,CAAC;EAClDyC,WAAW,EAAErC,iBAAiB;EAC9BsC,cAAc,EAAEjC,wBAAwB;EACxCkC,YAAY,EAAE,CAACtC,wBAAwB,EAAEF,aAAa;AAC1D,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createImplementation } from "@webiny/di";
|
|
2
|
-
import
|
|
2
|
+
import { findUpSync } from "find-up";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { GetProjectVersionService } from "../../abstractions/index.js";
|
|
5
5
|
import readJsonSync from "read-json-sync";
|
|
@@ -14,7 +14,7 @@ class DefaultGetProjectVersionService {
|
|
|
14
14
|
this.cachedProjectVersion = envProjectVersion;
|
|
15
15
|
return this.cachedProjectVersion;
|
|
16
16
|
}
|
|
17
|
-
const pkgJsonPath =
|
|
17
|
+
const pkgJsonPath = findUpSync("package.json", {
|
|
18
18
|
cwd: path.dirname(import.meta.dirname)
|
|
19
19
|
});
|
|
20
20
|
const pkgJson = pkgJsonPath ? readJsonSync(pkgJsonPath) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createImplementation","
|
|
1
|
+
{"version":3,"names":["createImplementation","findUpSync","path","GetProjectVersionService","readJsonSync","DefaultGetProjectVersionService","cachedProjectVersion","execute","envProjectVersion","process","env","WEBINY_VERSION","pkgJsonPath","cwd","dirname","import","meta","pkgJson","version","getProjectVersionService","abstraction","implementation","dependencies"],"sources":["GetProjectVersionService.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/di\";\nimport { findUpSync } from \"find-up\";\nimport path from \"path\";\nimport { GetProjectVersionService } from \"~/abstractions/index.js\";\nimport readJsonSync from \"read-json-sync\";\nimport type { PackageJson } from \"type-fest\";\n\nclass DefaultGetProjectVersionService implements GetProjectVersionService.Interface {\n cachedProjectVersion: string | null = null;\n\n execute() {\n if (this.cachedProjectVersion) {\n return this.cachedProjectVersion;\n }\n\n const envProjectVersion = process.env.WEBINY_VERSION;\n if (envProjectVersion) {\n this.cachedProjectVersion = envProjectVersion;\n return this.cachedProjectVersion;\n }\n\n const pkgJsonPath = findUpSync(\"package.json\", {\n cwd: path.dirname(import.meta.dirname)\n });\n\n const pkgJson = pkgJsonPath ? (readJsonSync(pkgJsonPath) as PackageJson) : null;\n\n if (pkgJson?.version) {\n this.cachedProjectVersion = pkgJson.version;\n return this.cachedProjectVersion;\n }\n\n return \"0.0.0\";\n }\n}\n\nexport const getProjectVersionService = createImplementation({\n abstraction: GetProjectVersionService,\n implementation: DefaultGetProjectVersionService,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,YAAY;AACjD,SAASC,UAAU,QAAQ,SAAS;AACpC,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,wBAAwB;AACjC,OAAOC,YAAY,MAAM,gBAAgB;AAGzC,MAAMC,+BAA+B,CAA+C;EAChFC,oBAAoB,GAAkB,IAAI;EAE1CC,OAAOA,CAAA,EAAG;IACN,IAAI,IAAI,CAACD,oBAAoB,EAAE;MAC3B,OAAO,IAAI,CAACA,oBAAoB;IACpC;IAEA,MAAME,iBAAiB,GAAGC,OAAO,CAACC,GAAG,CAACC,cAAc;IACpD,IAAIH,iBAAiB,EAAE;MACnB,IAAI,CAACF,oBAAoB,GAAGE,iBAAiB;MAC7C,OAAO,IAAI,CAACF,oBAAoB;IACpC;IAEA,MAAMM,WAAW,GAAGX,UAAU,CAAC,cAAc,EAAE;MAC3CY,GAAG,EAAEX,IAAI,CAACY,OAAO,CAACC,MAAM,CAACC,IAAI,CAACF,OAAO;IACzC,CAAC,CAAC;IAEF,MAAMG,OAAO,GAAGL,WAAW,GAAIR,YAAY,CAACQ,WAAW,CAAC,GAAmB,IAAI;IAE/E,IAAIK,OAAO,EAAEC,OAAO,EAAE;MAClB,IAAI,CAACZ,oBAAoB,GAAGW,OAAO,CAACC,OAAO;MAC3C,OAAO,IAAI,CAACZ,oBAAoB;IACpC;IAEA,OAAO,OAAO;EAClB;AACJ;AAEA,OAAO,MAAMa,wBAAwB,GAAGnB,oBAAoB,CAAC;EACzDoB,WAAW,EAAEjB,wBAAwB;EACrCkB,cAAc,EAAEhB,+BAA+B;EAC/CiB,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -38,6 +38,10 @@ export interface ExtensionWebinyConfigTsx {
|
|
|
38
38
|
* Component to render in the Extensions component.
|
|
39
39
|
*/
|
|
40
40
|
component?: ExtensionComponent;
|
|
41
|
+
/**
|
|
42
|
+
* Multiple components to render in the Extensions component.
|
|
43
|
+
*/
|
|
44
|
+
components?: ExtensionComponent[];
|
|
41
45
|
}
|
|
42
46
|
export interface ExtensionImport {
|
|
43
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["/**\n * Schema for Webiny extension.json configuration files.\n * Based on: https://github.com/webiny/extensions/blob/main/schemas/extension.schema.json\n */\nexport interface ExtensionJson {\n $schema?: string;\n /**\n * The unique name of the extension.\n */\n name: string;\n /**\n * The type of extension.\n */\n type: \"admin\" | \"api\" | \"cli\" | \"infra\";\n /**\n * Configuration for how this extension integrates with webiny.config.tsx.\n */\n webinyConfigTsx?: ExtensionWebinyConfigTsx;\n /**\n * Next steps to display after installation (legacy support).\n */\n nextSteps?: ExtensionMessagesConfig;\n /**\n * Additional notes and messages for the extension.\n */\n additionalNotes?: ExtensionMessagesConfig;\n /**\n * Additional package.json properties to merge.\n */\n packageJson?: Record<string, any>;\n}\n\nexport interface ExtensionWebinyConfigTsx {\n /**\n * Array of imports to add to the user's webiny.config.tsx.\n */\n imports?: ExtensionImport[];\n /**\n * Component to render in the Extensions component.\n */\n component?: ExtensionComponent;\n}\n\nexport interface ExtensionImport {\n /**\n * The named import specifier (e.g., 'AdminLogo').\n */\n specifier: string;\n /**\n * The relative path to import from (e.g., './extensions/AdminLogo/AdminLogo.js').\n */\n path: string;\n}\n\nexport interface ExtensionComponent {\n /**\n * The component name to render (should match one of the imported specifiers).\n */\n name: string;\n /**\n * Props to pass to the component (optional).\n */\n props?: Record<string, any>;\n}\n\nexport interface ExtensionMessage {\n /**\n * Message text (can include %s placeholders for variables).\n */\n text: string;\n /**\n * Variables to substitute into the message text.\n */\n variables?: string[];\n}\n\nexport interface ExtensionMessagesConfig {\n /**\n * Array of messages to display to users.\n */\n messages?: ExtensionMessage[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["/**\n * Schema for Webiny extension.json configuration files.\n * Based on: https://github.com/webiny/extensions/blob/main/schemas/extension.schema.json\n */\nexport interface ExtensionJson {\n $schema?: string;\n /**\n * The unique name of the extension.\n */\n name: string;\n /**\n * The type of extension.\n */\n type: \"admin\" | \"api\" | \"cli\" | \"infra\";\n /**\n * Configuration for how this extension integrates with webiny.config.tsx.\n */\n webinyConfigTsx?: ExtensionWebinyConfigTsx;\n /**\n * Next steps to display after installation (legacy support).\n */\n nextSteps?: ExtensionMessagesConfig;\n /**\n * Additional notes and messages for the extension.\n */\n additionalNotes?: ExtensionMessagesConfig;\n /**\n * Additional package.json properties to merge.\n */\n packageJson?: Record<string, any>;\n}\n\nexport interface ExtensionWebinyConfigTsx {\n /**\n * Array of imports to add to the user's webiny.config.tsx.\n */\n imports?: ExtensionImport[];\n /**\n * Component to render in the Extensions component.\n */\n component?: ExtensionComponent;\n /**\n * Multiple components to render in the Extensions component.\n */\n components?: ExtensionComponent[];\n}\n\nexport interface ExtensionImport {\n /**\n * The named import specifier (e.g., 'AdminLogo').\n */\n specifier: string;\n /**\n * The relative path to import from (e.g., './extensions/AdminLogo/AdminLogo.js').\n */\n path: string;\n}\n\nexport interface ExtensionComponent {\n /**\n * The component name to render (should match one of the imported specifiers).\n */\n name: string;\n /**\n * Props to pass to the component (optional).\n */\n props?: Record<string, any>;\n}\n\nexport interface ExtensionMessage {\n /**\n * Message text (can include %s placeholders for variables).\n */\n text: string;\n /**\n * Variables to substitute into the message text.\n */\n variables?: string[];\n}\n\nexport interface ExtensionMessagesConfig {\n /**\n * Array of messages to display to users.\n */\n messages?: ExtensionMessage[];\n}\n"],"mappings":"","ignoreList":[]}
|