@ngx-formbar/core 0.11.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/LICENSE +21 -0
- package/README.md +42 -0
- package/fesm2022/ngx-formbar-core.mjs +2429 -0
- package/fesm2022/ngx-formbar-core.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/form/ngxfb-form.component.d.ts +28 -0
- package/lib/composables/computed-value.d.ts +8 -0
- package/lib/composables/disabled.state.d.ts +36 -0
- package/lib/composables/dynamic-label.d.ts +9 -0
- package/lib/composables/dynamic-title.d.ts +9 -0
- package/lib/composables/hidden.state.d.ts +68 -0
- package/lib/composables/readonly.state.d.ts +19 -0
- package/lib/composables/testId.d.ts +16 -0
- package/lib/composables/update-strategy.d.ts +20 -0
- package/lib/composables/validators.d.ts +22 -0
- package/lib/config/config.d.ts +7 -0
- package/lib/config/provide-formbar.d.ts +38 -0
- package/lib/directives/ngxfb-abstract-control.directive.d.ts +53 -0
- package/lib/directives/ngxfb-block.directive.d.ts +124 -0
- package/lib/directives/ngxfb-control.directive.d.ts +203 -0
- package/lib/directives/ngxfb-group.directive.d.ts +253 -0
- package/lib/helper/control-container-view-providers.d.ts +33 -0
- package/lib/index.d.ts +23 -0
- package/lib/services/component-registration.service.d.ts +8 -0
- package/lib/services/configuration.service.d.ts +8 -0
- package/lib/services/expression.service.d.ts +148 -0
- package/lib/services/form.service.d.ts +10 -0
- package/lib/services/validator-registration.service.d.ts +10 -0
- package/lib/tokens/component-registrations.d.ts +2 -0
- package/lib/tokens/component-resolver.d.ts +3 -0
- package/lib/tokens/default-update-strategy.d.ts +3 -0
- package/lib/tokens/global-config.d.ts +5 -0
- package/lib/tokens/validator-registrations.d.ts +8 -0
- package/lib/tokens/validator-resolver.d.ts +3 -0
- package/lib/types/component-resolver.type.d.ts +4 -0
- package/lib/types/content.type.d.ts +137 -0
- package/lib/types/expression.type.d.ts +2 -0
- package/lib/types/form.type.d.ts +4 -0
- package/lib/types/functions.type.d.ts +4 -0
- package/lib/types/global-configuration.type.d.ts +4 -0
- package/lib/types/provide.type.d.ts +42 -0
- package/lib/types/registration.type.d.ts +18 -0
- package/lib/types/validation.type.d.ts +59 -0
- package/lib/types/validator-resolver.type.d.ts +6 -0
- package/package.json +52 -0
- package/public-api.d.ts +1 -0
- package/schematics/block/files/__componentName@dasherize__.component.html.template +1 -0
- package/schematics/block/files/__componentName@dasherize__.component.ts.template +29 -0
- package/schematics/block/files/__interfaceName@dasherize__.type.ts.template +6 -0
- package/schematics/block/index.d.ts +3 -0
- package/schematics/block/index.js +11 -0
- package/schematics/block/index.js.map +1 -0
- package/schematics/block/schema.json +62 -0
- package/schematics/collection.json +31 -0
- package/schematics/control/files/__componentName@dasherize__.component.html.template +0 -0
- package/schematics/control/files/__componentName@dasherize__.component.ts.template +29 -0
- package/schematics/control/files/__interfaceName@dasherize__.type.ts.template +6 -0
- package/schematics/control/index.d.ts +3 -0
- package/schematics/control/index.js +11 -0
- package/schematics/control/index.js.map +1 -0
- package/schematics/control/schema.json +61 -0
- package/schematics/group/files/__componentName@dasherize__.component.html.template +5 -0
- package/schematics/group/files/__componentName@dasherize__.component.ts.template +29 -0
- package/schematics/group/files/__interfaceName@dasherize__.type.ts.template +5 -0
- package/schematics/group/index.d.ts +3 -0
- package/schematics/group/index.js +11 -0
- package/schematics/group/index.js.map +1 -0
- package/schematics/group/schema.json +62 -0
- package/schematics/ng-add/files/config-registrations/async-validator-registrations.ts.template +4 -0
- package/schematics/ng-add/files/config-registrations/component-registrations.ts.template +4 -0
- package/schematics/ng-add/files/config-registrations/index.ts.template +3 -0
- package/schematics/ng-add/files/config-registrations/validator-registrations.ts.template +4 -0
- package/schematics/ng-add/files/helper/block.host-directive.ts.template +6 -0
- package/schematics/ng-add/files/helper/control.host-directive.ts.template +6 -0
- package/schematics/ng-add/files/helper/group.host-directive.ts.template +6 -0
- package/schematics/ng-add/files/helper/index.ts.template +4 -0
- package/schematics/ng-add/files/helper/view-provider.ts.template +9 -0
- package/schematics/ng-add/files/provider-config/config/__providerConfigFileName__.ts.template +9 -0
- package/schematics/ng-add/files/provider-config/inline/__providerConfigFileName__.ts.template +8 -0
- package/schematics/ng-add/files/provider-config/token/__providerConfigFileName__.ts.template +4 -0
- package/schematics/ng-add/files/schematics-config/__schematicConfigFileName__.json.template +1 -0
- package/schematics/ng-add/files/token-registrations/async-validator-registrations.ts.template +8 -0
- package/schematics/ng-add/files/token-registrations/component-registrations.ts.template +8 -0
- package/schematics/ng-add/files/token-registrations/index.ts.template +3 -0
- package/schematics/ng-add/files/token-registrations/validator-registrations.ts.template +8 -0
- package/schematics/ng-add/helper.d.ts +11 -0
- package/schematics/ng-add/helper.js +198 -0
- package/schematics/ng-add/helper.js.map +1 -0
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +68 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/rules/create-config-registration-files.rule.d.ts +3 -0
- package/schematics/ng-add/rules/create-config-registration-files.rule.js +32 -0
- package/schematics/ng-add/rules/create-config-registration-files.rule.js.map +1 -0
- package/schematics/ng-add/rules/create-formbar-registration-config.rule.d.ts +3 -0
- package/schematics/ng-add/rules/create-formbar-registration-config.rule.js +30 -0
- package/schematics/ng-add/rules/create-formbar-registration-config.rule.js.map +1 -0
- package/schematics/ng-add/rules/create-helper-files.rule.d.ts +6 -0
- package/schematics/ng-add/rules/create-helper-files.rule.js +22 -0
- package/schematics/ng-add/rules/create-helper-files.rule.js.map +1 -0
- package/schematics/ng-add/rules/create-schematics-config.rule.d.ts +3 -0
- package/schematics/ng-add/rules/create-schematics-config.rule.js +42 -0
- package/schematics/ng-add/rules/create-schematics-config.rule.js.map +1 -0
- package/schematics/ng-add/rules/create-token-registration-files.rule.d.ts +3 -0
- package/schematics/ng-add/rules/create-token-registration-files.rule.js +32 -0
- package/schematics/ng-add/rules/create-token-registration-files.rule.js.map +1 -0
- package/schematics/ng-add/rules/include-templates.rule.d.ts +3 -0
- package/schematics/ng-add/rules/include-templates.rule.js +11 -0
- package/schematics/ng-add/rules/include-templates.rule.js.map +1 -0
- package/schematics/ng-add/rules/install-dependencies.rule.d.ts +2 -0
- package/schematics/ng-add/rules/install-dependencies.rule.js +12 -0
- package/schematics/ng-add/rules/install-dependencies.rule.js.map +1 -0
- package/schematics/ng-add/rules/update-app-config.rule.d.ts +3 -0
- package/schematics/ng-add/rules/update-app-config.rule.js +48 -0
- package/schematics/ng-add/rules/update-app-config.rule.js.map +1 -0
- package/schematics/ng-add/rules/update-schematics-config.rule.d.ts +6 -0
- package/schematics/ng-add/rules/update-schematics-config.rule.js +28 -0
- package/schematics/ng-add/rules/update-schematics-config.rule.js.map +1 -0
- package/schematics/ng-add/schema.d.ts +23 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +81 -0
- package/schematics/register/component-info.type.d.ts +11 -0
- package/schematics/register/component-info.type.js +3 -0
- package/schematics/register/component-info.type.js.map +1 -0
- package/schematics/register/discover-components.d.ts +19 -0
- package/schematics/register/discover-components.js +267 -0
- package/schematics/register/discover-components.js.map +1 -0
- package/schematics/register/index.d.ts +3 -0
- package/schematics/register/index.js +49 -0
- package/schematics/register/index.js.map +1 -0
- package/schematics/register/register-components.d.ts +3 -0
- package/schematics/register/register-components.js +38 -0
- package/schematics/register/register-components.js.map +1 -0
- package/schematics/register/schema.d.ts +14 -0
- package/schematics/register/schema.js +3 -0
- package/schematics/register/schema.js.map +1 -0
- package/schematics/register/schema.json +44 -0
- package/schematics/shared/ast/decorators.d.ts +9 -0
- package/schematics/shared/ast/decorators.js +182 -0
- package/schematics/shared/ast/decorators.js.map +1 -0
- package/schematics/shared/ast/imports.d.ts +3 -0
- package/schematics/shared/ast/imports.js +93 -0
- package/schematics/shared/ast/imports.js.map +1 -0
- package/schematics/shared/ast/parse.d.ts +3 -0
- package/schematics/shared/ast/parse.js +17 -0
- package/schematics/shared/ast/parse.js.map +1 -0
- package/schematics/shared/ast/registrations.d.ts +22 -0
- package/schematics/shared/ast/registrations.js +654 -0
- package/schematics/shared/ast/registrations.js.map +1 -0
- package/schematics/shared/ast/types.d.ts +3 -0
- package/schematics/shared/ast/types.js +58 -0
- package/schematics/shared/ast/types.js.map +1 -0
- package/schematics/shared/file.d.ts +4 -0
- package/schematics/shared/file.js +60 -0
- package/schematics/shared/file.js.map +1 -0
- package/schematics/shared/helper.d.ts +2 -0
- package/schematics/shared/helper.js +29 -0
- package/schematics/shared/helper.js.map +1 -0
- package/schematics/shared/rules/create-component.rule.d.ts +3 -0
- package/schematics/shared/rules/create-component.rule.js +15 -0
- package/schematics/shared/rules/create-component.rule.js.map +1 -0
- package/schematics/shared/rules/register-control.rule.d.ts +3 -0
- package/schematics/shared/rules/register-control.rule.js +30 -0
- package/schematics/shared/rules/register-control.rule.js.map +1 -0
- package/schematics/shared/rules/register-type-map.rule.d.ts +3 -0
- package/schematics/shared/rules/register-type-map.rule.js +46 -0
- package/schematics/shared/rules/register-type-map.rule.js.map +1 -0
- package/schematics/shared/rules/register-type-token.rule.d.ts +3 -0
- package/schematics/shared/rules/register-type-token.rule.js +49 -0
- package/schematics/shared/rules/register-type-token.rule.js.map +1 -0
- package/schematics/shared/rules/scaffold-and-register.rule.d.ts +3 -0
- package/schematics/shared/rules/scaffold-and-register.rule.js +134 -0
- package/schematics/shared/rules/scaffold-and-register.rule.js.map +1 -0
- package/schematics/shared/schema.d.ts +32 -0
- package/schematics/shared/schema.js +3 -0
- package/schematics/shared/schema.js.map +1 -0
- package/schematics/tests/generators.spec.d.ts +1 -0
- package/schematics/tests/generators.spec.js +450 -0
- package/schematics/tests/generators.spec.js.map +1 -0
- package/schematics/tests/helper.d.ts +20 -0
- package/schematics/tests/helper.js +275 -0
- package/schematics/tests/helper.js.map +1 -0
- package/schematics/tests/ng-add.spec.d.ts +1 -0
- package/schematics/tests/ng-add.spec.js +380 -0
- package/schematics/tests/ng-add.spec.js.map +1 -0
- package/schematics/tests/register.spec.d.ts +1 -0
- package/schematics/tests/register.spec.js +340 -0
- package/schematics/tests/register.spec.js.map +1 -0
- package/schematics/tests/workspace-setup.d.ts +21 -0
- package/schematics/tests/workspace-setup.js +255 -0
- package/schematics/tests/workspace-setup.js.map +1 -0
- package/shared/ast.d.ts +10 -0
- package/shared/ast.js +93 -0
- package/shared/ast.js.map +1 -0
- package/shared/constants.d.ts +16 -0
- package/shared/constants.js +20 -0
- package/shared/constants.js.map +1 -0
- package/shared/shared-config.type.d.ts +20 -0
- package/shared/shared-config.type.js +3 -0
- package/shared/shared-config.type.js.map +1 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFormbarRegistrationsConfig = createFormbarRegistrationsConfig;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
const find_module_1 = require("@schematics/angular/utility/find-module");
|
|
7
|
+
function createFormbarRegistrationsConfig(ruleContext) {
|
|
8
|
+
return (_, context) => {
|
|
9
|
+
const { includeAsyncValidators, includeSyncValidators, providerConfigPath, providerConfigFileName, useTokens, splitRegistrations, registrationsPath, provideInline, projectRoot, } = ruleContext;
|
|
10
|
+
if (provideInline || !providerConfigPath || !providerConfigFileName) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
context.logger.info('Creating provider file');
|
|
14
|
+
const template = useTokens
|
|
15
|
+
? 'token'
|
|
16
|
+
: splitRegistrations
|
|
17
|
+
? 'config'
|
|
18
|
+
: 'inline';
|
|
19
|
+
const targetPath = (0, core_1.normalize)(`/${projectRoot}/${providerConfigPath}`);
|
|
20
|
+
const registrations = `/${projectRoot}/${registrationsPath !== null && registrationsPath !== void 0 ? registrationsPath : ''}`;
|
|
21
|
+
const registrationsRelativePath = (0, find_module_1.buildRelativePath)(`${targetPath}/${providerConfigFileName}.ts`, registrations);
|
|
22
|
+
return (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)(`./files/provider-config/${template}`), [
|
|
23
|
+
(0, schematics_1.applyTemplates)(Object.assign({ includeSyncValidators,
|
|
24
|
+
includeAsyncValidators,
|
|
25
|
+
useTokens, useConfig: provideInline, splitRegistrations, registrationsPath: registrationsRelativePath, providerConfigFileName }, core_1.strings)),
|
|
26
|
+
(0, schematics_1.move)((0, core_1.normalize)(targetPath)),
|
|
27
|
+
]));
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=create-formbar-registration-config.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-formbar-registration-config.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/create-formbar-registration-config.rule.ts"],"names":[],"mappings":";;AAYA,4EAoDC;AA/DD,2DAOoC;AACpC,+CAA0D;AAC1D,yEAA4E;AAE5E,SAAgB,gCAAgC,CAC9C,WAAwB;IAExB,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACpB,MAAM,EACJ,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,WAAW,GACZ,GAAG,WAAW,CAAC;QAEhB,IAAI,aAAa,IAAI,CAAC,kBAAkB,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACpE,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAE9C,MAAM,QAAQ,GAAG,SAAS;YACxB,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,kBAAkB;gBAClB,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,QAAQ,CAAC;QAEf,MAAM,UAAU,GAAG,IAAA,gBAAS,EAAC,IAAI,WAAW,IAAI,kBAAkB,EAAE,CAAC,CAAC;QACtE,MAAM,aAAa,GAAG,IAAI,WAAW,IAAI,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,EAAE,EAAE,CAAC;QAEnE,MAAM,yBAAyB,GAAG,IAAA,+BAAiB,EACjD,GAAG,UAAU,IAAI,sBAAsB,KAAK,EAC5C,aAAa,CACd,CAAC;QAEF,OAAO,IAAA,sBAAS,EACd,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,2BAA2B,QAAQ,EAAE,CAAC,EAAE;YAChD,IAAA,2BAAc,kBACZ,qBAAqB;gBACrB,sBAAsB;gBACtB,SAAS,EACT,SAAS,EAAE,aAAa,EACxB,kBAAkB,EAClB,iBAAiB,EAAE,yBAAyB,EAC5C,sBAAsB,IACnB,cAAO,EACV;YACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,UAAU,CAAC,CAAC;SAC5B,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHelperFiles = createHelperFiles;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
/**
|
|
7
|
+
* Optionally create helper files at specified helperPath
|
|
8
|
+
*/
|
|
9
|
+
function createHelperFiles(ruleContext) {
|
|
10
|
+
return (_, context) => {
|
|
11
|
+
const { useHelper, helperPath, projectRoot } = ruleContext;
|
|
12
|
+
if (!useHelper || !helperPath) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
context.logger.info('Creating helper files');
|
|
16
|
+
return (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/helper'), [
|
|
17
|
+
(0, schematics_1.applyTemplates)({}),
|
|
18
|
+
(0, schematics_1.move)((0, core_1.normalize)(`${projectRoot}/${helperPath}`)),
|
|
19
|
+
]));
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=create-helper-files.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-helper-files.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/create-helper-files.rule.ts"],"names":[],"mappings":";;AAcA,8CAiBC;AA/BD,2DAOoC;AACpC,+CAAiD;AAGjD;;GAEG;AACH,SAAgB,iBAAiB,CAAC,WAAwB;IACxD,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACpB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QAE3D,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU,EAAE,CAAC;YAC9B,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAE7C,OAAO,IAAA,sBAAS,EACd,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,gBAAgB,CAAC,EAAE;YAC3B,IAAA,2BAAc,EAAC,EAAE,CAAC;YAClB,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,GAAG,WAAW,IAAI,UAAU,EAAE,CAAC,CAAC;SAChD,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSchematicsConfig = createSchematicsConfig;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
const constants_1 = require("../../../shared/constants");
|
|
7
|
+
function createSchematicsConfig(ruleContext) {
|
|
8
|
+
return (_, context) => {
|
|
9
|
+
const { useSchematicConfig, schematicsConfigPath, schematicConfigFileName, projectRoot, helperPath, useHelper, registrationsPath, registrationStyle, } = ruleContext;
|
|
10
|
+
if (!useSchematicConfig || !schematicsConfigPath) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
context.logger.info('Creating schematics config file');
|
|
14
|
+
const schematicConfig = {};
|
|
15
|
+
if (registrationStyle !== constants_1.DEFAULT_REGISTRATION_TYPE) {
|
|
16
|
+
schematicConfig.registrationType = registrationStyle;
|
|
17
|
+
}
|
|
18
|
+
if (registrationsPath !== constants_1.DEFAULT_REGISTRATIONS_PATH) {
|
|
19
|
+
schematicConfig.controlRegistrationsPath = registrationsPath;
|
|
20
|
+
}
|
|
21
|
+
if (useHelper) {
|
|
22
|
+
schematicConfig.viewProviderHelperPath = helperPath;
|
|
23
|
+
schematicConfig.control = {
|
|
24
|
+
hostDirectiveHelperPath: helperPath,
|
|
25
|
+
};
|
|
26
|
+
schematicConfig.group = {
|
|
27
|
+
hostDirectiveHelperPath: helperPath,
|
|
28
|
+
};
|
|
29
|
+
schematicConfig.block = {
|
|
30
|
+
hostDirectiveHelperPath: helperPath,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/schematics-config'), [
|
|
34
|
+
(0, schematics_1.applyTemplates)({
|
|
35
|
+
schematicConfigFileName,
|
|
36
|
+
schematicConfig: JSON.stringify(schematicConfig, null, 2),
|
|
37
|
+
}),
|
|
38
|
+
(0, schematics_1.move)((0, core_1.normalize)(`${projectRoot}/${schematicsConfigPath}`)),
|
|
39
|
+
]));
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=create-schematics-config.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-schematics-config.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/create-schematics-config.rule.ts"],"names":[],"mappings":";;AAgBA,wDAoDC;AApED,2DAOoC;AACpC,+CAAiD;AAEjD,yDAGmC;AAGnC,SAAgB,sBAAsB,CAAC,WAAwB;IAC7D,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACpB,MAAM,EACJ,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,WAAW,EACX,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,iBAAiB,GAClB,GAAG,WAAW,CAAC;QAEhB,IAAI,CAAC,kBAAkB,IAAI,CAAC,oBAAoB,EAAE,CAAC;YACjD,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAEvD,MAAM,eAAe,GAA+B,EAAE,CAAC;QAEvD,IAAI,iBAAiB,KAAK,qCAAyB,EAAE,CAAC;YACpD,eAAe,CAAC,gBAAgB,GAAG,iBAAiB,CAAC;QACvD,CAAC;QAED,IAAI,iBAAiB,KAAK,sCAA0B,EAAE,CAAC;YACrD,eAAe,CAAC,wBAAwB,GAAG,iBAAiB,CAAC;QAC/D,CAAC;QAED,IAAI,SAAS,EAAE,CAAC;YACd,eAAe,CAAC,sBAAsB,GAAG,UAAU,CAAC;YACpD,eAAe,CAAC,OAAO,GAAG;gBACxB,uBAAuB,EAAE,UAAU;aACpC,CAAC;YACF,eAAe,CAAC,KAAK,GAAG;gBACtB,uBAAuB,EAAE,UAAU;aACpC,CAAC;YACF,eAAe,CAAC,KAAK,GAAG;gBACtB,uBAAuB,EAAE,UAAU;aACpC,CAAC;QACJ,CAAC;QAED,OAAO,IAAA,sBAAS,EACd,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,2BAA2B,CAAC,EAAE;YACtC,IAAA,2BAAc,EAAC;gBACb,uBAAuB;gBACvB,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;aAC1D,CAAC;YACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,GAAG,WAAW,IAAI,oBAAoB,EAAE,CAAC,CAAC;SAC1D,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTokenRegistrationFiles = createTokenRegistrationFiles;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
const include_templates_rule_1 = require("./include-templates.rule");
|
|
7
|
+
function createTokenRegistrationFiles(ruleContext) {
|
|
8
|
+
return (_, context) => {
|
|
9
|
+
const { includeAsyncValidators, includeSyncValidators, useTokens, registrationsPath, splitRegistrations, projectRoot, } = ruleContext;
|
|
10
|
+
if (!useTokens || !splitRegistrations || !registrationsPath) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
context.logger.info('Creating token registration files');
|
|
14
|
+
const templatesToInclude = [
|
|
15
|
+
(0, core_1.normalize)('/index.ts.template'),
|
|
16
|
+
(0, core_1.normalize)('/component-registrations.ts.template'),
|
|
17
|
+
];
|
|
18
|
+
if (includeSyncValidators) {
|
|
19
|
+
templatesToInclude.push((0, core_1.normalize)('/validator-registrations.ts.template'));
|
|
20
|
+
}
|
|
21
|
+
if (includeAsyncValidators) {
|
|
22
|
+
templatesToInclude.push((0, core_1.normalize)('/async-validator-registrations.ts.template'));
|
|
23
|
+
}
|
|
24
|
+
return (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/token-registrations'), [
|
|
25
|
+
(0, include_templates_rule_1.includeTemplates)(templatesToInclude),
|
|
26
|
+
(0, schematics_1.applyTemplates)(Object.assign({ includeSyncValidators,
|
|
27
|
+
includeAsyncValidators }, core_1.strings)),
|
|
28
|
+
(0, schematics_1.move)((0, core_1.normalize)(`${projectRoot}/${registrationsPath}`)),
|
|
29
|
+
]));
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=create-token-registration-files.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-token-registration-files.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/create-token-registration-files.rule.ts"],"names":[],"mappings":";;AAYA,oEA8CC;AA1DD,2DAOoC;AAEpC,+CAA0D;AAC1D,qEAA4D;AAE5D,SAAgB,4BAA4B,CAAC,WAAwB;IACnE,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACpB,MAAM,EACJ,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,GACZ,GAAG,WAAW,CAAC;QAEhB,IAAI,CAAC,SAAS,IAAI,CAAC,kBAAkB,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5D,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAEzD,MAAM,kBAAkB,GAAG;YACzB,IAAA,gBAAS,EAAC,oBAAoB,CAAC;YAC/B,IAAA,gBAAS,EAAC,sCAAsC,CAAC;SAClD,CAAC;QAEF,IAAI,qBAAqB,EAAE,CAAC;YAC1B,kBAAkB,CAAC,IAAI,CACrB,IAAA,gBAAS,EAAC,sCAAsC,CAAC,CAClD,CAAC;QACJ,CAAC;QAED,IAAI,sBAAsB,EAAE,CAAC;YAC3B,kBAAkB,CAAC,IAAI,CACrB,IAAA,gBAAS,EAAC,4CAA4C,CAAC,CACxD,CAAC;QACJ,CAAC;QAED,OAAO,IAAA,sBAAS,EACd,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,6BAA6B,CAAC,EAAE;YACxC,IAAA,yCAAgB,EAAC,kBAAkB,CAAC;YACpC,IAAA,2BAAc,kBACZ,qBAAqB;gBACrB,sBAAsB,IACnB,cAAO,EACV;YACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,GAAG,WAAW,IAAI,iBAAiB,EAAE,CAAC,CAAC;SACvD,CAAC,CACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.includeTemplates = includeTemplates;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const core_1 = require("@angular-devkit/core");
|
|
6
|
+
function includeTemplates(templateNames) {
|
|
7
|
+
return (0, schematics_1.filter)((path) => {
|
|
8
|
+
return templateNames.includes((0, core_1.normalize)(path));
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=include-templates.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"include-templates.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/include-templates.rule.ts"],"names":[],"mappings":";;AAGA,4CAIC;AAPD,2DAA0D;AAC1D,+CAAuD;AAEvD,SAAgB,gBAAgB,CAAC,aAAqB;IACpD,OAAO,IAAA,mBAAM,EAAC,CAAC,IAAI,EAAE,EAAE;QACrB,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAA,gBAAS,EAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.installDependencies = installDependencies;
|
|
4
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
5
|
+
function installDependencies() {
|
|
6
|
+
return (tree, context) => {
|
|
7
|
+
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
8
|
+
context.logger.info('✅ ngx-formbar has been set up successfully!');
|
|
9
|
+
return tree;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=install-dependencies.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install-dependencies.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/install-dependencies.rule.ts"],"names":[],"mappings":";;AAGA,kDAMC;AARD,4DAA0E;AAE1E,SAAgB,mBAAmB;IACjC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateAppConfig = updateAppConfig;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const change_1 = require("@schematics/angular/utility/change");
|
|
6
|
+
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
7
|
+
const ast_1 = require("../../../shared/ast");
|
|
8
|
+
const typescript_1 = require("typescript");
|
|
9
|
+
const helper_1 = require("../helper");
|
|
10
|
+
function updateAppConfig(ruleContext) {
|
|
11
|
+
return (tree, context) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const { appConfigPath } = ruleContext;
|
|
14
|
+
context.logger.info('Updating app.config.ts');
|
|
15
|
+
const buffer = tree.read(appConfigPath);
|
|
16
|
+
if (!buffer) {
|
|
17
|
+
throw new schematics_1.SchematicsException(`Missing file or unreadable: ${appConfigPath}`);
|
|
18
|
+
}
|
|
19
|
+
const content = buffer.toString('utf-8');
|
|
20
|
+
const sourceFile = (0, typescript_1.createSourceFile)(appConfigPath, content, typescript_1.ScriptTarget.Latest, true);
|
|
21
|
+
const changes = [
|
|
22
|
+
(0, ast_utils_1.insertImport)(sourceFile, appConfigPath, 'provideFormbar', 'ngx-formbar', false),
|
|
23
|
+
];
|
|
24
|
+
const appConfig = (0, ast_1.findVariableWithObjectLiteral)(sourceFile, (variable) => (0, ast_1.isObjectLiteralWithProperty)(variable, 'providers'));
|
|
25
|
+
const providersProp = appConfig === null || appConfig === void 0 ? void 0 : appConfig.properties.find((prop) => (0, typescript_1.isPropertyAssignment)(prop) &&
|
|
26
|
+
(0, typescript_1.isIdentifier)(prop.name) &&
|
|
27
|
+
prop.name.text === 'providers');
|
|
28
|
+
const providersInit = providersProp === null || providersProp === void 0 ? void 0 : providersProp.initializer;
|
|
29
|
+
if (!providersInit) {
|
|
30
|
+
throw new schematics_1.SchematicsException(`'providers' array not found in appConfig`);
|
|
31
|
+
}
|
|
32
|
+
if (!(0, typescript_1.isArrayLiteralExpression)(providersInit)) {
|
|
33
|
+
throw new schematics_1.SchematicsException(`'providers' is not an array`);
|
|
34
|
+
}
|
|
35
|
+
context.logger.info(`providerConfigPath=${(_a = ruleContext.providerConfigPath) !== null && _a !== void 0 ? _a : ''}`);
|
|
36
|
+
const { updatedProvidersArray, extraChanges, didChange } = (0, helper_1.buildProvidersUpdate)(sourceFile, ruleContext, providersInit);
|
|
37
|
+
changes.push(...extraChanges);
|
|
38
|
+
if (didChange) {
|
|
39
|
+
changes.push(...(0, helper_1.replaceNodeWithPrinted)(sourceFile, appConfigPath, content, providersInit, updatedProvidersArray));
|
|
40
|
+
}
|
|
41
|
+
const recorder = tree.beginUpdate(appConfigPath);
|
|
42
|
+
(0, change_1.applyToUpdateRecorder)(recorder, changes);
|
|
43
|
+
tree.commitUpdate(recorder);
|
|
44
|
+
context.logger.info('app.config.ts updated');
|
|
45
|
+
return tree;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=update-app-config.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-app-config.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/update-app-config.rule.ts"],"names":[],"mappings":";;AAuBA,0CA8EC;AApGD,2DAAuE;AAEvE,+DAG4C;AAC5C,qEAAqE;AACrE,6CAG6B;AAE7B,2CAOoB;AACpB,sCAAyE;AAEzE,SAAgB,eAAe,CAAC,WAAwB;IACtD,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;;QACvB,MAAM,EAAE,aAAa,EAAE,GAAG,WAAW,CAAC;QAEtC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAE9C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACxC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,gCAAmB,CAC3B,+BAA+B,aAAa,EAAE,CAC/C,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,UAAU,GAAG,IAAA,6BAAgB,EACjC,aAAa,EACb,OAAO,EACP,yBAAY,CAAC,MAAM,EACnB,IAAI,CACL,CAAC;QAEF,MAAM,OAAO,GAAa;YACxB,IAAA,wBAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,KAAK,CACN;SACF,CAAC;QAEF,MAAM,SAAS,GAAG,IAAA,mCAA6B,EAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE,CACvE,IAAA,iCAA2B,EAAC,QAAQ,EAAE,WAAW,CAAC,CACnD,CAAC;QAEF,MAAM,aAAa,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,CAAC,IAAI,CAC9C,CAAC,IAAI,EAAE,EAAE,CACP,IAAA,iCAAoB,EAAC,IAAI,CAAC;YAC1B,IAAA,yBAAY,EAAC,IAAI,CAAC,IAAI,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CACC,CAAC;QAEpC,MAAM,aAAa,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,CAAC;QACjD,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,gCAAmB,CAAC,0CAA0C,CAAC,CAAC;QAC5E,CAAC;QACD,IAAI,CAAC,IAAA,qCAAwB,EAAC,aAAa,CAAC,EAAE,CAAC;YAC7C,MAAM,IAAI,gCAAmB,CAAC,6BAA6B,CAAC,CAAC;QAC/D,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,sBAAsB,MAAA,WAAW,CAAC,kBAAkB,mCAAI,EAAE,EAAE,CAC7D,CAAC;QAEF,MAAM,EAAE,qBAAqB,EAAE,YAAY,EAAE,SAAS,EAAE,GACtD,IAAA,6BAAoB,EAAC,UAAU,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;QAE/D,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;QAE9B,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,CAAC,IAAI,CACV,GAAG,IAAA,+BAAsB,EACvB,UAAU,EACV,aAAa,EACb,OAAO,EACP,aAAa,EACb,qBAAqB,CACtB,CACF,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QACjD,IAAA,8BAAqB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAE5B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateSchematicsConfig = updateSchematicsConfig;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const helper_1 = require("../helper");
|
|
6
|
+
/**
|
|
7
|
+
* Update angular.json for ngx-formbar schematics
|
|
8
|
+
*/
|
|
9
|
+
function updateSchematicsConfig(ruleContext) {
|
|
10
|
+
return (_, context) => {
|
|
11
|
+
const { useHelper, helperPath, projectName, useSchematicConfig } = ruleContext;
|
|
12
|
+
if (useSchematicConfig) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
context.logger.info('Updating schematics configuration');
|
|
16
|
+
const config = {};
|
|
17
|
+
if (useHelper && helperPath) {
|
|
18
|
+
config.hostDirectiveHelperPath = helperPath;
|
|
19
|
+
config.viewProviderHelperPath = helperPath;
|
|
20
|
+
}
|
|
21
|
+
return (0, schematics_1.chain)([
|
|
22
|
+
(0, helper_1.updateSchematicConfig)('control', config, projectName),
|
|
23
|
+
(0, helper_1.updateSchematicConfig)('group', config, projectName),
|
|
24
|
+
(0, helper_1.updateSchematicConfig)('block', config, projectName),
|
|
25
|
+
]);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=update-schematics-config.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-schematics-config.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/update-schematics-config.rule.ts"],"names":[],"mappings":";;AASA,wDAwBC;AAjCD,2DAAyD;AAIzD,sCAAkD;AAElD;;GAEG;AACH,SAAgB,sBAAsB,CAAC,WAAwB;IAC7D,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACpB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,GAC9D,WAAW,CAAC;QAEd,IAAI,kBAAkB,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAEzD,MAAM,MAAM,GAAoB,EAAE,CAAC;QAEnC,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;YAC5B,MAAM,CAAC,uBAAuB,GAAG,UAAU,CAAC;YAC5C,MAAM,CAAC,sBAAsB,GAAG,UAAU,CAAC;QAC7C,CAAC;QAED,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,8BAAqB,EAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;YACrD,IAAA,8BAAqB,EAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC;YACnD,IAAA,8BAAqB,EAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC;SACpD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RegistrationType } from '../../shared/shared-config.type';
|
|
2
|
+
export interface Schema {
|
|
3
|
+
project?: string;
|
|
4
|
+
registrationStyle?: RegistrationType;
|
|
5
|
+
provideInline?: boolean;
|
|
6
|
+
providerConfigPath?: string;
|
|
7
|
+
providerConfigFileName?: string;
|
|
8
|
+
includeSyncValidators?: boolean;
|
|
9
|
+
includeAsyncValidators?: boolean;
|
|
10
|
+
useHelper?: boolean;
|
|
11
|
+
helperPath?: string;
|
|
12
|
+
splitRegistrations?: boolean;
|
|
13
|
+
registrationsPath?: string;
|
|
14
|
+
useSchematicConfig?: boolean;
|
|
15
|
+
schematicsConfigPath?: string;
|
|
16
|
+
schematicConfigFileName?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RuleContext extends Schema {
|
|
19
|
+
projectRoot: string;
|
|
20
|
+
appConfigPath: string;
|
|
21
|
+
projectName: string;
|
|
22
|
+
useTokens: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../projects/core/automation/schematics/ng-add/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "NgxFormbarNgAdd",
|
|
4
|
+
"title": "ngx-formbar Installation Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"description": "Adds ngx-formbar to the application",
|
|
7
|
+
"properties": {
|
|
8
|
+
"project": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The name of the project to add ngx-formbar to.",
|
|
11
|
+
"$default": {
|
|
12
|
+
"$source": "projectName"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"registrationStyle": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "How components and validators will be registered. Possible values: token, config",
|
|
18
|
+
"default": "token"
|
|
19
|
+
},
|
|
20
|
+
"provideInline": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"description": "Put configuration of provideFormbar call directly in app.config.ts (defaults to false)",
|
|
23
|
+
"default": false
|
|
24
|
+
},
|
|
25
|
+
"providerConfigPath": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Where the provider configuration file should be placed, relative to the project root. Defaults to 'app'",
|
|
28
|
+
"default": "app"
|
|
29
|
+
},
|
|
30
|
+
"providerConfigFileName": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Name of the provider configuration file. Defaults to 'formbar.config.ts'",
|
|
33
|
+
"default": "formbar.config.ts"
|
|
34
|
+
},
|
|
35
|
+
"includeSyncValidators": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"description": "Whether to include the setup for validators",
|
|
38
|
+
"default": true
|
|
39
|
+
},
|
|
40
|
+
"includeAsyncValidators": {
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"description": "Whether to include the setup for async validators",
|
|
43
|
+
"default": true
|
|
44
|
+
},
|
|
45
|
+
"useHelper": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "Include helper files for view providers and host directives",
|
|
48
|
+
"default": true
|
|
49
|
+
},
|
|
50
|
+
"helperPath": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "Where helper files should be placed, relative to the project root. Defaults to 'app/shared/helper'",
|
|
53
|
+
"default": "app/shared/helper"
|
|
54
|
+
},
|
|
55
|
+
"splitRegistrations": {
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"description": "Whether to split the registrations into a separate file",
|
|
58
|
+
"default": true
|
|
59
|
+
},
|
|
60
|
+
"registrationsPath": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "Where registration files should be placed, relative to the project root. Defaults to 'app/registrations'",
|
|
63
|
+
"default": "app/registrations"
|
|
64
|
+
},
|
|
65
|
+
"useSchematicConfig": {
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"description": "Whether to include an extra file for schematics configuration. If set to false, all configuration for the schematics will be set up in angular.json",
|
|
68
|
+
"default": true
|
|
69
|
+
},
|
|
70
|
+
"schematicsConfigPath": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"description": "Where the schematics config should be placed, relative to the project root. Defaults to 'app'",
|
|
73
|
+
"default": "app"
|
|
74
|
+
},
|
|
75
|
+
"schematicConfigFileName": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "Name of the schematic config file. Defaults to 'formbar.config.json'",
|
|
78
|
+
"default": "formbar.config.json"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents information about a discovered Formbar component
|
|
3
|
+
*/
|
|
4
|
+
export interface FormbarComponentInfo {
|
|
5
|
+
/** The path to the component file */
|
|
6
|
+
componentFilePath: string;
|
|
7
|
+
/** The name of the component class */
|
|
8
|
+
componentClassName: string;
|
|
9
|
+
/** The key under which to register the component (equals the dasherized class name minus Component suffix */
|
|
10
|
+
key: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-info.type.js","sourceRoot":"","sources":["../../../../projects/core/automation/schematics/register/component-info.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import { RegisterContext } from './schema';
|
|
3
|
+
export declare function discoverComponents(tree: Tree, registerContext: RegisterContext, context: SchematicContext): RegisterContext;
|
|
4
|
+
/**
|
|
5
|
+
* Find files whose paths match any of the *glob* include patterns
|
|
6
|
+
* and none of the *glob* exclude patterns.
|
|
7
|
+
*
|
|
8
|
+
* Supported glob features:
|
|
9
|
+
* - ** : recursive across path segments
|
|
10
|
+
* - * : any sequence within a single path segment (excludes '/')
|
|
11
|
+
* - ? : any single char within a segment (excludes '/')
|
|
12
|
+
* - [] : character class / ranges (e.g., [a-zA-Z0-9_])
|
|
13
|
+
*
|
|
14
|
+
* Notes:
|
|
15
|
+
* - Matching is done against the full POSIX-like path from Tree (e.g., "/src/app/a.ts").
|
|
16
|
+
* - Patterns are compiled once to RegExp for speed.
|
|
17
|
+
* - No extra dependencies.
|
|
18
|
+
*/
|
|
19
|
+
export declare function findPotentialControlComponents(tree: Tree, include: readonly string[], exclude?: readonly string[]): string[];
|