@lucca-front/ng 21.1.0-rc.0 → 21.1.0-rc.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/fesm2022/lucca-front-ng-a11y.mjs +6 -6
- package/fesm2022/lucca-front-ng-a11y.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-api.mjs +16 -48
- package/fesm2022/lucca-front-ng-api.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-app-layout.mjs +2 -2
- package/fesm2022/lucca-front-ng-app-layout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-breadcrumbs.mjs +5 -5
- package/fesm2022/lucca-front-ng-breadcrumbs.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-bubble-icon.mjs +51 -0
- package/fesm2022/lucca-front-ng-bubble-icon.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-bubble-illustration.mjs +135 -0
- package/fesm2022/lucca-front-ng-bubble-illustration.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-button.mjs +21 -0
- package/fesm2022/lucca-front-ng-button.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-callout.mjs +41 -15
- package/fesm2022/lucca-front-ng-callout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-chip.mjs +37 -7
- package/fesm2022/lucca-front-ng-chip.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-clear.mjs +21 -6
- package/fesm2022/lucca-front-ng-clear.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-color.mjs +28 -0
- package/fesm2022/lucca-front-ng-color.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-comment.mjs +20 -18
- package/fesm2022/lucca-front-ng-comment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-container.mjs +7 -9
- package/fesm2022/lucca-front-ng-container.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs +0 -2
- package/fesm2022/lucca-front-ng-core-select-job-qualification.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-user.mjs +14 -14
- package/fesm2022/lucca-front-ng-core-select-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select.mjs +68 -49
- package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core.mjs +13 -1
- package/fesm2022/lucca-front-ng-core.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-data-table.mjs +6 -6
- package/fesm2022/lucca-front-ng-data-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date.mjs +66 -99
- package/fesm2022/lucca-front-ng-date.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date2.mjs +48 -40
- package/fesm2022/lucca-front-ng-date2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-department.mjs +8 -24
- package/fesm2022/lucca-front-ng-department.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-dialog.mjs +33 -10
- package/fesm2022/lucca-front-ng-dialog.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-divider.mjs +10 -1
- package/fesm2022/lucca-front-ng-divider.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-empty-state.mjs +66 -8
- package/fesm2022/lucca-front-ng-empty-state.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-establishment.mjs +11 -75
- package/fesm2022/lucca-front-ng-establishment.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-fancy-box.mjs +12 -0
- package/fesm2022/lucca-front-ng-fancy-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-file-upload.mjs +40 -34
- package/fesm2022/lucca-front-ng-file-upload.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-filter-pills.mjs +14 -13
- package/fesm2022/lucca-front-ng-filter-pills.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-footer.mjs +3 -0
- package/fesm2022/lucca-front-ng-footer.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-field.mjs +25 -10
- package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-header.mjs +3 -0
- package/fesm2022/lucca-front-ng-form-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form.mjs +19 -5
- package/fesm2022/lucca-front-ng-form.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-formly.mjs +4 -4
- package/fesm2022/lucca-front-ng-formly.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs +2 -2
- package/fesm2022/lucca-front-ng-forms-phone-number-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +91 -74
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms.mjs +110 -41
- package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-gauge.mjs +28 -5
- package/fesm2022/lucca-front-ng-gauge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-grid.mjs +3 -3
- package/fesm2022/lucca-front-ng-grid.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-highlight-data.mjs +31 -26
- package/fesm2022/lucca-front-ng-highlight-data.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs +5 -2
- package/fesm2022/lucca-front-ng-horizontal-navigation.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-icon.mjs +15 -0
- package/fesm2022/lucca-front-ng-icon.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-index-table.mjs +1 -1
- package/fesm2022/lucca-front-ng-index-table.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-inline-message.mjs +12 -0
- package/fesm2022/lucca-front-ng-inline-message.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-input.mjs +7 -7
- package/fesm2022/lucca-front-ng-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-link.mjs +21 -6
- package/fesm2022/lucca-front-ng-link.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listbox.mjs +17 -5
- package/fesm2022/lucca-front-ng-listbox.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-listing.mjs +36 -7
- package/fesm2022/lucca-front-ng-listing.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-loading.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-main-layout.mjs +8 -2
- package/fesm2022/lucca-front-ng-main-layout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-mobile-push.mjs +22 -14
- package/fesm2022/lucca-front-ng-mobile-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-modal.mjs +1 -1
- package/fesm2022/lucca-front-ng-modal.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-multi-select.mjs +31 -28
- package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-new-badge.mjs +3 -0
- package/fesm2022/lucca-front-ng-new-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-numeric-badge.mjs +10 -1
- package/fesm2022/lucca-front-ng-numeric-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-option.mjs +227 -337
- package/fesm2022/lucca-front-ng-option.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-page-header.mjs +9 -0
- package/fesm2022/lucca-front-ng-page-header.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-pagination.mjs +29 -5
- package/fesm2022/lucca-front-ng-pagination.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-plg-push.mjs +11 -5
- package/fesm2022/lucca-front-ng-plg-push.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover.mjs +1 -33
- package/fesm2022/lucca-front-ng-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover2.mjs +30 -20
- package/fesm2022/lucca-front-ng-popover2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-progress-bar.mjs +12 -5
- package/fesm2022/lucca-front-ng-progress-bar.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-read-more.mjs +38 -21
- package/fesm2022/lucca-front-ng-read-more.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-resource-card.mjs +8 -8
- package/fesm2022/lucca-front-ng-resource-card.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-scroll-box.mjs +5 -2
- package/fesm2022/lucca-front-ng-scroll-box.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs +9 -3
- package/fesm2022/lucca-front-ng-segmented-control-tabs.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-segmented-control.mjs +16 -1
- package/fesm2022/lucca-front-ng-segmented-control.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-simple-select.mjs +20 -14
- package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-skeleton.mjs +65 -14
- package/fesm2022/lucca-front-ng-skeleton.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-sortable-list.mjs +25 -1
- package/fesm2022/lucca-front-ng-sortable-list.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-status-badge.mjs +12 -0
- package/fesm2022/lucca-front-ng-status-badge.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tag.mjs +6 -0
- package/fesm2022/lucca-front-ng-tag.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-text-flow.mjs +20 -0
- package/fesm2022/lucca-front-ng-text-flow.mjs.map +1 -0
- package/fesm2022/lucca-front-ng-time.mjs +63 -24
- package/fesm2022/lucca-front-ng-time.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-toast.mjs +5 -5
- package/fesm2022/lucca-front-ng-toast.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tooltip.mjs +13 -27
- package/fesm2022/lucca-front-ng-tooltip.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-tree-select.mjs +1 -1
- package/fesm2022/lucca-front-ng-tree-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user-popover.mjs +6 -6
- package/fesm2022/lucca-front-ng-user-popover.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-user.mjs +20 -36
- package/fesm2022/lucca-front-ng-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-vertical-navigation.mjs +30 -0
- package/fesm2022/lucca-front-ng-vertical-navigation.mjs.map +1 -1
- package/package.json +19 -3
- package/schematics/action-icon/index.js +4 -5
- package/schematics/action-icon/migration.js +3 -4
- package/schematics/action-icon/migration.spec.js +8 -8
- package/schematics/alignment-utilities/index.js +3 -4
- package/schematics/alignment-utilities/migration.spec.js +8 -8
- package/schematics/cdn-urls/index.js +3 -4
- package/schematics/cdn-urls/migration.js +7 -9
- package/schematics/cdn-urls/migration.spec.js +8 -8
- package/schematics/class-prefix/index.js +3 -4
- package/schematics/class-prefix/migration.spec.js +8 -8
- package/schematics/collection.json +10 -0
- package/schematics/color-text/index.js +3 -4
- package/schematics/color-text/migration.spec.js +8 -8
- package/schematics/component-path/index.js +3 -4
- package/schematics/component-path/migration.spec.js +8 -8
- package/schematics/empty-state-title/index.js +5 -7
- package/schematics/empty-state-title/migration.spec.js +5 -5
- package/schematics/lib/index.js +29 -0
- package/schematics/lib/local-deps/package-lock.json +2 -0
- package/schematics/lib/local-deps/package.json +1 -2
- package/schematics/lib/schematic.utils.js +5 -0
- package/schematics/lu-button/index.js +3 -4
- package/schematics/lu-button/migration.js +5 -11
- package/schematics/lu-button/migration.spec.js +5 -5
- package/schematics/lu-container/index.js +23 -0
- package/schematics/lu-container/migration.js +116 -0
- package/schematics/lu-container/migration.spec.js +23 -0
- package/schematics/lu-container/schema.json +23 -0
- package/schematics/lu-icon/index.js +3 -4
- package/schematics/lu-icon/migration.js +8 -14
- package/schematics/lu-icon/migration.spec.js +5 -5
- package/schematics/lu-loading/index.js +23 -0
- package/schematics/lu-loading/migration.js +136 -0
- package/schematics/lu-loading/migration.spec.js +23 -0
- package/schematics/lu-loading/schema.json +28 -0
- package/schematics/lu-select/index.js +3 -4
- package/schematics/lu-select/migration.js +18 -21
- package/schematics/lu-select/migration.spec.js +5 -5
- package/schematics/lu-select/util.js +17 -19
- package/schematics/lu-text-input/index.js +3 -4
- package/schematics/lu-text-input/migration.js +22 -28
- package/schematics/lu-text-input/migration.spec.js +5 -5
- package/schematics/new-icons/index.js +5 -6
- package/schematics/new-icons/migration.js +11 -16
- package/schematics/new-icons/migration.spec.js +8 -8
- package/schematics/palettes/index.js +3 -4
- package/schematics/palettes/migration.spec.js +8 -8
- package/schematics/tokens-radius/index.js +3 -4
- package/schematics/tokens-radius/migration.spec.js +8 -8
- package/schematics/tokens-spacing/index.js +3 -4
- package/schematics/tokens-spacing/migration.spec.js +8 -8
- package/schematics/tokens-typo/index.js +3 -4
- package/schematics/tokens-typo/migration.spec.js +8 -8
- package/src/components/cdk/_overlay.scss +5 -0
- package/src/definitions/option/_option-item.scss +1 -0
- package/types/lucca-front-ng-a11y.d.ts +3 -3
- package/types/lucca-front-ng-api.d.ts +1 -19
- package/types/lucca-front-ng-breadcrumbs.d.ts +9 -9
- package/types/lucca-front-ng-bubble-icon.d.ts +20 -0
- package/types/lucca-front-ng-bubble-illustration.d.ts +24 -0
- package/types/lucca-front-ng-button.d.ts +21 -0
- package/types/lucca-front-ng-callout.d.ts +33 -3
- package/types/lucca-front-ng-chip.d.ts +33 -3
- package/types/lucca-front-ng-clear.d.ts +21 -6
- package/types/lucca-front-ng-color.d.ts +12 -0
- package/types/lucca-front-ng-comment.d.ts +19 -11
- package/types/lucca-front-ng-container.d.ts +4 -4
- package/types/lucca-front-ng-core-select.d.ts +21 -16
- package/types/lucca-front-ng-core.d.ts +23 -2
- package/types/lucca-front-ng-data-table.d.ts +2 -2
- package/types/lucca-front-ng-date.d.ts +6 -24
- package/types/lucca-front-ng-date2.d.ts +6 -5
- package/types/lucca-front-ng-department.d.ts +3 -12
- package/types/lucca-front-ng-dialog.d.ts +12 -5
- package/types/lucca-front-ng-divider.d.ts +10 -0
- package/types/lucca-front-ng-empty-state.d.ts +21 -3
- package/types/lucca-front-ng-establishment.d.ts +3 -39
- package/types/lucca-front-ng-fancy-box.d.ts +12 -0
- package/types/lucca-front-ng-file-upload.d.ts +18 -8
- package/types/lucca-front-ng-filter-pills.d.ts +6 -5
- package/types/lucca-front-ng-footer.d.ts +3 -0
- package/types/lucca-front-ng-form-field.d.ts +12 -3
- package/types/lucca-front-ng-form-header.d.ts +3 -0
- package/types/lucca-front-ng-form.d.ts +9 -5
- package/types/lucca-front-ng-forms-rich-text-input.d.ts +16 -16
- package/types/lucca-front-ng-forms.d.ts +41 -12
- package/types/lucca-front-ng-gauge.d.ts +25 -0
- package/types/lucca-front-ng-grid.d.ts +1 -1
- package/types/lucca-front-ng-highlight-data.d.ts +36 -15
- package/types/lucca-front-ng-horizontal-navigation.d.ts +3 -0
- package/types/lucca-front-ng-icon.d.ts +15 -0
- package/types/lucca-front-ng-inline-message.d.ts +12 -0
- package/types/lucca-front-ng-input.d.ts +2 -2
- package/types/lucca-front-ng-link.d.ts +17 -2
- package/types/lucca-front-ng-listbox.d.ts +16 -4
- package/types/lucca-front-ng-listing.d.ts +33 -2
- package/types/lucca-front-ng-main-layout.d.ts +6 -0
- package/types/lucca-front-ng-mobile-push.d.ts +9 -2
- package/types/lucca-front-ng-multi-select.d.ts +26 -24
- package/types/lucca-front-ng-new-badge.d.ts +3 -0
- package/types/lucca-front-ng-numeric-badge.d.ts +9 -0
- package/types/lucca-front-ng-option.d.ts +86 -149
- package/types/lucca-front-ng-page-header.d.ts +9 -0
- package/types/lucca-front-ng-pagination.d.ts +26 -2
- package/types/lucca-front-ng-plg-push.d.ts +8 -2
- package/types/lucca-front-ng-popover.d.ts +1 -20
- package/types/lucca-front-ng-popover2.d.ts +8 -6
- package/types/lucca-front-ng-progress-bar.d.ts +9 -0
- package/types/lucca-front-ng-read-more.d.ts +25 -10
- package/types/lucca-front-ng-resource-card.d.ts +6 -0
- package/types/lucca-front-ng-scroll-box.d.ts +4 -1
- package/types/lucca-front-ng-segmented-control-tabs.d.ts +7 -1
- package/types/lucca-front-ng-segmented-control.d.ts +16 -1
- package/types/lucca-front-ng-simple-select.d.ts +5 -4
- package/types/lucca-front-ng-skeleton.d.ts +61 -6
- package/types/lucca-front-ng-sortable-list.d.ts +24 -0
- package/types/lucca-front-ng-status-badge.d.ts +12 -0
- package/types/lucca-front-ng-tag.d.ts +6 -0
- package/types/lucca-front-ng-text-flow.d.ts +8 -0
- package/types/lucca-front-ng-time.d.ts +22 -16
- package/types/lucca-front-ng-toast.d.ts +2 -2
- package/types/lucca-front-ng-tooltip.d.ts +7 -14
- package/types/lucca-front-ng-user-popover.d.ts +6 -7
- package/types/lucca-front-ng-user.d.ts +6 -15
- package/types/lucca-front-ng-vertical-navigation.d.ts +30 -0
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const lib_1 = require("../lib");
|
|
4
4
|
const migration_1 = require("./migration");
|
|
5
|
-
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
|
|
6
5
|
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
7
6
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
8
7
|
require('@angular-devkit/schematics');
|
|
9
8
|
exports.default = (options) => {
|
|
10
9
|
return async (tree, context) => {
|
|
11
|
-
await
|
|
10
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
12
11
|
const postCssScss = await Promise.resolve().then(() => require('../lib/local-deps/postcss-scss.js'));
|
|
13
12
|
tree.visit((path, entry) => {
|
|
14
13
|
if (path.includes('node_modules') || !entry) {
|
|
15
14
|
return;
|
|
16
15
|
}
|
|
17
16
|
if (path.endsWith('.scss')) {
|
|
18
|
-
(0,
|
|
17
|
+
(0, lib_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateScssFile)(content, postCssScss));
|
|
19
18
|
}
|
|
20
19
|
if (path.endsWith('.html')) {
|
|
21
|
-
(0,
|
|
20
|
+
(0, lib_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateHTMLFile)(content));
|
|
22
21
|
}
|
|
23
22
|
});
|
|
24
23
|
};
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateScssFile = migrateScssFile;
|
|
4
4
|
exports.migrateHTMLFile = migrateHTMLFile;
|
|
5
|
-
const
|
|
6
|
-
const html_ast_js_1 = require("../lib/html-ast.js");
|
|
5
|
+
const lib_1 = require("../lib");
|
|
7
6
|
function migrateScssFile(content, postCssScss) {
|
|
8
7
|
const root = postCssScss.parse(content);
|
|
9
8
|
root.walkRules((rule) => {
|
|
@@ -15,8 +14,8 @@ function migrateScssFile(content, postCssScss) {
|
|
|
15
14
|
return root.toResult({ syntax: { stringify: postCssScss.stringify } }).css;
|
|
16
15
|
}
|
|
17
16
|
function migrateHTMLFile(content) {
|
|
18
|
-
return (0,
|
|
19
|
-
const htmlAst = new
|
|
17
|
+
return (0, lib_1.updateContent)(content, (updates) => {
|
|
18
|
+
const htmlAst = new lib_1.HtmlAst(content);
|
|
20
19
|
htmlAst.visitElementWithAttribute(/.*/, 'class', (_elem, attr) => {
|
|
21
20
|
const classes = attr.value;
|
|
22
21
|
if (classes.includes('actionIcon') && attr.valueSpan) {
|
|
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const glob = require("glob");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
6
|
+
const lib_1 = require("../lib");
|
|
7
7
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
8
8
|
const testsRoot = path.join(__dirname, 'tests');
|
|
9
9
|
const files = fs.readdirSync(testsRoot);
|
|
10
10
|
describe('actionIcon Migration', () => {
|
|
11
11
|
it('should update files', async () => {
|
|
12
12
|
// Arrange
|
|
13
|
-
const tree = (0,
|
|
14
|
-
const expectedTree = (0,
|
|
13
|
+
const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
|
|
14
|
+
const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
|
|
15
15
|
// Act
|
|
16
16
|
try {
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'action-icon', { skipInstallation: true }, tree);
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
20
|
// eslint-disable-next-line no-console
|
|
21
21
|
console.log(error);
|
|
22
22
|
}
|
|
23
23
|
// Assert
|
|
24
|
-
(0,
|
|
24
|
+
(0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
|
|
25
25
|
});
|
|
26
26
|
// Use this to migrate @lucca-front/* packages
|
|
27
27
|
it.skip('should migrate @lucca-front/*', async () => {
|
|
@@ -33,10 +33,10 @@ describe('actionIcon Migration', () => {
|
|
|
33
33
|
...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
|
|
34
34
|
...glob.sync('stories/**', { cwd: lfRoot, nodir: true }),
|
|
35
35
|
];
|
|
36
|
-
const treeOriginalTree = (0,
|
|
37
|
-
const tree = (0,
|
|
36
|
+
const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
37
|
+
const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
38
38
|
// Act
|
|
39
|
-
await (0,
|
|
39
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'action-icon', { skipInstallation: true }, tree);
|
|
40
40
|
// Assert
|
|
41
41
|
tree.visit((p, entry) => {
|
|
42
42
|
const original = treeOriginalTree.get(p)?.content.toString() || '';
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
|
|
3
|
+
const lib_1 = require("../lib");
|
|
5
4
|
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
6
5
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
7
6
|
require('@angular-devkit/schematics');
|
|
8
7
|
exports.default = (options) => {
|
|
9
8
|
return async (tree, context) => {
|
|
10
|
-
await
|
|
11
|
-
await new
|
|
9
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
10
|
+
await new lib_1.CssMapper(tree, {
|
|
12
11
|
classes: {
|
|
13
12
|
'u-textLeft': 'pr-u-textAlignStart',
|
|
14
13
|
'u-textCenter': 'pr-u-textAlignCenter',
|
|
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const glob = require("glob");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
6
|
+
const lib_1 = require("../lib");
|
|
7
7
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
8
8
|
const testsRoot = path.join(__dirname, 'tests');
|
|
9
9
|
const files = fs.readdirSync(testsRoot);
|
|
10
10
|
describe('Alignment utilities Migration', () => {
|
|
11
11
|
it('should update files', async () => {
|
|
12
12
|
// Arrange
|
|
13
|
-
const tree = (0,
|
|
14
|
-
const expectedTree = (0,
|
|
13
|
+
const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
|
|
14
|
+
const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
|
|
15
15
|
// Act
|
|
16
16
|
try {
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'alignment-utilities', { skipInstallation: true }, tree);
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
20
|
// eslint-disable-next-line no-console
|
|
21
21
|
console.log(error);
|
|
22
22
|
}
|
|
23
23
|
// Assert
|
|
24
|
-
(0,
|
|
24
|
+
(0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
|
|
25
25
|
});
|
|
26
26
|
// Use this to migrate @lucca-front/* packages
|
|
27
27
|
it.skip('should migrate @lucca-front/*', async () => {
|
|
@@ -33,10 +33,10 @@ describe('Alignment utilities Migration', () => {
|
|
|
33
33
|
...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
|
|
34
34
|
...glob.sync('stories/**', { cwd: lfRoot, nodir: true }),
|
|
35
35
|
];
|
|
36
|
-
const treeOriginalTree = (0,
|
|
37
|
-
const tree = (0,
|
|
36
|
+
const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
37
|
+
const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
38
38
|
// Act
|
|
39
|
-
await (0,
|
|
39
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'alignment-utilities', { skipInstallation: true }, tree);
|
|
40
40
|
// Assert
|
|
41
41
|
tree.visit((p, entry) => {
|
|
42
42
|
const original = treeOriginalTree.get(p)?.content.toString() || '';
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const lib_1 = require("../lib");
|
|
4
4
|
const migration_1 = require("./migration");
|
|
5
|
-
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
|
|
6
5
|
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
7
6
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
8
7
|
require('@angular-devkit/schematics');
|
|
9
8
|
exports.default = (options) => {
|
|
10
9
|
return async (tree, context) => {
|
|
11
|
-
await
|
|
10
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
12
11
|
tree.visit((path, entry) => {
|
|
13
12
|
if (path.includes('node_modules') || !entry) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
15
|
if (path.endsWith('.html')) {
|
|
17
|
-
(0,
|
|
16
|
+
(0, lib_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateHTMLFile)(content));
|
|
18
17
|
}
|
|
19
18
|
});
|
|
20
19
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.migrateHTMLFile = migrateHTMLFile;
|
|
4
|
-
const
|
|
5
|
-
const html_ast_js_1 = require("../lib/html-ast.js");
|
|
6
|
-
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
|
|
4
|
+
const lib_1 = require("../lib");
|
|
7
5
|
const REPLACE_MAP = {
|
|
8
6
|
'https://cdn.lucca.fr/development': 'https://cdn.lucca.fr/archives/development',
|
|
9
7
|
'https://cdn.lucca.fr/errors': 'https://cdn.lucca.fr/archives/errors',
|
|
@@ -44,14 +42,14 @@ const REPLACE_MAP = {
|
|
|
44
42
|
'https://cdn.lucca.fr/figgo-slack-status.png': 'https://cdn.lucca.fr/archives/figgo-slack-status.png'
|
|
45
43
|
};
|
|
46
44
|
function migrateHTMLFile(content) {
|
|
47
|
-
return (0,
|
|
48
|
-
const htmlAst = new
|
|
45
|
+
return (0, lib_1.updateContent)(content, (updates) => {
|
|
46
|
+
const htmlAst = new lib_1.HtmlAst(content);
|
|
49
47
|
htmlAst.visitNodes((node) => {
|
|
50
|
-
if (node instanceof
|
|
48
|
+
if (node instanceof lib_1.currentSchematicContext.angularCompiler.TmplAstElement) {
|
|
51
49
|
node.attributes.forEach((attr) => {
|
|
52
50
|
const match = findURLMatch(attr.value);
|
|
53
51
|
if (match && attr.valueSpan) {
|
|
54
|
-
|
|
52
|
+
lib_1.currentSchematicContext.logSuccess(`Replacing ${match} with ${attr.value.replace(match, REPLACE_MAP[match])}`);
|
|
55
53
|
updates.push({
|
|
56
54
|
position: attr.valueSpan?.start.offset,
|
|
57
55
|
oldContent: attr.value,
|
|
@@ -60,10 +58,10 @@ function migrateHTMLFile(content) {
|
|
|
60
58
|
}
|
|
61
59
|
});
|
|
62
60
|
node.inputs.forEach((input) => {
|
|
63
|
-
if (input.value instanceof
|
|
61
|
+
if (input.value instanceof lib_1.currentSchematicContext.angularCompiler.ASTWithSource) {
|
|
64
62
|
const match = findURLMatch(input.value?.source || '');
|
|
65
63
|
if (input.value?.source && match) {
|
|
66
|
-
|
|
64
|
+
lib_1.currentSchematicContext.logSuccess(`Replacing ${input.value.source} with ${input.value.source.replace(match, REPLACE_MAP[match])}`);
|
|
67
65
|
updates.push({
|
|
68
66
|
position: input.value?.sourceSpan.start,
|
|
69
67
|
oldContent: input.value.source,
|
|
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const glob = require("glob");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
6
|
+
const lib_1 = require("../lib");
|
|
7
7
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
8
8
|
const testsRoot = path.join(__dirname, 'tests');
|
|
9
9
|
const files = fs.readdirSync(testsRoot);
|
|
10
10
|
describe('cdnUrls Migration', () => {
|
|
11
11
|
it('should update files', async () => {
|
|
12
12
|
// Arrange
|
|
13
|
-
const tree = (0,
|
|
14
|
-
const expectedTree = (0,
|
|
13
|
+
const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
|
|
14
|
+
const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
|
|
15
15
|
// Act
|
|
16
16
|
try {
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'cdn-urls', { skipInstallation: true }, tree);
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
20
|
// eslint-disable-next-line no-console
|
|
21
21
|
console.log(error);
|
|
22
22
|
}
|
|
23
23
|
// Assert
|
|
24
|
-
(0,
|
|
24
|
+
(0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
|
|
25
25
|
});
|
|
26
26
|
// Use this to migrate @lucca-front/* packages
|
|
27
27
|
it.skip('should migrate @lucca-front/*', async () => {
|
|
@@ -33,10 +33,10 @@ describe('cdnUrls Migration', () => {
|
|
|
33
33
|
...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
|
|
34
34
|
...glob.sync('stories/**', { cwd: lfRoot, nodir: true })
|
|
35
35
|
];
|
|
36
|
-
const treeOriginalTree = (0,
|
|
37
|
-
const tree = (0,
|
|
36
|
+
const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
37
|
+
const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
38
38
|
// Act
|
|
39
|
-
await (0,
|
|
39
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'cdn-urls', { skipInstallation: true }, tree);
|
|
40
40
|
// Assert
|
|
41
41
|
tree.visit((p, entry) => {
|
|
42
42
|
const original = treeOriginalTree.get(p)?.content.toString() || '';
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
|
|
3
|
+
const lib_1 = require("../lib");
|
|
5
4
|
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
6
5
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
7
6
|
require('@angular-devkit/schematics');
|
|
8
7
|
exports.default = (options) => {
|
|
9
8
|
return async (tree, context) => {
|
|
10
|
-
await
|
|
11
|
-
await new
|
|
9
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
10
|
+
await new lib_1.CssMapper(tree, {
|
|
12
11
|
classes: {
|
|
13
12
|
"u-floatLeft": "pr-u-floatLeft",
|
|
14
13
|
"u-floatRight": "pr-u-floatRight",
|
|
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const glob = require("glob");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
6
|
+
const lib_1 = require("../lib");
|
|
7
7
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
8
8
|
const testsRoot = path.join(__dirname, 'tests');
|
|
9
9
|
const files = fs.readdirSync(testsRoot);
|
|
10
10
|
describe('Class prefix Migration', () => {
|
|
11
11
|
it('should update files', async () => {
|
|
12
12
|
// Arrange
|
|
13
|
-
const tree = (0,
|
|
14
|
-
const expectedTree = (0,
|
|
13
|
+
const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
|
|
14
|
+
const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
|
|
15
15
|
// Act
|
|
16
16
|
try {
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'class-prefix', { skipInstallation: true }, tree);
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
20
|
// eslint-disable-next-line no-console
|
|
21
21
|
console.log(error);
|
|
22
22
|
}
|
|
23
23
|
// Assert
|
|
24
|
-
(0,
|
|
24
|
+
(0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
|
|
25
25
|
});
|
|
26
26
|
// Use this to migrate @lucca-front/* packages
|
|
27
27
|
it.skip('should migrate @lucca-front/*', async () => {
|
|
@@ -33,10 +33,10 @@ describe('Class prefix Migration', () => {
|
|
|
33
33
|
...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
|
|
34
34
|
...glob.sync('stories/**', { cwd: lfRoot, nodir: true }),
|
|
35
35
|
];
|
|
36
|
-
const treeOriginalTree = (0,
|
|
37
|
-
const tree = (0,
|
|
36
|
+
const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
37
|
+
const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
38
38
|
// Act
|
|
39
|
-
await (0,
|
|
39
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'class-prefix', { skipInstallation: true }, tree);
|
|
40
40
|
// Assert
|
|
41
41
|
tree.visit((p, entry) => {
|
|
42
42
|
const original = treeOriginalTree.get(p)?.content.toString() || '';
|
|
@@ -76,6 +76,16 @@
|
|
|
76
76
|
"factory": "./lu-icon/index",
|
|
77
77
|
"schema": "./lu-icon/schema.json"
|
|
78
78
|
},
|
|
79
|
+
"lu-loading": {
|
|
80
|
+
"description": "Migrate HTML loading to the new lu-loading component",
|
|
81
|
+
"factory": "./lu-loading/index",
|
|
82
|
+
"schema": "./lu-loading/schema.json"
|
|
83
|
+
},
|
|
84
|
+
"lu-container": {
|
|
85
|
+
"description": "Migrate HTML container to the new lu-container component",
|
|
86
|
+
"factory": "./lu-container/index",
|
|
87
|
+
"schema": "./lu-container/schema.json"
|
|
88
|
+
},
|
|
79
89
|
"lu-button": {
|
|
80
90
|
"description": "Migrate CSS-only buttons to the new luButton component",
|
|
81
91
|
"factory": "./lu-button/index",
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
|
|
3
|
+
const lib_1 = require("../lib");
|
|
5
4
|
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
6
5
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
7
6
|
require('@angular-devkit/schematics');
|
|
8
7
|
exports.default = (options) => {
|
|
9
8
|
return async (tree, context) => {
|
|
10
|
-
await
|
|
11
|
-
await new
|
|
9
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
10
|
+
await new lib_1.CssMapper(tree, {
|
|
12
11
|
classes: {
|
|
13
12
|
'pr-u-textProduct': 'pr-u-colorTextProduct',
|
|
14
13
|
'pr-u-textPrimary': 'pr-u-colorTextProduct',
|
|
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const glob = require("glob");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
6
|
+
const lib_1 = require("../lib");
|
|
7
7
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
8
8
|
const testsRoot = path.join(__dirname, 'tests');
|
|
9
9
|
const files = fs.readdirSync(testsRoot);
|
|
10
10
|
describe('Color Text Migration', () => {
|
|
11
11
|
it('should update files', async () => {
|
|
12
12
|
// Arrange
|
|
13
|
-
const tree = (0,
|
|
14
|
-
const expectedTree = (0,
|
|
13
|
+
const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
|
|
14
|
+
const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
|
|
15
15
|
// Act
|
|
16
16
|
try {
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'color-text', { skipInstallation: true }, tree);
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
20
|
// eslint-disable-next-line no-console
|
|
21
21
|
console.log(error);
|
|
22
22
|
}
|
|
23
23
|
// Assert
|
|
24
|
-
(0,
|
|
24
|
+
(0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
|
|
25
25
|
});
|
|
26
26
|
// Use this to migrate @lucca-front/* packages
|
|
27
27
|
it.skip('should migrate @lucca-front/*', async () => {
|
|
@@ -33,10 +33,10 @@ describe('Color Text Migration', () => {
|
|
|
33
33
|
...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
|
|
34
34
|
...glob.sync('stories/**', { cwd: lfRoot, nodir: true }),
|
|
35
35
|
];
|
|
36
|
-
const treeOriginalTree = (0,
|
|
37
|
-
const tree = (0,
|
|
36
|
+
const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
37
|
+
const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
38
38
|
// Act
|
|
39
|
-
await (0,
|
|
39
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'color-text', { skipInstallation: true }, tree);
|
|
40
40
|
// Assert
|
|
41
41
|
tree.visit((p, entry) => {
|
|
42
42
|
const original = treeOriginalTree.get(p)?.content.toString() || '';
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
|
|
3
|
+
const lib_1 = require("../lib");
|
|
5
4
|
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
6
5
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
7
6
|
require('@angular-devkit/schematics');
|
|
8
7
|
exports.default = (options) => {
|
|
9
8
|
return async (tree, context) => {
|
|
10
|
-
await
|
|
11
|
-
new
|
|
9
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
10
|
+
new lib_1.ComponentMapper(tree, {
|
|
12
11
|
paths: {
|
|
13
12
|
"@lucca-front/ng/scrollBox": "@lucca-front/ng/scroll-box",
|
|
14
13
|
"@lucca-front/ng/segmentedControl": "@lucca-front/ng/segmented-control",
|
|
@@ -3,25 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const glob = require("glob");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
6
|
+
const lib_1 = require("../lib");
|
|
7
7
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
8
8
|
const testsRoot = path.join(__dirname, 'tests');
|
|
9
9
|
const files = fs.readdirSync(testsRoot);
|
|
10
10
|
describe('Component path Migration', () => {
|
|
11
11
|
it('should update files', async () => {
|
|
12
12
|
// Arrange
|
|
13
|
-
const tree = (0,
|
|
14
|
-
const expectedTree = (0,
|
|
13
|
+
const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
|
|
14
|
+
const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
|
|
15
15
|
// Act
|
|
16
16
|
try {
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'component-path', { skipInstallation: true }, tree);
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
20
|
//eslint-disable-next-line no-console
|
|
21
21
|
console.log(error);
|
|
22
22
|
}
|
|
23
23
|
// Assert
|
|
24
|
-
(0,
|
|
24
|
+
(0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
|
|
25
25
|
});
|
|
26
26
|
// Use this to migrate @lucca-front/* packages
|
|
27
27
|
it.skip('should migrate @lucca-front/*', async () => {
|
|
@@ -33,10 +33,10 @@ describe('Component path Migration', () => {
|
|
|
33
33
|
...glob.sync('packages/ng/**/*', { cwd: lfRoot, nodir: true, ignore: ['**/schematics/**'] }),
|
|
34
34
|
...glob.sync('stories/**', { cwd: lfRoot, nodir: true }),
|
|
35
35
|
];
|
|
36
|
-
const treeOriginalTree = (0,
|
|
37
|
-
const tree = (0,
|
|
36
|
+
const treeOriginalTree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
37
|
+
const tree = (0, lib_1.createTreeFromFiles)(lfRoot, lfFiles, '.');
|
|
38
38
|
// Act
|
|
39
|
-
await (0,
|
|
39
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'component-path', { skipInstallation: true }, tree);
|
|
40
40
|
// Assert
|
|
41
41
|
tree.visit((p, entry) => {
|
|
42
42
|
const original = treeOriginalTree.get(p)?.content.toString() || '';
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const schematics_1 = require("../lib/schematics");
|
|
5
|
-
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
|
|
3
|
+
const lib_1 = require("../lib");
|
|
6
4
|
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
7
5
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
8
6
|
require('@angular-devkit/schematics');
|
|
9
7
|
exports.default = (options) => {
|
|
10
8
|
return async (tree, context) => {
|
|
11
|
-
await
|
|
9
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
12
10
|
tree.visit((path, entry) => {
|
|
13
11
|
if (path.includes('node_modules') || !entry) {
|
|
14
12
|
return;
|
|
15
13
|
}
|
|
16
|
-
(0,
|
|
17
|
-
template = (0,
|
|
18
|
-
template = (0,
|
|
14
|
+
(0, lib_1.migrateFile)(path, entry, tree, (content) => (0, lib_1.updateAngularTemplate)(path, content, (template) => {
|
|
15
|
+
template = (0, lib_1.replaceComponentInputName)('lu-empty-state-page', 'title', 'heading', template);
|
|
16
|
+
template = (0, lib_1.replaceComponentInputName)('lu-empty-state-section', 'title', 'heading', template);
|
|
19
17
|
return template;
|
|
20
18
|
}));
|
|
21
19
|
});
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const
|
|
5
|
+
const lib_1 = require("../lib");
|
|
6
6
|
const collectionPath = path.normalize(path.join(__dirname, '..', 'migrations.json'));
|
|
7
7
|
const testsRoot = path.join(__dirname, 'tests');
|
|
8
8
|
const files = fs.readdirSync(testsRoot);
|
|
9
9
|
describe('Empty state title migration', () => {
|
|
10
10
|
it('should update files', async () => {
|
|
11
11
|
// Arrange
|
|
12
|
-
const tree = (0,
|
|
13
|
-
const expectedTree = (0,
|
|
12
|
+
const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
|
|
13
|
+
const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
|
|
14
14
|
// Act
|
|
15
15
|
try {
|
|
16
|
-
await (0,
|
|
16
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'empty-state-heading', { skipInstallation: true }, tree);
|
|
17
17
|
}
|
|
18
18
|
catch (error) {
|
|
19
19
|
// eslint-disable-next-line no-console
|
|
20
20
|
console.log(error);
|
|
21
21
|
}
|
|
22
22
|
// Assert
|
|
23
|
-
(0,
|
|
23
|
+
(0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
|
|
24
24
|
});
|
|
25
25
|
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./angular-component-ast"), exports);
|
|
18
|
+
__exportStar(require("./angular-template"), exports);
|
|
19
|
+
__exportStar(require("./component-mapper"), exports);
|
|
20
|
+
__exportStar(require("./css-mapper"), exports);
|
|
21
|
+
__exportStar(require("./file-update"), exports);
|
|
22
|
+
__exportStar(require("./html-ast"), exports);
|
|
23
|
+
__exportStar(require("./lf-schematic-context"), exports);
|
|
24
|
+
__exportStar(require("./migration-test"), exports);
|
|
25
|
+
__exportStar(require("./schematic.utils"), exports);
|
|
26
|
+
__exportStar(require("./schematics"), exports);
|
|
27
|
+
__exportStar(require("./scss-ast"), exports);
|
|
28
|
+
__exportStar(require("./scss-value-ast"), exports);
|
|
29
|
+
__exportStar(require("./typescript-ast"), exports);
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
],
|
|
74
74
|
"license": "MIT",
|
|
75
|
+
"peer": true,
|
|
75
76
|
"dependencies": {
|
|
76
77
|
"nanoid": "^3.3.8",
|
|
77
78
|
"picocolors": "^1.1.1",
|
|
@@ -167,6 +168,7 @@
|
|
|
167
168
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
|
|
168
169
|
"integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==",
|
|
169
170
|
"dev": true,
|
|
171
|
+
"peer": true,
|
|
170
172
|
"requires": {
|
|
171
173
|
"nanoid": "^3.3.8",
|
|
172
174
|
"picocolors": "^1.1.1",
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.camelize = camelize;
|
|
4
4
|
exports.pascalize = pascalize;
|
|
5
5
|
exports.expand = expand;
|
|
6
|
+
exports.isInterestingNode = isInterestingNode;
|
|
7
|
+
const lf_schematic_context_1 = require("./lf-schematic-context");
|
|
6
8
|
function camelize(str) {
|
|
7
9
|
return str[0].toLowerCase() + str.slice(1);
|
|
8
10
|
}
|
|
@@ -27,3 +29,6 @@ function expand(rawMapping, mappingProps) {
|
|
|
27
29
|
return values;
|
|
28
30
|
}));
|
|
29
31
|
}
|
|
32
|
+
function isInterestingNode(node) {
|
|
33
|
+
return node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstElement;
|
|
34
|
+
}
|