@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,29 @@
|
|
|
1
|
+
import { Component, Signal, inject } from '@angular/core';
|
|
2
|
+
import { ReactiveFormsModule<% if (!hasViewProviderHelper) { %>, ControlContainer<% } %> } from '@angular/forms';
|
|
3
|
+
import { NgxfbAbstractControlDirective, NgxfbGroupDirective } from '@ngx-formbar/core';
|
|
4
|
+
import { <%= classify(interfaceName) %> } from './<%= dasherize(interfaceName) %>.type';<% if (hasViewProviderHelper) { %>
|
|
5
|
+
import { <%= viewProviderIdentifier %> } from '<%= viewProviderHelperPath %>';<% } %><% if (hasHostDirectiveHelper) { %>
|
|
6
|
+
import { <%= hostDirectiveIdentifier %> } from '<%= hostDirectiveHelperPath %>';<% } %>
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-<%= dasherize(componentName) %>',
|
|
10
|
+
imports: [ReactiveFormsModule, NgxfbAbstractControlDirective],
|
|
11
|
+
templateUrl: './<%= dasherize(componentName) %>.component.html',
|
|
12
|
+
viewProviders: <% if (hasViewProviderHelper) { %><%= viewProviderIdentifier %><% } else { %>[
|
|
13
|
+
{
|
|
14
|
+
provide: ControlContainer,
|
|
15
|
+
useFactory: () => inject(ControlContainer, { skipSelf: true }),
|
|
16
|
+
}
|
|
17
|
+
]<% } %>,
|
|
18
|
+
hostDirectives: <% if (hasHostDirectiveHelper) { %>[<%= hostDirectiveIdentifier %>]<% } else { %>[
|
|
19
|
+
{
|
|
20
|
+
directive: NgxfbGroupDirective,
|
|
21
|
+
inputs: ['content', 'name'],
|
|
22
|
+
}
|
|
23
|
+
]<% } %>,
|
|
24
|
+
})
|
|
25
|
+
export class <%= classify(componentClassName) %> {
|
|
26
|
+
private readonly group = inject(NgxfbGroupDirective<<%= classify(interfaceName) %>>);
|
|
27
|
+
readonly content: Signal<<%= classify(interfaceName) %>> = this.group.content;
|
|
28
|
+
readonly name: Signal<string> = this.group.name;
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.group = group;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const scaffold_and_register_rule_1 = require("../shared/rules/scaffold-and-register.rule");
|
|
6
|
+
function group(options) {
|
|
7
|
+
return () => {
|
|
8
|
+
return (0, schematics_1.chain)([(0, scaffold_and_register_rule_1.scaffoldAndRegister)(options, 'group')]);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/core/automation/schematics/group/index.ts"],"names":[],"mappings":";;AAIA,sBAIC;AARD,2DAAyD;AACzD,2FAAiF;AAGjF,SAAgB,KAAK,CAAC,OAAe;IACnC,OAAO,GAAG,EAAE;QACV,OAAO,IAAA,kBAAK,EAAC,CAAC,IAAA,gDAAmB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "NgxFormbarGroup",
|
|
4
|
+
"title": "Scaffold Group",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"name": {
|
|
8
|
+
"description": "The name of the component that this control will use. Defaults to the key if not provided.",
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"key": {
|
|
12
|
+
"description": "The name of the key that this control will be associated with.",
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"path": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "path",
|
|
18
|
+
"description": "The path to create the component.",
|
|
19
|
+
"visible": false,
|
|
20
|
+
"$default": {
|
|
21
|
+
"$source": "workingDirectory"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"project": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "The name of the project.",
|
|
27
|
+
"$default": {
|
|
28
|
+
"$source": "projectName"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"interfaceSuffix": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The suffix of the interface. Defaults to 'Control'",
|
|
34
|
+
"default": "Control"
|
|
35
|
+
},
|
|
36
|
+
"componentSuffix": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "The suffix of the component. Defaults to 'Control'",
|
|
39
|
+
"default": "Control"
|
|
40
|
+
},
|
|
41
|
+
"hostDirectiveHelperPath": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Path to the hostDirective helper"
|
|
44
|
+
},
|
|
45
|
+
"skipRegistration": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "Skip automatic registration"
|
|
48
|
+
},
|
|
49
|
+
"viewProviderHelperPath": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "Path to the viewProvider helper"
|
|
52
|
+
},
|
|
53
|
+
"schematicsConfig": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Path of the configuration that is to be used by this schematic"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": [
|
|
59
|
+
"key"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { componentRegistrations } from './component-registrations';<%if (includeSyncValidators){ %>
|
|
2
|
+
export { validatorRegistrations } from './validator-registrations';<% } %><%if (includeAsyncValidators){ %>
|
|
3
|
+
export { asyncValidatorRegistrations } from './async-validator-registrations';<% } %>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineFormbarConfig } from '@ngx-formbar/core';
|
|
2
|
+
import { componentRegistrations<%if (includeSyncValidators){ %>, validatorRegistrations<% } %><%if (includeAsyncValidators){ %>, asyncValidatorRegistrations<% } %> } from '<%= registrationsPath %>';
|
|
3
|
+
|
|
4
|
+
export const formbarConfig = defineFormbarConfig({
|
|
5
|
+
componentRegistrations<%if (includeSyncValidators){ %>,
|
|
6
|
+
validatorRegistrations<% } %><%if (includeAsyncValidators){ %>,
|
|
7
|
+
asyncValidatorRegistrations<% } %>
|
|
8
|
+
});
|
|
9
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineFormbarConfig } from '@ngx-formbar/core';
|
|
2
|
+
|
|
3
|
+
export const formbarConfig = defineFormbarConfig({
|
|
4
|
+
componentRegistrations: {},<%if (includeSyncValidators){ %>, validatorRegistrations: {}
|
|
5
|
+
<% } %><%if (includeAsyncValidators){ %>, asyncValidatorRegistrations: {}
|
|
6
|
+
<% } %>
|
|
7
|
+
});
|
|
8
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= schematicConfig %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AsyncValidatorFn } from '@angular/forms';
|
|
2
|
+
import { NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS } from '@ngx-formbar/core';
|
|
3
|
+
|
|
4
|
+
export const asyncValidatorRegistrationsProvider = {
|
|
5
|
+
provide: NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS,
|
|
6
|
+
useValue: new Map<string, AsyncValidatorFn[]>([
|
|
7
|
+
])
|
|
8
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { componentRegistrationsProvider } from './component-registrations';<%if (includeSyncValidators){ %>
|
|
2
|
+
export { validatorRegistrationsProvider } from './validator-registrations';<% } %><%if (includeAsyncValidators){ %>
|
|
3
|
+
export { asyncValidatorRegistrationsProvider } from './async-validator-registrations';<% } %>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ArrayLiteralExpression, Node, SourceFile } from 'typescript';
|
|
2
|
+
import { Change, ReplaceChange } from '@schematics/angular/utility/change';
|
|
3
|
+
import { JsonObject } from '@angular-devkit/core';
|
|
4
|
+
import { RuleContext } from './schema';
|
|
5
|
+
export declare function updateSchematicConfig(schematicName: string, options: JsonObject, projectName?: string): import("@angular-devkit/schematics").Rule;
|
|
6
|
+
export declare function buildProvidersUpdate(sourceFile: SourceFile, ruleContext: RuleContext, providersArray: ArrayLiteralExpression): {
|
|
7
|
+
updatedProvidersArray: ArrayLiteralExpression;
|
|
8
|
+
extraChanges: Change[];
|
|
9
|
+
didChange: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function replaceNodeWithPrinted(sf: SourceFile, filePath: string, fileText: string, original: Node, replacement: Node): ReplaceChange[];
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateSchematicConfig = updateSchematicConfig;
|
|
4
|
+
exports.buildProvidersUpdate = buildProvidersUpdate;
|
|
5
|
+
exports.replaceNodeWithPrinted = replaceNodeWithPrinted;
|
|
6
|
+
const typescript_1 = require("typescript");
|
|
7
|
+
const change_1 = require("@schematics/angular/utility/change");
|
|
8
|
+
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
|
9
|
+
const find_module_1 = require("@schematics/angular/utility/find-module");
|
|
10
|
+
const core_1 = require("@angular-devkit/core");
|
|
11
|
+
const constants_1 = require("../../shared/constants");
|
|
12
|
+
const utility_1 = require("@schematics/angular/utility");
|
|
13
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
|
+
const decorators_1 = require("../shared/ast/decorators");
|
|
15
|
+
function updateSchematicConfig(schematicName, options, projectName) {
|
|
16
|
+
return (0, utility_1.updateWorkspace)((workspace) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
var _c;
|
|
19
|
+
const targetProject = projectName !== null && projectName !== void 0 ? projectName : workspace.extensions['defaultProject'];
|
|
20
|
+
if (!targetProject) {
|
|
21
|
+
throw new schematics_1.SchematicsException(`No projectName provided and workspace.defaultProject is not set.`);
|
|
22
|
+
}
|
|
23
|
+
const projectDef = workspace.projects.get(targetProject);
|
|
24
|
+
if (!projectDef) {
|
|
25
|
+
throw new schematics_1.SchematicsException(`Project "${targetProject}" does not exist in the workspace.`);
|
|
26
|
+
}
|
|
27
|
+
(_a = (_c = projectDef.extensions)['schematics']) !== null && _a !== void 0 ? _a : (_c['schematics'] = {});
|
|
28
|
+
const schematicsExt = projectDef.extensions['schematics'];
|
|
29
|
+
const schematicKey = `${constants_1.PACKAGE_NAME}:${schematicName}`;
|
|
30
|
+
const existingConfig = ((_b = schematicsExt[schematicKey]) !== null && _b !== void 0 ? _b : {});
|
|
31
|
+
schematicsExt[schematicKey] = Object.assign(Object.assign({}, existingConfig), options);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function buildProvidersUpdate(sourceFile, ruleContext, providersArray) {
|
|
35
|
+
const { projectRoot, appConfigPath, registrationStyle, registrationsPath, providerConfigPath, providerConfigFileName, splitRegistrations, } = ruleContext;
|
|
36
|
+
const extraChanges = [];
|
|
37
|
+
const existingElements = [...providersArray.elements];
|
|
38
|
+
const newElements = [...existingElements];
|
|
39
|
+
const formattedProviderConfigPath = providerConfigPath && providerConfigFileName
|
|
40
|
+
? `${providerConfigPath}/${providerConfigFileName}`
|
|
41
|
+
: (providerConfigPath !== null && providerConfigPath !== void 0 ? providerConfigPath : '');
|
|
42
|
+
const registrationsImportPath = createRelativePath(appConfigPath, `${projectRoot}/${registrationsPath !== null && registrationsPath !== void 0 ? registrationsPath : ''}`);
|
|
43
|
+
const providerConfigImportPath = createRelativePath(appConfigPath, `${projectRoot}/${formattedProviderConfigPath}`);
|
|
44
|
+
const hasProvideCall = existingElements.some(isProvideFormbarCall);
|
|
45
|
+
if (!hasProvideCall) {
|
|
46
|
+
const callArgs = createArgsForConfig(sourceFile, ruleContext, registrationsImportPath, providerConfigImportPath, extraChanges);
|
|
47
|
+
newElements.push(typescript_1.factory.createCallExpression(typescript_1.factory.createIdentifier('provideFormbar'), undefined, callArgs));
|
|
48
|
+
}
|
|
49
|
+
if (registrationStyle !== 'token') {
|
|
50
|
+
return buildResult(providersArray, newElements, existingElements, extraChanges);
|
|
51
|
+
}
|
|
52
|
+
if (splitRegistrations) {
|
|
53
|
+
handleSplitRegistrations(sourceFile, ruleContext, registrationsImportPath, existingElements, newElements, extraChanges);
|
|
54
|
+
return buildResult(providersArray, newElements, existingElements, extraChanges);
|
|
55
|
+
}
|
|
56
|
+
handleStandaloneTokens(sourceFile, ruleContext, existingElements, newElements, extraChanges);
|
|
57
|
+
return buildResult(providersArray, newElements, existingElements, extraChanges);
|
|
58
|
+
}
|
|
59
|
+
function replaceNodeWithPrinted(sf, filePath, fileText, original, replacement) {
|
|
60
|
+
const printer = (0, typescript_1.createPrinter)({});
|
|
61
|
+
const printed = printer.printNode(typescript_1.EmitHint.Unspecified, replacement, sf);
|
|
62
|
+
const start = original.getStart(sf);
|
|
63
|
+
const end = original.getEnd();
|
|
64
|
+
return [
|
|
65
|
+
new change_1.ReplaceChange(filePath, start, fileText.slice(start, end), printed),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
function isProvideFormbarCall(n) {
|
|
69
|
+
return (0, typescript_1.isCallExpression)(n) && (0, decorators_1.isCallee)(n.expression, 'provideFormbar');
|
|
70
|
+
}
|
|
71
|
+
function hasIdentifier(name) {
|
|
72
|
+
return function (n) {
|
|
73
|
+
return (0, typescript_1.isIdentifier)(n) && n.text === name;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function compareElements(el, i, existingElements) {
|
|
77
|
+
return el !== existingElements[i];
|
|
78
|
+
}
|
|
79
|
+
function ensureAbsolutePath(path) {
|
|
80
|
+
const pathWithLeadingSlash = path.startsWith('/') ? path : `/${path}`;
|
|
81
|
+
return (0, core_1.normalize)(pathWithLeadingSlash);
|
|
82
|
+
}
|
|
83
|
+
function createRelativePath(from, to) {
|
|
84
|
+
const absoluteFrom = ensureAbsolutePath(from);
|
|
85
|
+
const absoluteTo = ensureAbsolutePath(to);
|
|
86
|
+
return (0, find_module_1.buildRelativePath)(absoluteFrom, absoluteTo);
|
|
87
|
+
}
|
|
88
|
+
function createArgsForConfig(sourceFile, ruleContext, registrationsImportPath, providerConfigImportPath, extraChanges) {
|
|
89
|
+
const { provideInline, splitRegistrations, appConfigPath, includeSyncValidators, includeAsyncValidators, } = ruleContext;
|
|
90
|
+
if (provideInline && !splitRegistrations) {
|
|
91
|
+
const additionalProperties = [];
|
|
92
|
+
if (includeSyncValidators) {
|
|
93
|
+
additionalProperties.push(typescript_1.factory.createPropertyAssignment('validatorRegistrations', typescript_1.factory.createObjectLiteralExpression([], false)));
|
|
94
|
+
}
|
|
95
|
+
if (includeAsyncValidators) {
|
|
96
|
+
additionalProperties.push(typescript_1.factory.createPropertyAssignment('asyncValidatorRegistrations', typescript_1.factory.createObjectLiteralExpression([], false)));
|
|
97
|
+
}
|
|
98
|
+
return [
|
|
99
|
+
typescript_1.factory.createObjectLiteralExpression([
|
|
100
|
+
typescript_1.factory.createPropertyAssignment('componentRegistrations', typescript_1.factory.createObjectLiteralExpression([], false)),
|
|
101
|
+
...additionalProperties,
|
|
102
|
+
], true),
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
if (provideInline && splitRegistrations) {
|
|
106
|
+
if (registrationsImportPath) {
|
|
107
|
+
extraChanges.push((0, ast_utils_1.insertImport)(sourceFile, appConfigPath, 'componentRegistrations', registrationsImportPath, false));
|
|
108
|
+
}
|
|
109
|
+
const additionalProperties = [];
|
|
110
|
+
if (includeSyncValidators) {
|
|
111
|
+
extraChanges.push((0, ast_utils_1.insertImport)(sourceFile, appConfigPath, 'validatorRegistrations', registrationsImportPath, false));
|
|
112
|
+
additionalProperties.push(typescript_1.factory.createShorthandPropertyAssignment('validatorRegistrations'));
|
|
113
|
+
}
|
|
114
|
+
if (includeAsyncValidators) {
|
|
115
|
+
extraChanges.push((0, ast_utils_1.insertImport)(sourceFile, appConfigPath, 'asyncValidatorRegistrations', registrationsImportPath, false));
|
|
116
|
+
additionalProperties.push(typescript_1.factory.createShorthandPropertyAssignment('asyncValidatorRegistrations'));
|
|
117
|
+
}
|
|
118
|
+
return [
|
|
119
|
+
typescript_1.factory.createObjectLiteralExpression([
|
|
120
|
+
typescript_1.factory.createShorthandPropertyAssignment('componentRegistrations'),
|
|
121
|
+
...additionalProperties,
|
|
122
|
+
], true),
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
if (providerConfigImportPath) {
|
|
126
|
+
extraChanges.push((0, ast_utils_1.insertImport)(sourceFile, appConfigPath, 'formbarConfig', providerConfigImportPath, false));
|
|
127
|
+
}
|
|
128
|
+
return [typescript_1.factory.createIdentifier('formbarConfig')];
|
|
129
|
+
}
|
|
130
|
+
function checkTokenProviderExists(existingElements, tokenName) {
|
|
131
|
+
return existingElements.some((el) => {
|
|
132
|
+
if (!(0, typescript_1.isCallExpression)(el)) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
const objectArg = el.arguments[0];
|
|
136
|
+
if (el.arguments.length === 0 || !(0, typescript_1.isObjectLiteralExpression)(objectArg)) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
return objectArg.properties.some((prop) => (0, typescript_1.isPropertyAssignment)(prop) &&
|
|
140
|
+
(0, typescript_1.isIdentifier)(prop.name) &&
|
|
141
|
+
prop.name.text === 'provide' &&
|
|
142
|
+
(0, typescript_1.isIdentifier)(prop.initializer) &&
|
|
143
|
+
prop.initializer.text === tokenName);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function createMapProviderExpression(tokenName) {
|
|
147
|
+
return typescript_1.factory.createObjectLiteralExpression([
|
|
148
|
+
typescript_1.factory.createPropertyAssignment(typescript_1.factory.createIdentifier('provide'), typescript_1.factory.createIdentifier(tokenName)),
|
|
149
|
+
typescript_1.factory.createPropertyAssignment(typescript_1.factory.createIdentifier('useValue'), typescript_1.factory.createNewExpression(typescript_1.factory.createIdentifier('Map'), undefined, [typescript_1.factory.createArrayLiteralExpression([], false)])),
|
|
150
|
+
], true);
|
|
151
|
+
}
|
|
152
|
+
function addStandaloneRegistrationProvider(tokenName, sourceFile, ruleContext, existingElements, newElements, extraChanges) {
|
|
153
|
+
const { appConfigPath } = ruleContext;
|
|
154
|
+
extraChanges.push((0, ast_utils_1.insertImport)(sourceFile, appConfigPath, tokenName, constants_1.PACKAGE_NAME, false));
|
|
155
|
+
if (!checkTokenProviderExists(existingElements, tokenName)) {
|
|
156
|
+
const provider = createMapProviderExpression(tokenName);
|
|
157
|
+
newElements.push(provider);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function addSplitRegistrationProvider(providerName, sourceFile, ruleContext, registrationsImportPath, existingElements, newElements, extraChanges) {
|
|
161
|
+
const { appConfigPath } = ruleContext;
|
|
162
|
+
const hasProvider = existingElements.some(hasIdentifier(providerName));
|
|
163
|
+
if (!hasProvider) {
|
|
164
|
+
extraChanges.push((0, ast_utils_1.insertImport)(sourceFile, appConfigPath, providerName, registrationsImportPath, false));
|
|
165
|
+
newElements.push(typescript_1.factory.createIdentifier(providerName));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function handleSplitRegistrations(sourceFile, ruleContext, registrationsImportPath, existingElements, newElements, extraChanges) {
|
|
169
|
+
const { registrationsPath, includeSyncValidators, includeAsyncValidators } = ruleContext;
|
|
170
|
+
if (registrationsPath) {
|
|
171
|
+
addSplitRegistrationProvider('componentRegistrationsProvider', sourceFile, ruleContext, registrationsImportPath, existingElements, newElements, extraChanges);
|
|
172
|
+
}
|
|
173
|
+
if (includeSyncValidators) {
|
|
174
|
+
addSplitRegistrationProvider('validatorRegistrationsProvider', sourceFile, ruleContext, registrationsImportPath, existingElements, newElements, extraChanges);
|
|
175
|
+
}
|
|
176
|
+
if (includeAsyncValidators) {
|
|
177
|
+
addSplitRegistrationProvider('asyncValidatorRegistrationsProvider', sourceFile, ruleContext, registrationsImportPath, existingElements, newElements, extraChanges);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function handleStandaloneTokens(sourceFile, ruleContext, existingElements, newElements, extraChanges) {
|
|
181
|
+
const { includeSyncValidators, includeAsyncValidators } = ruleContext;
|
|
182
|
+
addStandaloneRegistrationProvider(constants_1.NGX_FW_COMPONENT_REGISTRATIONS, sourceFile, ruleContext, existingElements, newElements, extraChanges);
|
|
183
|
+
if (includeSyncValidators) {
|
|
184
|
+
addStandaloneRegistrationProvider(constants_1.NGX_FW_VALIDATOR_REGISTRATIONS, sourceFile, ruleContext, existingElements, newElements, extraChanges);
|
|
185
|
+
}
|
|
186
|
+
if (includeAsyncValidators) {
|
|
187
|
+
addStandaloneRegistrationProvider(constants_1.NGX_FW_ASYNC_VALIDATOR_REGISTRATIONS, sourceFile, ruleContext, existingElements, newElements, extraChanges);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function buildResult(providersArray, newElements, existingElements, extraChanges) {
|
|
191
|
+
const didChange = newElements.length !== existingElements.length ||
|
|
192
|
+
newElements.some((el, i) => compareElements(el, i, existingElements));
|
|
193
|
+
const updatedProvidersArray = didChange
|
|
194
|
+
? typescript_1.factory.updateArrayLiteralExpression(providersArray, newElements)
|
|
195
|
+
: providersArray;
|
|
196
|
+
return { updatedProvidersArray, extraChanges, didChange };
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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AM,SAAS,GACb,WAAW,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM;QAC9C,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAExE,MAAM,qBAAqB,GAAG,SAAS;QACrC,CAAC,CAAC,oBAAO,CAAC,4BAA4B,CAAC,cAAc,EAAE,WAAW,CAAC;QACnE,CAAC,CAAC,cAAc,CAAC;IAEnB,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ngAdd = ngAdd;
|
|
13
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
|
+
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
15
|
+
const create_helper_files_rule_1 = require("./rules/create-helper-files.rule");
|
|
16
|
+
const update_app_config_rule_1 = require("./rules/update-app-config.rule");
|
|
17
|
+
const update_schematics_config_rule_1 = require("./rules/update-schematics-config.rule");
|
|
18
|
+
const install_dependencies_rule_1 = require("./rules/install-dependencies.rule");
|
|
19
|
+
const constants_1 = require("../../shared/constants");
|
|
20
|
+
const create_token_registration_files_rule_1 = require("./rules/create-token-registration-files.rule");
|
|
21
|
+
const create_config_registration_files_rule_1 = require("./rules/create-config-registration-files.rule");
|
|
22
|
+
const create_schematics_config_rule_1 = require("./rules/create-schematics-config.rule");
|
|
23
|
+
const create_formbar_registration_config_rule_1 = require("./rules/create-formbar-registration-config.rule");
|
|
24
|
+
// noinspection JSUnusedGlobalSymbols
|
|
25
|
+
function ngAdd(options) {
|
|
26
|
+
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
28
|
+
const workspace = yield (0, workspace_1.getWorkspace)(tree);
|
|
29
|
+
const projectName = (_a = options.project) !== null && _a !== void 0 ? _a : workspace.extensions['defaultProject'];
|
|
30
|
+
if (!projectName) {
|
|
31
|
+
throw new schematics_1.SchematicsException('No project specified and no default project found.');
|
|
32
|
+
}
|
|
33
|
+
const project = workspace.projects.get(projectName);
|
|
34
|
+
if (!project) {
|
|
35
|
+
throw new schematics_1.SchematicsException(`Project "${projectName}" not found in workspace.`);
|
|
36
|
+
}
|
|
37
|
+
const projectRoot = (_b = project.sourceRoot) !== null && _b !== void 0 ? _b : project.root;
|
|
38
|
+
context.logger.info(`📦 Setting up ngx-formbar in project "${projectName}"...`);
|
|
39
|
+
(_c = options.registrationStyle) !== null && _c !== void 0 ? _c : (options.registrationStyle = constants_1.DEFAULT_REGISTRATION_TYPE);
|
|
40
|
+
(_d = options.registrationsPath) !== null && _d !== void 0 ? _d : (options.registrationsPath = constants_1.DEFAULT_REGISTRATIONS_PATH);
|
|
41
|
+
(_e = options.providerConfigPath) !== null && _e !== void 0 ? _e : (options.providerConfigPath = constants_1.DEFAULT_PROVIDER_CONFIG_PATH);
|
|
42
|
+
(_f = options.providerConfigFileName) !== null && _f !== void 0 ? _f : (options.providerConfigFileName = constants_1.DEFAULT_PROVIDER_CONFIG_FILE_NAME);
|
|
43
|
+
if (options.providerConfigFileName.endsWith('.ts')) {
|
|
44
|
+
options.providerConfigFileName =
|
|
45
|
+
options.providerConfigFileName.split('.ts')[0];
|
|
46
|
+
}
|
|
47
|
+
(_g = options.helperPath) !== null && _g !== void 0 ? _g : (options.helperPath = constants_1.DEFAULT_HELPER_PATH);
|
|
48
|
+
(_h = options.schematicsConfigPath) !== null && _h !== void 0 ? _h : (options.schematicsConfigPath = constants_1.DEFAULT_SCHEMATICS_CONFIG_PATH);
|
|
49
|
+
(_j = options.schematicConfigFileName) !== null && _j !== void 0 ? _j : (options.schematicConfigFileName = constants_1.DEFAULT_SCHEMATIC_CONFIG_FILE_NAME);
|
|
50
|
+
if (options.schematicConfigFileName.endsWith('json')) {
|
|
51
|
+
options.schematicConfigFileName =
|
|
52
|
+
options.schematicConfigFileName.split('.json')[0];
|
|
53
|
+
}
|
|
54
|
+
const ruleContext = Object.assign(Object.assign({}, options), { appConfigPath: `${projectRoot}/app/app.config.ts`, projectRoot,
|
|
55
|
+
projectName, useTokens: options.registrationStyle === 'token' });
|
|
56
|
+
return (0, schematics_1.chain)([
|
|
57
|
+
(0, create_formbar_registration_config_rule_1.createFormbarRegistrationsConfig)(ruleContext),
|
|
58
|
+
(0, create_token_registration_files_rule_1.createTokenRegistrationFiles)(ruleContext),
|
|
59
|
+
(0, create_config_registration_files_rule_1.createConfigRegistrationFiles)(ruleContext),
|
|
60
|
+
(0, create_helper_files_rule_1.createHelperFiles)(ruleContext),
|
|
61
|
+
(0, create_schematics_config_rule_1.createSchematicsConfig)(ruleContext),
|
|
62
|
+
(0, update_schematics_config_rule_1.updateSchematicsConfig)(ruleContext),
|
|
63
|
+
(0, update_app_config_rule_1.updateAppConfig)(ruleContext),
|
|
64
|
+
(0, install_dependencies_rule_1.installDependencies)(),
|
|
65
|
+
]);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createConfigRegistrationFiles = createConfigRegistrationFiles;
|
|
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 createConfigRegistrationFiles(ruleContext) {
|
|
8
|
+
return (_, context) => {
|
|
9
|
+
const { includeAsyncValidators, includeSyncValidators, useTokens, splitRegistrations, registrationsPath, projectRoot, } = ruleContext;
|
|
10
|
+
if (useTokens || !splitRegistrations || !registrationsPath) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
context.logger.info('Creating registration configuration 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/config-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-config-registration-files.rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-config-registration-files.rule.js","sourceRoot":"","sources":["../../../../../projects/core/automation/schematics/ng-add/rules/create-config-registration-files.rule.ts"],"names":[],"mappings":";;AAYA,sEA8CC;AA1DD,2DAOoC;AAEpC,+CAA0D;AAC1D,qEAA4D;AAE5D,SAAgB,6BAA6B,CAAC,WAAwB;IACpE,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QACpB,MAAM,EACJ,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,GACZ,GAAG,WAAW,CAAC;QAEhB,IAAI,SAAS,IAAI,CAAC,kBAAkB,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC3D,OAAO;QACT,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QAEjE,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,8BAA8B,CAAC,EAAE;YACzC,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"}
|