@baseplate-dev/project-builder-lib 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler/admin-crud-action-compiler.d.ts +18 -0
- package/dist/compiler/admin-crud-action-compiler.d.ts.map +1 -0
- package/dist/compiler/admin-crud-action-compiler.js +6 -0
- package/dist/compiler/admin-crud-action-compiler.js.map +1 -0
- package/dist/compiler/admin-crud-column-compiler-spec.d.ts +6 -12
- package/dist/compiler/admin-crud-column-compiler-spec.d.ts.map +1 -1
- package/dist/compiler/admin-crud-column-compiler-spec.js +6 -29
- package/dist/compiler/admin-crud-column-compiler-spec.js.map +1 -1
- package/dist/compiler/admin-crud-input-spec.d.ts +6 -11
- package/dist/compiler/admin-crud-input-spec.d.ts.map +1 -1
- package/dist/compiler/admin-crud-input-spec.js +6 -26
- package/dist/compiler/admin-crud-input-spec.js.map +1 -1
- package/dist/compiler/app-compiler-spec.d.ts +8 -12
- package/dist/compiler/app-compiler-spec.d.ts.map +1 -1
- package/dist/compiler/app-compiler-spec.js +11 -18
- package/dist/compiler/app-compiler-spec.js.map +1 -1
- package/dist/compiler/index.d.ts +1 -1
- package/dist/compiler/index.d.ts.map +1 -1
- package/dist/compiler/index.js +1 -1
- package/dist/compiler/index.js.map +1 -1
- package/dist/compiler/model-transformer-compiler-spec.d.ts +6 -11
- package/dist/compiler/model-transformer-compiler-spec.d.ts.map +1 -1
- package/dist/compiler/model-transformer-compiler-spec.js +6 -26
- package/dist/compiler/model-transformer-compiler-spec.js.map +1 -1
- package/dist/definition/model/model-transformer-utils.d.ts +4 -6
- package/dist/definition/model/model-transformer-utils.d.ts.map +1 -1
- package/dist/definition/model/model-transformer-utils.js +8 -10
- package/dist/definition/model/model-transformer-utils.js.map +1 -1
- package/dist/definition/packages/package-utils.d.ts +11 -9
- package/dist/definition/packages/package-utils.d.ts.map +1 -1
- package/dist/definition/packages/package-utils.js +22 -11
- package/dist/definition/packages/package-utils.js.map +1 -1
- package/dist/definition/plugins/plugin-utils.d.ts.map +1 -1
- package/dist/definition/plugins/plugin-utils.js +2 -2
- package/dist/definition/plugins/plugin-utils.js.map +1 -1
- package/dist/definition/project-definition-container.d.ts +3 -3
- package/dist/definition/project-definition-container.d.ts.map +1 -1
- package/dist/definition/project-definition-container.js +2 -2
- package/dist/definition/project-definition-container.js.map +1 -1
- package/dist/definition/project-definition-container.test-utils.d.ts.map +1 -1
- package/dist/definition/project-definition-container.test-utils.js +8 -5
- package/dist/definition/project-definition-container.test-utils.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +2 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/migration-022-rename-packages-to-libraries.d.ts +37 -0
- package/dist/migrations/migration-022-rename-packages-to-libraries.d.ts.map +1 -0
- package/dist/migrations/migration-022-rename-packages-to-libraries.js +45 -0
- package/dist/migrations/migration-022-rename-packages-to-libraries.js.map +1 -0
- package/dist/parser/parser.d.ts +4 -4
- package/dist/parser/parser.d.ts.map +1 -1
- package/dist/parser/parser.js +17 -42
- package/dist/parser/parser.js.map +1 -1
- package/dist/plugins/context/index.d.ts +2 -0
- package/dist/plugins/context/index.d.ts.map +1 -0
- package/dist/plugins/context/index.js +2 -0
- package/dist/plugins/context/index.js.map +1 -0
- package/dist/plugins/context/plugin-context.d.ts +30 -0
- package/dist/plugins/context/plugin-context.d.ts.map +1 -0
- package/dist/plugins/context/plugin-context.js +38 -0
- package/dist/plugins/context/plugin-context.js.map +1 -0
- package/dist/plugins/imports/loader.d.ts +11 -20
- package/dist/plugins/imports/loader.d.ts.map +1 -1
- package/dist/plugins/imports/loader.js +28 -69
- package/dist/plugins/imports/loader.js.map +1 -1
- package/dist/plugins/imports/types.d.ts +72 -13
- package/dist/plugins/imports/types.d.ts.map +1 -1
- package/dist/plugins/imports/types.js +17 -1
- package/dist/plugins/imports/types.js.map +1 -1
- package/dist/plugins/index.d.ts +3 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +3 -1
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/migrations/run-migrations.d.ts +2 -2
- package/dist/plugins/migrations/run-migrations.d.ts.map +1 -1
- package/dist/plugins/migrations/run-migrations.js +2 -2
- package/dist/plugins/migrations/run-migrations.js.map +1 -1
- package/dist/plugins/spec/auth-config-spec.d.ts +13 -9
- package/dist/plugins/spec/auth-config-spec.d.ts.map +1 -1
- package/dist/plugins/spec/auth-config-spec.js +16 -3
- package/dist/plugins/spec/auth-config-spec.js.map +1 -1
- package/dist/plugins/spec/auth-models-spec.d.ts +16 -0
- package/dist/plugins/spec/auth-models-spec.d.ts.map +1 -0
- package/dist/plugins/spec/auth-models-spec.js +16 -0
- package/dist/plugins/spec/auth-models-spec.js.map +1 -0
- package/dist/plugins/spec/config-spec.d.ts +8 -13
- package/dist/plugins/spec/config-spec.d.ts.map +1 -1
- package/dist/plugins/spec/config-spec.js +20 -35
- package/dist/plugins/spec/config-spec.js.map +1 -1
- package/dist/plugins/spec/index.d.ts +1 -1
- package/dist/plugins/spec/index.d.ts.map +1 -1
- package/dist/plugins/spec/index.js +1 -1
- package/dist/plugins/spec/index.js.map +1 -1
- package/dist/plugins/spec/types.d.ts +66 -25
- package/dist/plugins/spec/types.d.ts.map +1 -1
- package/dist/plugins/spec/types.js +27 -10
- package/dist/plugins/spec/types.js.map +1 -1
- package/dist/plugins/spec/web-config-spec.d.ts +7 -10
- package/dist/plugins/spec/web-config-spec.d.ts.map +1 -1
- package/dist/plugins/spec/web-config-spec.js +6 -19
- package/dist/plugins/spec/web-config-spec.js.map +1 -1
- package/dist/plugins/store/index.d.ts.map +1 -0
- package/dist/plugins/store/index.js.map +1 -0
- package/dist/plugins/store/store.d.ts +23 -0
- package/dist/plugins/store/store.d.ts.map +1 -0
- package/dist/plugins/store/store.js +36 -0
- package/dist/plugins/store/store.js.map +1 -0
- package/dist/plugins/utils/create-field-map-spec.d.ts +17 -0
- package/dist/plugins/utils/create-field-map-spec.d.ts.map +1 -0
- package/dist/plugins/utils/create-field-map-spec.js +27 -0
- package/dist/plugins/utils/create-field-map-spec.js.map +1 -0
- package/dist/plugins/utils/create-plugin-field-map.d.ts +24 -0
- package/dist/plugins/utils/create-plugin-field-map.d.ts.map +1 -0
- package/dist/plugins/utils/create-plugin-field-map.js +29 -0
- package/dist/plugins/utils/create-plugin-field-map.js.map +1 -0
- package/dist/plugins/utils/index.d.ts +3 -0
- package/dist/plugins/utils/index.d.ts.map +1 -0
- package/dist/plugins/utils/index.js +3 -0
- package/dist/plugins/utils/index.js.map +1 -0
- package/dist/schema/apps/backend/index.d.ts +0 -2
- package/dist/schema/apps/backend/index.d.ts.map +1 -1
- package/dist/schema/apps/backend/index.js +0 -1
- package/dist/schema/apps/backend/index.js.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-action-spec.d.ts +6 -13
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-action-spec.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-action-spec.js +5 -26
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-action-spec.js.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-crud-action.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-crud-action.js +1 -3
- package/dist/schema/apps/web/admin/sections/crud-actions/admin-crud-action.js.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-column-spec.d.ts +6 -12
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-column-spec.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-column-spec.js +5 -26
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-column-spec.js.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-crud-column.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-crud-column.js +1 -3
- package/dist/schema/apps/web/admin/sections/crud-columns/admin-crud-column.js.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-form/admin-crud-input.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-form/admin-crud-input.js +1 -3
- package/dist/schema/apps/web/admin/sections/crud-form/admin-crud-input.js.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-form/admin-input-spec.d.ts +7 -13
- package/dist/schema/apps/web/admin/sections/crud-form/admin-input-spec.d.ts.map +1 -1
- package/dist/schema/apps/web/admin/sections/crud-form/admin-input-spec.js +5 -26
- package/dist/schema/apps/web/admin/sections/crud-form/admin-input-spec.js.map +1 -1
- package/dist/schema/creator/types.d.ts +3 -3
- package/dist/schema/creator/types.d.ts.map +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/{packages → libraries}/base.d.ts +3 -3
- package/dist/schema/libraries/base.d.ts.map +1 -0
- package/dist/schema/libraries/base.js +10 -0
- package/dist/schema/libraries/base.js.map +1 -0
- package/dist/schema/libraries/index.d.ts +3 -0
- package/dist/schema/libraries/index.d.ts.map +1 -0
- package/dist/schema/libraries/index.js +3 -0
- package/dist/schema/libraries/index.js.map +1 -0
- package/dist/schema/libraries/library.d.ts +19 -0
- package/dist/schema/libraries/library.d.ts.map +1 -0
- package/dist/schema/libraries/library.js +13 -0
- package/dist/schema/libraries/library.js.map +1 -0
- package/dist/schema/libraries/types.d.ts +2 -0
- package/dist/schema/libraries/types.d.ts.map +1 -0
- package/dist/schema/libraries/types.js +3 -0
- package/dist/schema/libraries/types.js.map +1 -0
- package/dist/schema/models/transformers/model-transformer-spec.d.ts +5 -11
- package/dist/schema/models/transformers/model-transformer-spec.d.ts.map +1 -1
- package/dist/schema/models/transformers/model-transformer-spec.js +5 -30
- package/dist/schema/models/transformers/model-transformer-spec.js.map +1 -1
- package/dist/schema/models/transformers/transformers.d.ts.map +1 -1
- package/dist/schema/models/transformers/transformers.js +2 -4
- package/dist/schema/models/transformers/transformers.js.map +1 -1
- package/dist/schema/plugins/definition.js +1 -1
- package/dist/schema/plugins/definition.js.map +1 -1
- package/dist/schema/project-definition.d.ts +6 -32
- package/dist/schema/project-definition.d.ts.map +1 -1
- package/dist/schema/project-definition.js +2 -10
- package/dist/schema/project-definition.js.map +1 -1
- package/dist/schema/settings/monorepo.d.ts +2 -2
- package/dist/schema/settings/monorepo.js +8 -8
- package/dist/schema/settings/monorepo.js.map +1 -1
- package/dist/schema/settings/settings.d.ts +1 -1
- package/dist/specs/index.d.ts +2 -0
- package/dist/specs/index.d.ts.map +1 -0
- package/dist/specs/index.js +2 -0
- package/dist/specs/index.js.map +1 -0
- package/dist/specs/packages/index.d.ts +3 -0
- package/dist/specs/packages/index.d.ts.map +1 -0
- package/dist/specs/packages/index.js +3 -0
- package/dist/specs/packages/index.js.map +1 -0
- package/dist/specs/packages/library-type-spec.d.ts +76 -0
- package/dist/specs/packages/library-type-spec.d.ts.map +1 -0
- package/dist/specs/packages/library-type-spec.js +31 -0
- package/dist/specs/packages/library-type-spec.js.map +1 -0
- package/dist/specs/packages/package-compiler-types.d.ts +111 -0
- package/dist/specs/packages/package-compiler-types.d.ts.map +1 -0
- package/dist/specs/packages/package-compiler-types.js +85 -0
- package/dist/specs/packages/package-compiler-types.js.map +1 -0
- package/dist/web/hooks/use-project-definition.d.ts +2 -2
- package/dist/web/hooks/use-project-definition.d.ts.map +1 -1
- package/dist/web/specs/admin-crud-action-web-spec.d.ts +6 -12
- package/dist/web/specs/admin-crud-action-web-spec.d.ts.map +1 -1
- package/dist/web/specs/admin-crud-action-web-spec.js +6 -29
- package/dist/web/specs/admin-crud-action-web-spec.js.map +1 -1
- package/dist/web/specs/admin-crud-column-web-spec.d.ts +6 -12
- package/dist/web/specs/admin-crud-column-web-spec.d.ts.map +1 -1
- package/dist/web/specs/admin-crud-column-web-spec.js +6 -29
- package/dist/web/specs/admin-crud-column-web-spec.js.map +1 -1
- package/dist/web/specs/admin-crud-input-web-spec.d.ts +6 -12
- package/dist/web/specs/admin-crud-input-web-spec.d.ts.map +1 -1
- package/dist/web/specs/admin-crud-input-web-spec.js +6 -29
- package/dist/web/specs/admin-crud-input-web-spec.js.map +1 -1
- package/dist/web/specs/model-transformer-web-spec.d.ts +8 -13
- package/dist/web/specs/model-transformer-web-spec.d.ts.map +1 -1
- package/dist/web/specs/model-transformer-web-spec.js +16 -28
- package/dist/web/specs/model-transformer-web-spec.js.map +1 -1
- package/package.json +5 -5
- package/dist/compiler/admin-crud-action-spec.d.ts +0 -26
- package/dist/compiler/admin-crud-action-spec.d.ts.map +0 -1
- package/dist/compiler/admin-crud-action-spec.js +0 -29
- package/dist/compiler/admin-crud-action-spec.js.map +0 -1
- package/dist/plugins/schema/index.d.ts.map +0 -1
- package/dist/plugins/schema/index.js.map +0 -1
- package/dist/plugins/schema/store.d.ts +0 -8
- package/dist/plugins/schema/store.d.ts.map +0 -1
- package/dist/plugins/schema/store.js +0 -17
- package/dist/plugins/schema/store.js.map +0 -1
- package/dist/plugins/spec/auth-model-config-spec.d.ts +0 -14
- package/dist/plugins/spec/auth-model-config-spec.d.ts.map +0 -1
- package/dist/plugins/spec/auth-model-config-spec.js +0 -6
- package/dist/plugins/spec/auth-model-config-spec.js.map +0 -1
- package/dist/schema/packages/base.d.ts.map +0 -1
- package/dist/schema/packages/base.js +0 -10
- package/dist/schema/packages/base.js.map +0 -1
- package/dist/schema/packages/index.d.ts +0 -4
- package/dist/schema/packages/index.d.ts.map +0 -1
- package/dist/schema/packages/index.js +0 -4
- package/dist/schema/packages/index.js.map +0 -1
- package/dist/schema/packages/node-library/index.d.ts +0 -16
- package/dist/schema/packages/node-library/index.d.ts.map +0 -1
- package/dist/schema/packages/node-library/index.js +0 -10
- package/dist/schema/packages/node-library/index.js.map +0 -1
- package/dist/schema/packages/types.d.ts +0 -6
- package/dist/schema/packages/types.d.ts.map +0 -1
- package/dist/schema/packages/types.js +0 -6
- package/dist/schema/packages/types.js.map +0 -1
- /package/dist/plugins/{schema → store}/index.d.ts +0 -0
- /package/dist/plugins/{schema → store}/index.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchemaParserContext } from '#src/parser/types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PluginSpecStore } from '#src/plugins/index.js';
|
|
3
3
|
import type { DefinitionEntity, DefinitionReference, FixRefDeletionResult, ResolvedZodRefPayload } from '#src/references/index.js';
|
|
4
4
|
import type { ProjectDefinition } from '#src/schema/index.js';
|
|
5
5
|
import { createProjectDefinitionSchema } from '#src/schema/index.js';
|
|
@@ -15,8 +15,8 @@ export declare class ProjectDefinitionContainer {
|
|
|
15
15
|
references: DefinitionReference[];
|
|
16
16
|
entities: DefinitionEntity[];
|
|
17
17
|
parserContext: SchemaParserContext;
|
|
18
|
-
pluginStore:
|
|
19
|
-
constructor(config: ResolvedZodRefPayload<ProjectDefinition>, parserContext: SchemaParserContext, pluginStore:
|
|
18
|
+
pluginStore: PluginSpecStore;
|
|
19
|
+
constructor(config: ResolvedZodRefPayload<ProjectDefinition>, parserContext: SchemaParserContext, pluginStore: PluginSpecStore);
|
|
20
20
|
/**
|
|
21
21
|
* Fetches the name of an entity by its ID.
|
|
22
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-definition-container.d.ts","sourceRoot":"","sources":["../../src/definition/project-definition-container.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"project-definition-container.d.ts","sourceRoot":"","sources":["../../src/definition/project-definition-container.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EACV,g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yStable } from '@baseplate-dev/utils';
|
|
2
2
|
import { produce } from 'immer';
|
|
3
|
-
import {
|
|
3
|
+
import { createPluginSpecStore, parseProjectDefinitionWithReferences, } from '#src/parser/parser.js';
|
|
4
4
|
import { deserializeSchemaWithTransformedReferences, fixRefDeletions, serializeSchema, } from '#src/references/index.js';
|
|
5
5
|
import { createProjectDefinitionSchema } from '#src/schema/index.js';
|
|
6
6
|
/**
|
|
@@ -88,7 +88,7 @@ export class ProjectDefinitionContainer {
|
|
|
88
88
|
* @returns A new ProjectDefinitionContainer
|
|
89
89
|
*/
|
|
90
90
|
static fromSerializedConfig(config, context) {
|
|
91
|
-
const plugins =
|
|
91
|
+
const plugins = createPluginSpecStore(context.pluginStore, config);
|
|
92
92
|
return new ProjectDefinitionContainer(deserializeSchemaWithTransformedReferences(createProjectDefinitionSchema, config, { plugins }), context, plugins);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-definition-container.js","sourceRoot":"","sources":["../../src/definition/project-definition-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAYhC,OAAO,EACL
|
|
1
|
+
{"version":3,"file":"project-definition-container.js","sourceRoot":"","sources":["../../src/definition/project-definition-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAYhC,OAAO,EACL,qBAAqB,EACrB,oCAAoC,GACrC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0CAA0C,EAC1C,eAAe,EACf,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE;;;;;GAKG;AACH,MAAM,OAAO,0BAA0B;IACrC,UAAU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eAAe,CAAC,6BAA6B,EAAE,aAAa,EAAE;YACnE,OAAO,EAAE,IAAI,CAAC,WAAW;SAC1B,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,oBAAoB;QAClB,MAAM,kBAAkB,GAAG,eAAe,CACxC,6BAA6B,EAC7B,IAAI,CAAC,UAAU,EACf;YACE,WAAW,EAAE,OAAO;YACpB,OAAO,EAAE,IAAI,CAAC,WAAW;SAC1B,CACF,CAAC;QACF,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,cAAc,CACnB,UAA6B,EAC7B,OAA4B;QAE5B,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,GACjD,oCAAoC,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC5D,OAAO,IAAI,0BAA0B,CACnC,gBAAgB,EAChB,OAAO,EACP,WAAW,CACZ,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,oBAAoB,CACzB,MAAe,EACf,OAA4B;QAE5B,MAAM,OAAO,GAAG,qBAAqB,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACnE,OAAO,IAAI,0BAA0B,CACnC,0CAA0C,CACxC,6BAA6B,EAC7B,MAAM,EACN,EAAE,OAAO,EAAE,CACZ,EACD,OAAO,EACP,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-definition-container.test-utils.d.ts","sourceRoot":"","sources":["../../src/definition/project-definition-container.test-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-definition-container.test-utils.d.ts","sourceRoot":"","sources":["../../src/definition/project-definition-container.test-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,mCAAmC,CAAC;AAO3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E,wBAAgB,2BAA2B,CACzC,KAAK,GAAE,OAAO,CAAC,iBAAiB,CAAM,GACrC,iBAAiB,CAkBnB;AAED,wBAAgB,gCAAgC,CAC9C,KAAK,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC1C,sBAAsB,CAKxB;AAED,wBAAgB,oCAAoC,CAClD,KAAK,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC1C,0BAA0B,CA2B5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getLatestMigrationVersion } from '#src/migrations/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { createPluginSpecStore } from '#src/parser/parser.js';
|
|
3
3
|
import { deserializeSchemaWithTransformedReferences } from '#src/references/deserialize-schema.js';
|
|
4
4
|
import { createProjectDefinitionSchema } from '#src/schema/project-definition.js';
|
|
5
5
|
import { ProjectDefinitionContainer } from './project-definition-container.js';
|
|
@@ -15,7 +15,7 @@ export function createTestProjectDefinition(input = {}) {
|
|
|
15
15
|
features: [],
|
|
16
16
|
cliVersion: '1.0.0',
|
|
17
17
|
apps: [],
|
|
18
|
-
|
|
18
|
+
libraries: [],
|
|
19
19
|
models: [],
|
|
20
20
|
isInitialized: true,
|
|
21
21
|
schemaVersion: getLatestMigrationVersion(),
|
|
@@ -31,9 +31,12 @@ export function createTestProjectDefinitionInput(input = {}) {
|
|
|
31
31
|
export function createTestProjectDefinitionContainer(input = {}) {
|
|
32
32
|
const pluginStore = {
|
|
33
33
|
availablePlugins: [],
|
|
34
|
+
coreModules: [],
|
|
34
35
|
};
|
|
35
|
-
const
|
|
36
|
-
|
|
36
|
+
const pluginSpecStore = createPluginSpecStore(pluginStore, {
|
|
37
|
+
plugins: [],
|
|
38
|
+
});
|
|
39
|
+
const resolvedRefPayload = deserializeSchemaWithTransformedReferences(createProjectDefinitionSchema, createTestProjectDefinitionInput(input), { plugins: pluginSpecStore });
|
|
37
40
|
return new ProjectDefinitionContainer(resolvedRefPayload, {
|
|
38
41
|
pluginStore,
|
|
39
42
|
cliVersion: '0.1.0',
|
|
@@ -43,6 +46,6 @@ export function createTestProjectDefinitionContainer(input = {}) {
|
|
|
43
46
|
directory: '/test-project',
|
|
44
47
|
isInternalExample: false,
|
|
45
48
|
},
|
|
46
|
-
},
|
|
49
|
+
}, pluginSpecStore);
|
|
47
50
|
}
|
|
48
51
|
//# sourceMappingURL=project-definition-container.test-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-definition-container.test-utils.js","sourceRoot":"","sources":["../../src/definition/project-definition-container.test-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-definition-container.test-utils.js","sourceRoot":"","sources":["../../src/definition/project-definition-container.test-utils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,0CAA0C,EAAE,MAAM,uCAAuC,CAAC;AACnG,OAAO,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAElF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E,MAAM,UAAU,2BAA2B,CACzC,QAAoC,EAAE;IAEtC,OAAO;QACL,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,IAAI,EAAE,cAAc;gBACpB,YAAY,EAAE,EAAE;gBAChB,UAAU,EAAE,IAAI;aACjB;SACF;QACD,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,OAAO;QACnB,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,EAAE;QACb,MAAM,EAAE,EAAE;QACV,aAAa,EAAE,IAAI;QACnB,aAAa,EAAE,yBAAyB,EAAE;QAC1C,GAAG,KAAK;KACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,QAAyC,EAAE;IAE3C,OAAO;QACL,GAAG,2BAA2B,EAAE;QAChC,GAAG,KAAK;KACT,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,QAAyC,EAAE;IAE3C,MAAM,WAAW,GAAgB;QAC/B,gBAAgB,EAAE,EAAE;QACpB,WAAW,EAAE,EAAE;KAChB,CAAC;IACF,MAAM,eAAe,GAAG,qBAAqB,CAAC,WAAW,EAAE;QACzD,OAAO,EAAE,EAAE;KACZ,CAAC,CAAC;IACH,MAAM,kBAAkB,GAAG,0CAA0C,CACnE,6BAA6B,EAC7B,gCAAgC,CAAC,KAAK,CAAC,EACvC,EAAE,OAAO,EAAE,eAAe,EAAE,CAC7B,CAAC;IACF,OAAO,IAAI,0BAA0B,CACnC,kBAAkB,EAClB;QACE,WAAW;QACX,UAAU,EAAE,OAAO;QACnB,OAAO,EAAE;YACP,EAAE,EAAE,cAAc;YAClB,IAAI,EAAE,cAAc;YACpB,SAAS,EAAE,eAAe;YAC1B,iBAAiB,EAAE,KAAK;SACzB;KACF,EACD,eAAe,CAChB,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './parser/index.js';
|
|
|
7
7
|
export * from './plugins/index.js';
|
|
8
8
|
export * from './references/index.js';
|
|
9
9
|
export * from './schema/index.js';
|
|
10
|
+
export * from './specs/index.js';
|
|
10
11
|
export * from './tools/index.js';
|
|
11
12
|
export * from './types/field-types.js';
|
|
12
13
|
export * from './utils/index.js';
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from './parser/index.js';
|
|
|
7
7
|
export * from './plugins/index.js';
|
|
8
8
|
export * from './references/index.js';
|
|
9
9
|
export * from './schema/index.js';
|
|
10
|
+
export * from './specs/index.js';
|
|
10
11
|
export * from './tools/index.js';
|
|
11
12
|
export * from './types/field-types.js';
|
|
12
13
|
export * from './utils/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAqBlD,eAAO,MAAM,iBAAiB,EAAE,eAAe,EAmB9C,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,iBAAiB,EAAE,OAAO,GACzB,iBAAiB,IAAI,iBAAiB,CAMxC;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,SAAgB,aAAa,EAAE,MAAM,CAAC;IACtC,SAAgB,KAAK,EAAE,OAAO,CAAC;gBAEnB,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAQlD;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG;IAC9D,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,iBAAiB,EAAE,eAAe,EAAE,CAAC;CACtC,CAoBA;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAElD"}
|
package/dist/migrations/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { migration018CrudNameFieldRef } from './migration-018-crud-name-field-re
|
|
|
15
15
|
import { migration019ColumnTypeBased } from './migration-019-column-type-based.js';
|
|
16
16
|
import { migration020MoveRedisToInfrastructure } from './migration-020-move-redis-to-infrastructure.js';
|
|
17
17
|
import { migration021MigrateBullmqToPlugin } from './migration-021-migrate-bullmq-to-plugin.js';
|
|
18
|
+
import { migration022RenamePackagesToLibraries } from './migration-022-rename-packages-to-libraries.js';
|
|
18
19
|
export const SCHEMA_MIGRATIONS = [
|
|
19
20
|
migration005PrimaryUniqueRefs,
|
|
20
21
|
migration006IndividualServiceControllers,
|
|
@@ -33,6 +34,7 @@ export const SCHEMA_MIGRATIONS = [
|
|
|
33
34
|
migration019ColumnTypeBased,
|
|
34
35
|
migration020MoveRedisToInfrastructure,
|
|
35
36
|
migration021MigrateBullmqToPlugin,
|
|
37
|
+
migration022RenamePackagesToLibraries,
|
|
36
38
|
];
|
|
37
39
|
export function isMigrateableProjectDefinition(projectDefinition) {
|
|
38
40
|
return (typeof projectDefinition === 'object' &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,wCAAwC,EAAE,MAAM,mDAAmD,CAAC;AAC7G,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,qCAAqC,EAAE,MAAM,iDAAiD,CAAC;AACxG,OAAO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,CAAuB;gBAC/D,aAAa,EAAE,SAAS,CAAC,OAAO;aACjC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,oBAAoB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
interface LibraryConfig {
|
|
2
|
+
id: string;
|
|
3
|
+
type: string;
|
|
4
|
+
name: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
interface MonorepoSettings {
|
|
8
|
+
appsFolder?: string;
|
|
9
|
+
packagesFolder?: string;
|
|
10
|
+
librariesFolder?: string;
|
|
11
|
+
}
|
|
12
|
+
interface Settings {
|
|
13
|
+
monorepo?: MonorepoSettings;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
interface OldConfig {
|
|
17
|
+
packages?: LibraryConfig[];
|
|
18
|
+
settings?: Settings;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
interface NewConfig {
|
|
22
|
+
libraries?: LibraryConfig[];
|
|
23
|
+
settings?: Settings;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Migration to rename packages to libraries
|
|
28
|
+
*
|
|
29
|
+
* This migration:
|
|
30
|
+
* 1. Renames the top-level `packages` field to `libraries`
|
|
31
|
+
* 2. Updates package IDs from `package:*` to `library:*`
|
|
32
|
+
* 3. Renames `settings.monorepo.packagesFolder` to `settings.monorepo.librariesFolder`
|
|
33
|
+
* and changes the default from 'packages' to 'libs'
|
|
34
|
+
*/
|
|
35
|
+
export declare const migration022RenamePackagesToLibraries: import("./types.js").SchemaMigration<OldConfig, NewConfig>;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=migration-022-rename-packages-to-libraries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-022-rename-packages-to-libraries.d.ts","sourceRoot":"","sources":["../../src/migrations/migration-022-rename-packages-to-libraries.ts"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,UAAU,gBAAgB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,UAAU,QAAQ;IAChB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,UAAU,SAAS;IACjB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,UAAU,SAAS;IACjB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qCAAqC,4DAyChD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createSchemaMigration } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Migration to rename packages to libraries
|
|
4
|
+
*
|
|
5
|
+
* This migration:
|
|
6
|
+
* 1. Renames the top-level `packages` field to `libraries`
|
|
7
|
+
* 2. Updates package IDs from `package:*` to `library:*`
|
|
8
|
+
* 3. Renames `settings.monorepo.packagesFolder` to `settings.monorepo.librariesFolder`
|
|
9
|
+
* and changes the default from 'packages' to 'libs'
|
|
10
|
+
*/
|
|
11
|
+
export const migration022RenamePackagesToLibraries = createSchemaMigration({
|
|
12
|
+
version: 22,
|
|
13
|
+
name: 'renamePackagesToLibraries',
|
|
14
|
+
description: 'Rename packages to libraries and packagesFolder to librariesFolder',
|
|
15
|
+
migrate: (config) => {
|
|
16
|
+
const { packages, settings, ...rest } = config;
|
|
17
|
+
// Rename packages to libraries and update IDs
|
|
18
|
+
const libraries = packages?.map((pkg) => ({
|
|
19
|
+
...pkg,
|
|
20
|
+
id: pkg.id.replace(/^package:/, 'library:'),
|
|
21
|
+
}));
|
|
22
|
+
// Update monorepo settings if present
|
|
23
|
+
let newSettings = settings;
|
|
24
|
+
if (settings?.monorepo) {
|
|
25
|
+
const { packagesFolder, ...restMonorepo } = settings.monorepo;
|
|
26
|
+
newSettings = {
|
|
27
|
+
...settings,
|
|
28
|
+
monorepo: {
|
|
29
|
+
...restMonorepo,
|
|
30
|
+
// If packagesFolder was explicitly set to 'packages' (old default) or not set,
|
|
31
|
+
// use 'libs' (new default). Otherwise preserve the custom value.
|
|
32
|
+
librariesFolder: packagesFolder === undefined || packagesFolder === 'packages'
|
|
33
|
+
? 'libs'
|
|
34
|
+
: packagesFolder,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
...rest,
|
|
40
|
+
libraries,
|
|
41
|
+
settings: newSettings,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=migration-022-rename-packages-to-libraries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-022-rename-packages-to-libraries.js","sourceRoot":"","sources":["../../src/migrations/migration-022-rename-packages-to-libraries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAgCnD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,qBAAqB,CAGxE;IACA,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,oEAAoE;IACtE,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE;QAClB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAE/C,8CAA8C;QAC9C,MAAM,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACxC,GAAG,GAAG;YACN,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC;SAC5C,CAAC,CAAC,CAAC;QAEJ,sCAAsC;QACtC,IAAI,WAAW,GAAG,QAAQ,CAAC;QAC3B,IAAI,QAAQ,EAAE,QAAQ,EAAE,CAAC;YACvB,MAAM,EAAE,cAAc,EAAE,GAAG,YAAY,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC;YAC9D,WAAW,GAAG;gBACZ,GAAG,QAAQ;gBACX,QAAQ,EAAE;oBACR,GAAG,YAAY;oBACf,+EAA+E;oBAC/E,iEAAiE;oBACjE,eAAe,EACb,cAAc,KAAK,SAAS,IAAI,cAAc,KAAK,UAAU;wBAC3D,CAAC,CAAC,MAAM;wBACR,CAAC,CAAC,cAAc;iBACrB;aACF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,GAAG,IAAI;YACP,SAAS;YACT,QAAQ,EAAE,WAAW;SACT,CAAC;IACjB,CAAC;CACF,CAAC,CAAC"}
|
package/dist/parser/parser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PluginStore } from '#src/plugins/imports/types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PluginMetadataWithPaths, PluginSpecStore } from '#src/plugins/index.js';
|
|
3
3
|
import type { ResolvedZodRefPayload } from '#src/references/types.js';
|
|
4
4
|
import type { ProjectDefinition, ProjectDefinitionSchema } from '#src/schema/project-definition.js';
|
|
5
5
|
import type { SchemaParserContext } from './types.js';
|
|
@@ -11,7 +11,7 @@ import type { SchemaParserContext } from './types.js';
|
|
|
11
11
|
* @param projectDefinition The project definition to use
|
|
12
12
|
* @returns The plugin implementation store
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function createPluginSpecStore(pluginStore: PluginStore, projectDefinition: unknown): PluginSpecStore;
|
|
15
15
|
/**
|
|
16
16
|
* Creates a plugin implementation store with the given plugins added to the project definition.
|
|
17
17
|
*
|
|
@@ -20,7 +20,7 @@ export declare function createPluginImplementationStore(pluginStore: PluginStore
|
|
|
20
20
|
* @param projectDefinition The project definition to use
|
|
21
21
|
* @returns The plugin implementation store
|
|
22
22
|
*/
|
|
23
|
-
export declare function createPluginImplementationStoreWithNewPlugins(pluginStore: PluginStore, plugins: PluginMetadataWithPaths[], projectDefinition: ProjectDefinition):
|
|
23
|
+
export declare function createPluginImplementationStoreWithNewPlugins(pluginStore: PluginStore, plugins: PluginMetadataWithPaths[], projectDefinition: ProjectDefinition): PluginSpecStore;
|
|
24
24
|
/**
|
|
25
25
|
* Creates a project definition schema with the given context.
|
|
26
26
|
*
|
|
@@ -39,6 +39,6 @@ export declare function parseProjectDefinitionWithContext(projectDefinition: unk
|
|
|
39
39
|
*/
|
|
40
40
|
export declare function parseProjectDefinitionWithReferences(projectDefinition: unknown, context: SchemaParserContext): {
|
|
41
41
|
definition: ResolvedZodRefPayload<ProjectDefinition>;
|
|
42
|
-
pluginStore:
|
|
42
|
+
pluginStore: PluginSpecStore;
|
|
43
43
|
};
|
|
44
44
|
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,WAAW,EACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,mCAAmC,CAAC;AAW3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,OAAO,GACzB,eAAe,CAwBjB;AAED;;;;;;;GAOG;AACH,wBAAgB,6CAA6C,CAC3D,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,uBAAuB,EAAE,EAClC,iBAAiB,EAAE,iBAAiB,GACnC,eAAe,CAsBjB;AAED;;;;;;GAMG;AACH,wBAAgB,wCAAwC,CACtD,iBAAiB,EAAE,OAAO,EAC1B,OAAO,EAAE,mBAAmB,GAC3B,uBAAuB,CAOzB;AAED,wBAAgB,iCAAiC,CAC/C,iBAAiB,EAAE,OAAO,EAC1B,OAAO,EAAE,mBAAmB,GAC3B,iBAAiB,CAMnB;AAED;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAClD,iBAAiB,EAAE,OAAO,EAC1B,OAAO,EAAE,mBAAmB,GAC3B;IACD,UAAU,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;IACrD,WAAW,EAAE,eAAe,CAAC;CAC9B,CASA"}
|
package/dist/parser/parser.js
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { initializePlugins } from '#src/plugins/imports/loader.js';
|
|
3
|
-
import { pluginConfigSpec } from '#src/plugins/index.js';
|
|
4
3
|
import { parseSchemaWithTransformedReferences } from '#src/references/parse-schema-with-references.js';
|
|
5
|
-
import {
|
|
4
|
+
import { createDefinitionSchemaParserContext, pluginEntityType, } from '#src/schema/index.js';
|
|
6
5
|
import { basePluginDefinitionSchema } from '#src/schema/plugins/definition.js';
|
|
7
6
|
import { createProjectDefinitionSchema } from '#src/schema/project-definition.js';
|
|
8
|
-
const COMMON_SPEC_IMPLEMENTATIONS = [
|
|
9
|
-
pluginConfigSpec,
|
|
10
|
-
modelTransformerSpec,
|
|
11
|
-
adminCrudInputSpec,
|
|
12
|
-
adminCrudActionSpec,
|
|
13
|
-
adminCrudColumnSpec,
|
|
14
|
-
];
|
|
15
7
|
/**
|
|
16
8
|
* Creates a plugin implementation store from the project definition and plugin store,
|
|
17
9
|
* initializing the set of plugins enabled in the project definition.
|
|
@@ -20,8 +12,8 @@ const COMMON_SPEC_IMPLEMENTATIONS = [
|
|
|
20
12
|
* @param projectDefinition The project definition to use
|
|
21
13
|
* @returns The plugin implementation store
|
|
22
14
|
*/
|
|
23
|
-
export function
|
|
24
|
-
const { availablePlugins,
|
|
15
|
+
export function createPluginSpecStore(pluginStore, projectDefinition) {
|
|
16
|
+
const { availablePlugins, coreModules } = pluginStore;
|
|
25
17
|
const pluginData = z
|
|
26
18
|
.object({
|
|
27
19
|
plugins: z.array(basePluginDefinitionSchema).optional(),
|
|
@@ -29,35 +21,18 @@ export function createPluginImplementationStore(pluginStore, projectDefinition)
|
|
|
29
21
|
.parse(projectDefinition);
|
|
30
22
|
const { plugins = [] } = pluginData;
|
|
31
23
|
// initialize plugins
|
|
32
|
-
const
|
|
33
|
-
...COMMON_SPEC_IMPLEMENTATIONS,
|
|
34
|
-
...builtinSpecImplementations,
|
|
35
|
-
];
|
|
36
|
-
const specImplementations = {};
|
|
37
|
-
for (const spec of initialImplementations) {
|
|
38
|
-
if ('type' in spec) {
|
|
39
|
-
if (typeof spec.defaultInitializer !== 'function') {
|
|
40
|
-
throw new TypeError(`Spec ${spec.type} does not have a defaultInitializer function!`);
|
|
41
|
-
}
|
|
42
|
-
specImplementations[spec.name] = spec.defaultInitializer();
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
specImplementations[spec.spec.name] = spec.implementation;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
const pluginsWithModules = plugins.map((p) => {
|
|
24
|
+
const modulesWithKey = plugins.flatMap((p) => {
|
|
49
25
|
const plugin = availablePlugins.find(({ metadata }) => metadata.name === p.name && metadata.packageName === p.packageName);
|
|
50
|
-
const pluginName = `${p.packageName}/${p.name}`;
|
|
51
26
|
if (!plugin) {
|
|
52
|
-
throw new Error(`Unable to find plugin ${
|
|
27
|
+
throw new Error(`Unable to find plugin ${p.packageName}/${p.name}!`);
|
|
53
28
|
}
|
|
54
|
-
return {
|
|
55
|
-
key: plugin.metadata.key
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
29
|
+
return plugin.modules.map((m) => ({
|
|
30
|
+
key: `${plugin.metadata.key}/${m.directory}/${m.module.name}`,
|
|
31
|
+
pluginKey: plugin.metadata.key,
|
|
32
|
+
module: m.module,
|
|
33
|
+
}));
|
|
59
34
|
});
|
|
60
|
-
return initializePlugins(
|
|
35
|
+
return initializePlugins([...modulesWithKey, ...coreModules]);
|
|
61
36
|
}
|
|
62
37
|
/**
|
|
63
38
|
* Creates a plugin implementation store with the given plugins added to the project definition.
|
|
@@ -83,7 +58,7 @@ export function createPluginImplementationStoreWithNewPlugins(pluginStore, plugi
|
|
|
83
58
|
})),
|
|
84
59
|
],
|
|
85
60
|
};
|
|
86
|
-
return
|
|
61
|
+
return createPluginSpecStore(pluginStore, newProjectDefinition);
|
|
87
62
|
}
|
|
88
63
|
/**
|
|
89
64
|
* Creates a project definition schema with the given context.
|
|
@@ -94,9 +69,9 @@ export function createPluginImplementationStoreWithNewPlugins(pluginStore, plugi
|
|
|
94
69
|
*/
|
|
95
70
|
export function createProjectDefinitionSchemaWithContext(projectDefinition, context) {
|
|
96
71
|
const { pluginStore } = context;
|
|
97
|
-
const
|
|
72
|
+
const pluginSpecStore = createPluginSpecStore(pluginStore, projectDefinition);
|
|
98
73
|
const definitionContext = createDefinitionSchemaParserContext({
|
|
99
|
-
plugins:
|
|
74
|
+
plugins: pluginSpecStore,
|
|
100
75
|
});
|
|
101
76
|
return createProjectDefinitionSchema(definitionContext);
|
|
102
77
|
}
|
|
@@ -113,8 +88,8 @@ export function parseProjectDefinitionWithContext(projectDefinition, context) {
|
|
|
113
88
|
*/
|
|
114
89
|
export function parseProjectDefinitionWithReferences(projectDefinition, context) {
|
|
115
90
|
const { pluginStore } = context;
|
|
116
|
-
const
|
|
117
|
-
const definition = parseSchemaWithTransformedReferences(createProjectDefinitionSchema, projectDefinition, { plugins:
|
|
118
|
-
return { definition, pluginStore:
|
|
91
|
+
const pluginSpecStore = createPluginSpecStore(pluginStore, projectDefinition);
|
|
92
|
+
const definition = parseSchemaWithTransformedReferences(createProjectDefinitionSchema, projectDefinition, { plugins: pluginSpecStore });
|
|
93
|
+
return { definition, pluginStore: pluginSpecStore };
|
|
119
94
|
}
|
|
120
95
|
//# sourceMappingURL=parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,oCAAoC,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EACL,mCAAmC,EACnC,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAA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,CAC/C,iBAA0B,EAC1B,OAA4B;IAE5B,MAAM,MAAM,GAAG,wCAAwC,CACrD,iBAAiB,EACjB,OAAO,CACR,CAAC;IACF,OAAO,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oCAAoC,CAClD,iBAA0B,EAC1B,OAA4B;IAK5B,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAChC,MAAM,eAAe,GAAG,qBAAqB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IAC9E,MAAM,UAAU,GAAG,oCAAoC,CACrD,6BAA6B,EAC7B,iBAAiB,EACjB,EAAE,OAAO,EAAE,eAAe,EAAE,CAC7B,CAAC;IACF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin context module for tracking the current plugin being initialized.
|
|
3
|
+
*
|
|
4
|
+
* Uses a simple synchronous context that works on both Node and browser platforms.
|
|
5
|
+
* This is safe because plugin initialization is synchronous and single-threaded.
|
|
6
|
+
*/
|
|
7
|
+
export interface PluginContext {
|
|
8
|
+
/** Full module key: "{pluginKey}/{moduleDir}/{name}" or "core/{platform}/{name}" */
|
|
9
|
+
moduleKey: string;
|
|
10
|
+
/** The plugin key (or "core" for core modules) */
|
|
11
|
+
pluginKey: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Runs a function within a plugin context.
|
|
15
|
+
*
|
|
16
|
+
* This sets the current plugin context for the duration of the function execution,
|
|
17
|
+
* allowing nested functions to access the plugin key via `getPluginContext()`.
|
|
18
|
+
*
|
|
19
|
+
* @param context - The plugin context to set
|
|
20
|
+
* @param fn - The function to run within the context
|
|
21
|
+
* @returns The result of the function
|
|
22
|
+
*/
|
|
23
|
+
export declare function runInPluginContext<T>(context: PluginContext, fn: () => T): T;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the current plugin context if one exists.
|
|
26
|
+
*
|
|
27
|
+
* @returns The current plugin context, or undefined if not in a plugin context
|
|
28
|
+
*/
|
|
29
|
+
export declare function getPluginContext(): PluginContext | undefined;
|
|
30
|
+
//# sourceMappingURL=plugin-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-context.d.ts","sourceRoot":"","sources":["../../../src/plugins/context/plugin-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,aAAa;IAC5B,oFAAoF;IACpF,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAQ5E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAE5D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin context module for tracking the current plugin being initialized.
|
|
3
|
+
*
|
|
4
|
+
* Uses a simple synchronous context that works on both Node and browser platforms.
|
|
5
|
+
* This is safe because plugin initialization is synchronous and single-threaded.
|
|
6
|
+
*/
|
|
7
|
+
// Simple synchronous context - works on both Node and browser
|
|
8
|
+
// Safe because plugin initialization is synchronous and single-threaded
|
|
9
|
+
let currentPluginContext;
|
|
10
|
+
/**
|
|
11
|
+
* Runs a function within a plugin context.
|
|
12
|
+
*
|
|
13
|
+
* This sets the current plugin context for the duration of the function execution,
|
|
14
|
+
* allowing nested functions to access the plugin key via `getPluginContext()`.
|
|
15
|
+
*
|
|
16
|
+
* @param context - The plugin context to set
|
|
17
|
+
* @param fn - The function to run within the context
|
|
18
|
+
* @returns The result of the function
|
|
19
|
+
*/
|
|
20
|
+
export function runInPluginContext(context, fn) {
|
|
21
|
+
const prev = currentPluginContext;
|
|
22
|
+
currentPluginContext = context;
|
|
23
|
+
try {
|
|
24
|
+
return fn();
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
currentPluginContext = prev;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Gets the current plugin context if one exists.
|
|
32
|
+
*
|
|
33
|
+
* @returns The current plugin context, or undefined if not in a plugin context
|
|
34
|
+
*/
|
|
35
|
+
export function getPluginContext() {
|
|
36
|
+
return currentPluginContext;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=plugin-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-context.js","sourceRoot":"","sources":["../../../src/plugins/context/plugin-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,8DAA8D;AAC9D,wEAAwE;AACxE,IAAI,oBAA+C,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAI,OAAsB,EAAE,EAAW;IACvE,MAAM,IAAI,GAAG,oBAAoB,CAAC;IAClC,oBAAoB,GAAG,OAAO,CAAC;IAC/B,IAAI,CAAC;QACH,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;YAAS,CAAC;QACT,oBAAoB,GAAG,IAAI,CAAC;IAC9B,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,oBAAoB,CAAC;AAC9B,CAAC"}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
export interface PluginWithPlatformModules {
|
|
5
|
-
key: string;
|
|
6
|
-
name: string;
|
|
7
|
-
pluginModules: KeyedPluginPlatformModule[];
|
|
8
|
-
}
|
|
9
|
-
interface KeyedPlatformModuleWithPlugin extends KeyedPluginPlatformModule {
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
pluginKey: string;
|
|
13
|
-
pluginName: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function extractPlatformModulesFromPlugins(plugins: PluginWithPlatformModules[]): KeyedPlatformModuleWithPlugin[];
|
|
16
|
-
export declare function getOrderedPluginModuleInitializationSteps(pluginModules: KeyedPlatformModuleWithPlugin[], initialSpecImplementations: Record<string, PluginSpecImplementation>): string[];
|
|
17
|
-
export declare function initializeOrderedPluginModules(orderedPluginModules: KeyedPlatformModuleWithPlugin[], initialSpecImplementations: Partial<Record<string, PluginSpecImplementation>>): Partial<Record<string, PluginSpecImplementation>>;
|
|
1
|
+
import type { PluginSpecInitializerResult } from '../spec/types.js';
|
|
2
|
+
import type { PluginModuleWithKey } from './types.js';
|
|
3
|
+
import { PluginSpecStore } from '../store/store.js';
|
|
18
4
|
/**
|
|
19
|
-
* Initialize
|
|
5
|
+
* Initialize ordered plugin modules.
|
|
6
|
+
* Each module's initialize function is called within a plugin context.
|
|
20
7
|
*/
|
|
21
|
-
export declare function
|
|
22
|
-
|
|
8
|
+
export declare function initializeOrderedModules(orderedModules: PluginModuleWithKey[]): Map<string, PluginSpecInitializerResult>;
|
|
9
|
+
/**
|
|
10
|
+
* Initialize the plugins based on their interdependencies.
|
|
11
|
+
* Returns a store that can be used to access spec implementations.
|
|
12
|
+
*/
|
|
13
|
+
export declare function initializePlugins(pluginModules: PluginModuleWithKey[]): PluginSpecStore;
|
|
23
14
|
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/imports/loader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/plugins/imports/loader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,cAAc,EAAE,mBAAmB,EAAE,GACpC,GAAG,CAAC,MAAM,EAAE,2BAA2B,CAAC,CA4B1C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,mBAAmB,EAAE,GACnC,eAAe,CAMjB"}
|