New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@lucca-front/ng

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lucca-front/ng - npm Package Compare versions

Comparing version

to
19.2.0

@@ -0,4 +1,4 @@

export * from './tokens';
export * from './filter-pill-displayer.directive';
export * from './filter-pill-label.directive';
export * from './filter-pill-input-component';
export * from './tokens';
export * from './filter-pill/filter-pill.component';
export * from './filter-pills-bar/filter-pills-bar.component';
export * from './filter-pills-bar/filter-pill-addon.directive';
export * from './filter-bar/filter-bar.component';
export * from './filter-bar/filter-pill-addon.directive';
export * from './core/index';

@@ -7,3 +7,2 @@ import { OnDestroy } from '@angular/core';

intl: import("./link.translate").LinkTranslate;
label: string;
routerLinkCommands: import("@angular/core").InputSignal<string | any[] | import("@angular/router").UrlTree>;

@@ -21,5 +20,5 @@ disabled: import("@angular/core").InputSignalWithTransform<boolean, boolean>;

static ɵfac: i0.ɵɵFactoryDeclaration<LinkComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<LinkComponent, "a[luLink]", never, { "label": { "alias": "label"; "required": true; }; "routerLinkCommands": { "alias": "luLink"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "decorationHover": { "alias": "decorationHover"; "required": false; }; "external": { "alias": "external"; "required": false; }; }, {}, never, ["*"], true, [{ directive: typeof i1.RouterLink; inputs: { "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "state": "state"; "info": "info"; "relativeTo": "relativeTo"; }; outputs: {}; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<LinkComponent, "a[luLink], button[luLink]", never, { "routerLinkCommands": { "alias": "luLink"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "decorationHover": { "alias": "decorationHover"; "required": false; }; "external": { "alias": "external"; "required": false; }; }, {}, never, ["*"], true, [{ directive: typeof i1.RouterLink; inputs: { "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "state": "state"; "info": "info"; "relativeTo": "relativeTo"; }; outputs: {}; }]>;
static ngAcceptInputType_decorationHover: unknown;
static ngAcceptInputType_external: unknown;
}

@@ -17,2 +17,3 @@ import { OnChanges, SimpleChanges } from '@angular/core';

maxValue: number;
disableTooltip: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
/**

@@ -25,3 +26,3 @@ * The palette to use for this badge. Defaults to 'none' (inherits parent palette)

static ɵfac: i0.ɵɵFactoryDeclaration<NumericBadgeComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NumericBadgeComponent, "lu-numeric-badge", never, { "value": { "alias": "value"; "required": true; }; "size": { "alias": "size"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "maxValue": { "alias": "maxValue"; "required": false; }; "palette": { "alias": "palette"; "required": false; }; }, {}, never, never, true, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<NumericBadgeComponent, "lu-numeric-badge", never, { "value": { "alias": "value"; "required": true; }; "size": { "alias": "size"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "maxValue": { "alias": "maxValue"; "required": false; }; "disableTooltip": { "alias": "disableTooltip"; "required": false; "isSignal": true; }; "palette": { "alias": "palette"; "required": false; }; }, {}, never, never, true, never>;
}
{
"name": "@lucca-front/ng",
"version": "19.2.0-rc.1",
"version": "19.2.0",
"description": "A library of icons made by the team @Lucca",

@@ -29,4 +29,4 @@ "repository": {

"@angular/cdk": "^19.0.0",
"@lucca-front/icons": "19.2.0-rc.1",
"@lucca-front/scss": "19.2.0-rc.1",
"@lucca-front/icons": "19.2.0",
"@lucca-front/scss": "19.2.0",
"isomorphic-dompurify": "^2.17.0",

@@ -53,2 +53,6 @@ "date-fns": "^3.6.0",

},
"./button": {
"types": "./button/index.d.ts",
"default": "./fesm2022/lucca-front-ng-button.mjs"
},
"./animations": {

@@ -58,6 +62,2 @@ "types": "./animations/index.d.ts",

},
"./button": {
"types": "./button/index.d.ts",
"default": "./fesm2022/lucca-front-ng-button.mjs"
},
"./chip": {

@@ -71,2 +71,6 @@ "types": "./chip/index.d.ts",

},
"./api": {
"types": "./api/index.d.ts",
"default": "./fesm2022/lucca-front-ng-api.mjs"
},
"./comment": {

@@ -76,6 +80,2 @@ "types": "./comment/index.d.ts",

},
"./api": {
"types": "./api/index.d.ts",
"default": "./fesm2022/lucca-front-ng-api.mjs"
},
"./core": {

@@ -129,2 +129,6 @@ "types": "./core/index.d.ts",

},
"./form-field": {
"types": "./form-field/index.d.ts",
"default": "./fesm2022/lucca-front-ng-form-field.mjs"
},
"./formly": {

@@ -134,5 +138,5 @@ "types": "./formly/index.d.ts",

},
"./form-field": {
"types": "./form-field/index.d.ts",
"default": "./fesm2022/lucca-front-ng-form-field.mjs"
"./icon": {
"types": "./icon/index.d.ts",
"default": "./fesm2022/lucca-front-ng-icon.mjs"
},

@@ -143,6 +147,2 @@ "./forms": {

},
"./icon": {
"types": "./icon/index.d.ts",
"default": "./fesm2022/lucca-front-ng-icon.mjs"
},
"./inline-message": {

@@ -164,2 +164,6 @@ "types": "./inline-message/index.d.ts",

},
"./new-badge": {
"types": "./new-badge/index.d.ts",
"default": "./fesm2022/lucca-front-ng-new-badge.mjs"
},
"./multi-select": {

@@ -169,6 +173,2 @@ "types": "./multi-select/index.d.ts",

},
"./new-badge": {
"types": "./new-badge/index.d.ts",
"default": "./fesm2022/lucca-front-ng-new-badge.mjs"
},
"./number": {

@@ -242,2 +242,6 @@ "types": "./number/index.d.ts",

},
"./statusBadge": {
"types": "./statusBadge/index.d.ts",
"default": "./fesm2022/lucca-front-ng-statusBadge.mjs"
},
"./skeleton": {

@@ -247,6 +251,2 @@ "types": "./skeleton/index.d.ts",

},
"./statusBadge": {
"types": "./statusBadge/index.d.ts",
"default": "./fesm2022/lucca-front-ng-statusBadge.mjs"
},
"./tag": {

@@ -253,0 +253,0 @@ "types": "./tag/index.d.ts",

@@ -9,6 +9,2 @@ import { Overlay, OverlayRef } from '@angular/cdk/overlay';

import * as i0 from "@angular/core";
/**
* This directive is intended to be used in conjunction with an lu-dropdown tag. It is
* responsible for toggling the display of the provided dropdown instance.
*/
export declare class LuUserPopoverDirective extends ALuPopoverTrigger<LuUserPopoverPanelComponent, LuPopoverTarget> implements AfterViewInit, OnDestroy {

@@ -15,0 +11,0 @@ protected _overlay: Overlay;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const installer_1 = require("../lib/local-deps/installer");
const schematics_1 = require("../lib/schematics");
const migration_1 = require("./migration");
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
// 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)

@@ -10,9 +10,5 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports

exports.default = (options) => {
const skipInstallation = options?.skipInstallation ?? false;
return async (tree, context) => {
if (!skipInstallation) {
(0, installer_1.installLocalDependencies)(context);
}
await lf_schematic_context_1.currentSchematicContext.init(context, options);
const postCssScss = await Promise.resolve().then(() => require('../lib/local-deps/postcss-scss.js'));
const angularCompiler = await Promise.resolve().then(() => require('@angular/compiler'));
tree.visit((path, entry) => {

@@ -26,3 +22,3 @@ if (path.includes('node_modules') || !entry) {

if (path.endsWith('.html')) {
(0, schematics_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateHTMLFile)(content, angularCompiler));
(0, schematics_1.migrateFile)(path, entry, tree, (content) => (0, migration_1.migrateHTMLFile)(content));
}

@@ -29,0 +25,0 @@ });

@@ -17,5 +17,5 @@ "use strict";

}
function migrateHTMLFile(content, angularCompiler) {
function migrateHTMLFile(content) {
return (0, file_update_js_1.updateContent)(content, (updates) => {
const htmlAst = new html_ast_js_1.HtmlAst(content, angularCompiler);
const htmlAst = new html_ast_js_1.HtmlAst(content);
htmlAst.visitElementWithAttribute(/.*/, 'class', (elem, attr) => {

@@ -34,3 +34,3 @@ const classes = attr.value;

oldContent: attr.value,
newContent: newClasses,
newContent: newClasses
});

@@ -37,0 +37,0 @@ }

{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontActionIcon",
"title": "Lucca Front Action Icon Schema",
"type": "object",
"properties": {}
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontActionIcon",
"title": "Lucca Front Action Icon Schema",
"type": "object",
"properties": {
"dryRun": {
"type": "boolean",
"description": "Run through the migration without making any changes.",
"default": false
},
"skipInstall": {
"type": "boolean",
"description": "Skip installing dependencies.",
"default": false
},
"verbose": {
"type": "boolean",
"description": "Enable verbose logging.",
"default": false
}
}
}
{
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {
"ng-add": {
"description": "Add my lucca-front to the project.",
"factory": "./ng-add/index#ngAdd",
"schema": "./ng-add/schema.json"
},
"new-icons": {
"description": "Replace old icon names with new ones.",
"factory": "./new-icons/index",
"schema": "./new-icons/schema.json"
},
"tokens-spacings": {
"description": "Replace tokens with new names.",
"factory": "./tokens-spacing/index",
"schema": "./tokens-spacing/schema.json"
},
"palettes": {
"description": "Replace palettes with new names.",
"factory": "./palettes/index",
"schema": "./palettes/schema.json"
},
"action-icon": {
"description": "Replace actionIcon usages with button mod-onlyIcon",
"factory": "./action-icon/index",
"schema": "./action-icon/schema.json"
}
}
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
"schematics": {
"ng-add": {
"description": "Add my lucca-front to the project.",
"factory": "./ng-add/index#ngAdd",
"schema": "./ng-add/schema.json"
},
"new-icons": {
"description": "Replace old icon names with new ones.",
"factory": "./new-icons/index",
"schema": "./new-icons/schema.json"
},
"lu-select": {
"description": "Migrate lu-select into lu-simple-select and lu-multiple-select where possible.",
"factory": "./lu-select/index",
"schema": "./lu-select/schema.json"
},
"tokens-spacings": {
"description": "Replace tokens with new names.",
"factory": "./tokens-spacing/index",
"schema": "./tokens-spacing/schema.json"
},
"palettes": {
"description": "Replace palettes with new names.",
"factory": "./palettes/index",
"schema": "./palettes/schema.json"
},
"action-icon": {
"description": "Replace actionIcon usages with button mod-onlyIcon",
"factory": "./action-icon/index",
"schema": "./action-icon/schema.json"
},
"cdn-urls": {
"description": "Replace cdn urls with their new location",
"factory": "./cdn-urls/index",
"schema": "./cdn-urls/schema.json"
}
}
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const angular_template_1 = require("../lib/angular-template");
const installer_1 = require("../lib/local-deps/installer");
const schematics_1 = require("../lib/schematics");
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
// 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)

@@ -10,8 +10,4 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports

exports.default = (options) => {
const skipInstallation = options?.skipInstallation ?? false;
return async (tree, context) => {
if (!skipInstallation) {
(0, installer_1.installLocalDependencies)(context);
}
const angularCompiler = await Promise.resolve().then(() => require('@angular/compiler'));
await lf_schematic_context_1.currentSchematicContext.init(context, options);
tree.visit((path, entry) => {

@@ -22,4 +18,4 @@ if (path.includes('node_modules') || !entry) {

(0, schematics_1.migrateFile)(path, entry, tree, (content) => (0, angular_template_1.updateAngularTemplate)(path, content, (template) => {
template = (0, angular_template_1.replaceComponentInputName)('lu-empty-state-page', 'title', 'heading', template, angularCompiler);
template = (0, angular_template_1.replaceComponentInputName)('lu-empty-state-section', 'title', 'heading', template, angularCompiler);
template = (0, angular_template_1.replaceComponentInputName)('lu-empty-state-page', 'title', 'heading', template);
template = (0, angular_template_1.replaceComponentInputName)('lu-empty-state-section', 'title', 'heading', template);
return template;

@@ -26,0 +22,0 @@ }));

{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontTokensSpacing",
"title": "Lucca Front Tokens Spacing Schema",
"type": "object",
"properties": {}
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontTokensSpacing",
"title": "Lucca Front Tokens Spacing Schema",
"type": "object",
"properties": {
"dryRun": {
"type": "boolean",
"description": "Run through the migration without making any changes.",
"default": false
},
"skipInstall": {
"type": "boolean",
"description": "Skip installing dependencies.",
"default": false
},
"verbose": {
"type": "boolean",
"description": "Enable verbose logging.",
"default": false
}
}
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractNgTemplatesIncludingHtml = extractNgTemplatesIncludingHtml;
exports.extractNgTemplates = extractNgTemplates;

@@ -13,2 +14,39 @@ exports.createVisitor = createVisitor;

const typescript_ast_1 = require("./typescript-ast");
const path_1 = require("path");
const lf_schematic_context_1 = require("./lf-schematic-context");
function extractNgTemplatesIncludingHtml(sourceFile, tree, path) {
const templates = [...extractNgTemplates(sourceFile).map((tmpl) => ({ ...tmpl, filePath: path }))];
(0, typescript_1.forEachChild)(sourceFile, createVisitor(typescript_1.isDecorator, (decorator) => {
if (!(0, typescript_1.isCallExpression)(decorator.expression)) {
return;
}
if (!(0, typescript_1.isIdentifier)(decorator.expression.expression)) {
return;
}
if (decorator.expression.expression.escapedText !== 'Component') {
return;
}
const argument = decorator.expression.arguments[0];
if (!argument || !(0, typescript_1.isObjectLiteralExpression)(argument)) {
return;
}
templates.push(...argument.properties
.filter(typescript_1.isPropertyAssignment)
.filter((prop) => (0, typescript_1.isIdentifier)(prop.name) && prop.name.text === 'templateUrl')
.map((prop) => prop.initializer)
.filter(orGuard(typescript_1.isStringLiteral, typescript_1.isNoSubstitutionTemplateLiteral))
.map((initializer) => {
const filePath = (0, path_1.join)((0, path_1.dirname)(sourceFile.fileName), initializer.text);
const content = tree.readText(filePath);
return {
offsetStart: 0,
offsetEnd: content.length,
content,
filePath,
componentTS: sourceFile
};
}));
}));
return templates;
}
function extractNgTemplates(fileNameOrSourceFile, content) {

@@ -40,2 +78,4 @@ const sourcefile = typeof fileNameOrSourceFile === 'string' ? (0, typescript_1.createSourceFile)(fileNameOrSourceFile, content || '', typescript_1.ScriptTarget.ESNext) : fileNameOrSourceFile;

content: 'rawText' in initializer && initializer.rawText ? initializer.rawText : initializer.text,
filePath: sourcefile.fileName,
componentTS: sourcefile
})));

@@ -56,7 +96,7 @@ }));

}
function replaceComponentInput(componentName, inputName, oldStringToNewString, template, angularCompiler) {
function replaceComponentInput(componentName, inputName, oldStringToNewString, template) {
return (0, file_update_1.updateContent)(template, (updates) => {
const htmlAst = new html_ast_1.HtmlAst(template, angularCompiler);
const htmlAst = new html_ast_1.HtmlAst(template);
htmlAst.visitElements(componentName, (el) => {
const elAst = new html_ast_1.HtmlAstVisitor(el, angularCompiler);
const elAst = new html_ast_1.HtmlAstVisitor(el);
elAst.visitAttribute(inputName, (attr) => {

@@ -67,3 +107,3 @@ if (attr.valueSpan && attr.value in oldStringToNewString) {

oldContent: attr.value,
newContent: oldStringToNewString[attr.value],
newContent: oldStringToNewString[attr.value]
});

@@ -73,3 +113,3 @@ }

elAst.visitBoundAttribute(inputName, (attr) => {
if (attr.valueSpan && attr.value instanceof angularCompiler.ASTWithSource) {
if (attr.valueSpan && attr.value instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.ASTWithSource) {
const attrValue = attr.value.source || '';

@@ -79,3 +119,3 @@ const sourcefile = (0, typescript_1.createSourceFile)('', attrValue, typescript_1.ScriptTarget.ESNext);

...update,
position: (attr.valueSpan?.start.offset ?? 0) + update.position,
position: (attr.valueSpan?.start.offset ?? 0) + update.position
})));

@@ -87,7 +127,7 @@ }

}
function replaceComponentInputName(componentName, oldInputName, newInputName, template, angularCompiler) {
function replaceComponentInputName(componentName, oldInputName, newInputName, template) {
return (0, file_update_1.updateContent)(template, (updates) => {
const htmlAst = new html_ast_1.HtmlAst(template, angularCompiler);
const htmlAst = new html_ast_1.HtmlAst(template);
htmlAst.visitElements(componentName, (el) => {
const elAst = new html_ast_1.HtmlAstVisitor(el, angularCompiler);
const elAst = new html_ast_1.HtmlAstVisitor(el);
elAst.visitAttribute(oldInputName, (attr) => {

@@ -98,3 +138,3 @@ if (attr.keySpan) {

oldContent: oldInputName,
newContent: newInputName,
newContent: newInputName
});

@@ -108,3 +148,3 @@ }

oldContent: oldInputName,
newContent: newInputName,
newContent: newInputName
});

@@ -129,5 +169,5 @@ }

oldContent: tpl.content,
newContent: updater(tpl.content),
newContent: updater(tpl.content)
})));
});
}

@@ -11,2 +11,3 @@ "use strict";

const angular_template_1 = require("./angular-template");
const lf_schematic_context_1 = require("./lf-schematic-context");
class CssMapper {

@@ -20,3 +21,3 @@ constructor(tree, rawMappings, mappingProps) {

variables: this.expand(this.rawMappings.variables),
mixins: this.expand(this.rawMappings.mixins),
mixins: this.expand(this.rawMappings.mixins)
};

@@ -28,3 +29,2 @@ this.classesToUpdate = new Set(Object.keys(this.mappings.classes));

const postCssScss = await Promise.resolve().then(() => require('../lib/local-deps/postcss-scss.js'));
const angularCompiler = await Promise.resolve().then(() => require('@angular/compiler'));
const { postcssValueParser } = await Promise.resolve().then(() => require('../lib/local-deps/postcss-value-parser.js'));

@@ -40,6 +40,6 @@ const { postcssSelectorParser } = await Promise.resolve().then(() => require('../lib/local-deps/postcss-selector-parser.js'));

if (path.endsWith('.html')) {
(0, schematics_1.migrateFile)(path, entry, this.tree, (content) => this.migrateHTMLFile(content, angularCompiler));
(0, schematics_1.migrateFile)(path, entry, this.tree, (content) => this.migrateHTMLFile(content));
}
if (path.endsWith('.ts')) {
(0, schematics_1.migrateFile)(path, entry, this.tree, (content) => this.migrateTsFile(path, content, angularCompiler));
(0, schematics_1.migrateFile)(path, entry, this.tree, (content) => this.migrateTsFile(path, content));
}

@@ -55,10 +55,10 @@ });

}
migrateHTMLFile(content, angularCompiler) {
content = (0, html_ast_1.updateCssClassNames)(content, this.mappings.classes, angularCompiler);
migrateHTMLFile(content) {
content = (0, html_ast_1.updateCssClassNames)(content, this.mappings.classes);
return (0, file_update_1.updateContent)(content, (updates) => {
const htmlAst = new html_ast_1.HtmlAst(content, angularCompiler);
const htmlAst = new html_ast_1.HtmlAst(content);
htmlAst.visitElements(/.*/, (elem) => {
const elAst = new html_ast_1.HtmlAstVisitor(elem, angularCompiler);
const elAst = new html_ast_1.HtmlAstVisitor(elem);
elAst.visitBoundAttribute(/.*/, (attr) => {
if (attr.valueSpan && attr.value instanceof angularCompiler.ASTWithSource) {
if (attr.valueSpan && attr.value instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.ASTWithSource) {
const attrValue = attr.value.source || '';

@@ -68,3 +68,3 @@ const sourcefile = (0, typescript_1.createSourceFile)('', attrValue, typescript_1.ScriptTarget.ESNext);

...update,
position: (attr.valueSpan?.start.offset ?? 0) + update.position,
position: (attr.valueSpan?.start.offset ?? 0) + update.position
})));

@@ -78,3 +78,3 @@ }

oldContent: attr.value,
newContent: this.updateCssText(attr.value),
newContent: this.updateCssText(attr.value)
});

@@ -86,3 +86,3 @@ }

}
migrateTsFile(fileName, content, angularCompiler) {
migrateTsFile(fileName, content) {
const sourcefile = (0, typescript_1.createSourceFile)(fileName, content, typescript_1.ScriptTarget.ESNext);

@@ -93,3 +93,3 @@ const templates = (0, angular_template_1.extractNgTemplates)(sourcefile);

oldContent: tpl.content,
newContent: (0, html_ast_1.updateCssClassNames)(tpl.content, this.mappings.classes, angularCompiler),
newContent: (0, html_ast_1.updateCssClassNames)(tpl.content, this.mappings.classes)
}));

@@ -103,3 +103,3 @@ (0, typescript_1.forEachChild)(sourcefile, (0, angular_template_1.createVisitor)(typescript_1.isStringLiteral, (node) => {

oldContent: node.text,
newContent: newText,
newContent: newText
});

@@ -106,0 +106,0 @@ }

@@ -10,5 +10,5 @@ "use strict";

const typescript_ast_js_1 = require("./typescript-ast.js");
const lf_schematic_context_1 = require("./lf-schematic-context");
class HtmlAstVisitor {
constructor(nodes, lib) {
this.lib = lib;
constructor(nodes) {
this.nodes = Array.isArray(nodes) ? nodes : [nodes];

@@ -18,3 +18,3 @@ }

this.visitNodes((node) => {
if (node instanceof this.lib.TmplAstElement) {
if (node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstElement) {
if (this.matchFilter(node.name, elementFilter)) {

@@ -28,3 +28,3 @@ cb(node);

this.visitNodes((node) => {
if (node instanceof this.lib.TmplAstElement || node instanceof this.lib.TmplAstTemplate || node instanceof this.lib.TmplAstContent) {
if (node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstElement || node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstTemplate || node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstContent) {
for (const attr of node.attributes) {

@@ -40,3 +40,3 @@ if (this.matchFilter(attr.name, attributeFilter)) {

this.visitNodes((node) => {
if (node instanceof this.lib.TmplAstElement) {
if (node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstElement) {
if (this.matchFilter(node.name, elementFilter)) {

@@ -54,3 +54,3 @@ for (const attr of node.attributes) {

this.visitNodes((node) => {
if (node instanceof this.lib.TmplAstElement || node instanceof this.lib.TmplAstTemplate) {
if (node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstElement || node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstTemplate) {
for (const input of node.inputs) {

@@ -70,3 +70,3 @@ if (this.matchFilter(input.name, attributeFilter)) {

cb(node);
if (node instanceof this.lib.TmplAstIfBlock) {
if (node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstIfBlock) {
// Visit @if branches

@@ -77,3 +77,3 @@ node.branches.forEach((branch) => {

}
else if (node instanceof this.lib.TmplAstForLoopBlock) {
else if (node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstForLoopBlock) {
// Visit @for's children

@@ -86,3 +86,3 @@ this.visit(cb, node.children);

}
else if (node instanceof this.lib.TmplAstSwitchBlock) {
else if (node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstSwitchBlock) {
node.cases.forEach((caseNode) => {

@@ -92,3 +92,3 @@ this.visit(cb, caseNode.children);

}
else if (node instanceof this.lib.TmplAstDeferredBlock || node instanceof this.lib.TmplAstElement || node instanceof this.lib.TmplAstTemplate) {
else if (node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstDeferredBlock || node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstElement || node instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstTemplate) {
// Visit @defer and classic AST elements

@@ -105,13 +105,13 @@ this.visit(cb, node.children);

class HtmlAst extends HtmlAstVisitor {
constructor(content, lib) {
super(lib.parseTemplate(content, 'migration.html', {
constructor(content) {
super(lf_schematic_context_1.currentSchematicContext.angularCompiler.parseTemplate(content, 'migration.html', {
preserveWhitespaces: true,
enableBlockSyntax: true,
}).nodes, lib);
enableBlockSyntax: true
}).nodes);
}
}
exports.HtmlAst = HtmlAst;
function updateCssClassNames(content, oldClassToNewClass, lib) {
function updateCssClassNames(content, oldClassToNewClass) {
return (0, file_update_js_1.updateContent)(content, (updates) => {
const root = new HtmlAst(content, lib);
const root = new HtmlAst(content);
const visitedAttributes = new WeakSet();

@@ -130,3 +130,3 @@ const cssClassesToUpdate = new Set(Object.keys(oldClassToNewClass));

oldContent: classAttr.value,
newContent: classes.map((cl) => oldClassToNewClass[cl] || cl).join(' '),
newContent: classes.map((cl) => oldClassToNewClass[cl] || cl).join(' ')
});

@@ -147,7 +147,7 @@ }

oldContent: boundAttr.keySpan.details || '',
newContent: boundAttr.keySpan.details?.replace(`class.${cl}`, `class.${oldClassToNewClass[cl]}`) || '',
newContent: boundAttr.keySpan.details?.replace(`class.${cl}`, `class.${oldClassToNewClass[cl]}`) || ''
});
});
root.visitBoundAttribute('ngClass', (boundAttr) => {
if (!(boundAttr.value instanceof lib.ASTWithSource)) {
if (!(boundAttr.value instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.ASTWithSource)) {
return;

@@ -159,3 +159,3 @@ }

visitedAttributes.add(boundAttr);
if (boundAttr.valueSpan && boundAttr.value instanceof lib.ASTWithSource) {
if (boundAttr.valueSpan && boundAttr.value instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.ASTWithSource) {
const attrValue = boundAttr.value.source || '';

@@ -166,3 +166,3 @@ const sourcefile = (0, typescript_1.createSourceFile)('', attrValue, typescript_1.ScriptTarget.ESNext);

oldContent: attrValue,
newContent: (0, file_update_js_1.applyUpdates)(attrValue, (0, typescript_ast_js_1.replaceStringLiterals)(sourcefile, oldClassToNewClass)),
newContent: (0, file_update_js_1.applyUpdates)(attrValue, (0, typescript_ast_js_1.replaceStringLiterals)(sourcefile, oldClassToNewClass))
});

@@ -173,5 +173,5 @@ }

}
function extractAllCssClassNames(content, lib) {
function extractAllCssClassNames(content) {
const allClasses = new Set();
const root = new HtmlAst(content, lib);
const root = new HtmlAst(content);
root.visitAttribute('class', (classAttr) => classAttr.value.split(' ').forEach((cls) => allClasses.add(cls)));

@@ -185,7 +185,7 @@ root.visitBoundAttribute(/.*/, (boundAttr) => {

}
function extractAllHtmlElementNames(content, lib) {
function extractAllHtmlElementNames(content) {
const allElements = new Set();
const root = new HtmlAst(content, lib);
const root = new HtmlAst(content);
root.visitElements(/.*/, (element) => allElements.add(element.name));
return [...allElements];
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTreeFromFiles = createTreeFromFiles;
exports.createTreeFromFolder = createTreeFromFolder;
exports.runMigration = runMigration;

@@ -11,2 +12,3 @@ exports.runSchematic = runSchematic;

const path_1 = require("path");
const node_fs_1 = require("node:fs");
function createTreeFromFiles(testsRoot, files, filePartFilter) {

@@ -20,2 +22,9 @@ const tree = new testing_1.UnitTestTree(schematics_1.Tree.empty());

}
function createTreeFromFolder(folder) {
const tree = new testing_1.UnitTestTree(schematics_1.Tree.empty());
for (const file of (0, node_fs_1.readdirSync)(folder)) {
tree.create(file, fs_1.default.readFileSync(path_1.default.join(folder, file)).toString().replace(/\r/g, ''));
}
return tree;
}
async function runMigration(collectionPath, migrationName, migrationOptions, tree) {

@@ -22,0 +31,0 @@ await runSchematic(collectionPath, 'migrations', migrationName, migrationOptions, tree);

@@ -18,3 +18,3 @@ "use strict";

}
if (!node.nodes.length) {
if (!node.nodes?.length) {
const { parent } = node;

@@ -21,0 +21,0 @@ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const installer_js_1 = require("../lib/local-deps/installer.js");
const schematics_js_1 = require("../lib/schematics.js");
const migration_js_1 = require("./migration.js");
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
// 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)

@@ -10,9 +10,5 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports

exports.default = (options) => {
const skipInstallation = options?.skipInstallation ?? false;
return async (tree, context) => {
if (!skipInstallation) {
(0, installer_js_1.installLocalDependencies)(context);
}
await lf_schematic_context_1.currentSchematicContext.init(context, options);
const postCssScss = await Promise.resolve().then(() => require('../lib/local-deps/postcss-scss.js'));
const angularCompiler = await Promise.resolve().then(() => require('@angular/compiler'));
const { postcssSelectorParser } = await Promise.resolve().then(() => require('../lib/local-deps/postcss-selector-parser.js'));

@@ -27,6 +23,6 @@ tree.visit((path, entry) => {

if (path.endsWith('.html')) {
(0, schematics_js_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateHTMLFile)(content, angularCompiler));
(0, schematics_js_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateHTMLFile)(content));
}
if (path.endsWith('.ts')) {
(0, schematics_js_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateTsFile)(path, content, angularCompiler));
(0, schematics_js_1.migrateFile)(path, entry, tree, (content) => (0, migration_js_1.migrateTsFile)(path, content));
}

@@ -33,0 +29,0 @@ });

@@ -13,2 +13,3 @@ "use strict";

const mapping_js_1 = require("./mapping.js");
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
function migrateScssFile(content, postCssScss, postcssSelectorParser) {

@@ -19,14 +20,14 @@ const root = postCssScss.parse(content);

}
function migrateHTMLFile(content, angularCompiler) {
content = (0, html_ast_js_1.updateCssClassNames)(content, mapping_js_1.oldIconClassToNewIconClass, angularCompiler);
content = (0, angular_template_js_1.replaceComponentInput)('lu-icon', 'icon', mapping_js_1.oldIconToNewIcon, content, angularCompiler);
function migrateHTMLFile(content) {
content = (0, html_ast_js_1.updateCssClassNames)(content, mapping_js_1.oldIconClassToNewIconClass);
content = (0, angular_template_js_1.replaceComponentInput)('lu-icon', 'icon', mapping_js_1.oldIconToNewIcon, content);
return (0, file_update_js_1.updateContent)(content, (updates) => {
const htmlAst = new html_ast_js_1.HtmlAst(content, angularCompiler);
const htmlAst = new html_ast_js_1.HtmlAst(content);
htmlAst.visitElementWithAttribute(/.*/, 'class', (elem, attr) => {
const legacyIconText = attr.value.includes('lucca-icon') && elem.children.find((c) => c instanceof angularCompiler.TmplAstText && mapping_js_1.oldIcons.has(c.value));
if (attr.valueSpan && legacyIconText && legacyIconText instanceof angularCompiler.TmplAstText) {
const legacyIconText = attr.value.includes('lucca-icon') && elem.children.find((c) => c instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstText && mapping_js_1.oldIcons.has(c.value));
if (attr.valueSpan && legacyIconText && legacyIconText instanceof lf_schematic_context_1.currentSchematicContext.angularCompiler.TmplAstText) {
updates.push({
position: legacyIconText.sourceSpan.start.offset,
oldContent: legacyIconText.value,
newContent: '',
newContent: ''
});

@@ -36,3 +37,3 @@ updates.push({

oldContent: attr.value,
newContent: attr.value.replace('lucca-icon', 'lucca-icon ' + mapping_js_1.oldIconClassToNewIconClass['icon-' + legacyIconText.value]),
newContent: attr.value.replace('lucca-icon', 'lucca-icon ' + mapping_js_1.oldIconClassToNewIconClass['icon-' + legacyIconText.value])
});

@@ -43,3 +44,3 @@ }

}
function migrateTsFile(fileName, content, angularCompiler) {
function migrateTsFile(fileName, content) {
return (0, file_update_js_1.updateContent)(content, (updates) => {

@@ -51,3 +52,3 @@ const sourcefile = (0, typescript_1.createSourceFile)(fileName, content, typescript_1.ScriptTarget.ESNext);

oldContent: tpl.content,
newContent: migrateHTMLFile(tpl.content, angularCompiler),
newContent: migrateHTMLFile(tpl.content)
})));

@@ -54,0 +55,0 @@ updates.push(...(0, typescript_ast_js_1.replaceStringLiterals)(sourcefile, mapping_js_1.oldIconClassToNewIconClass));

{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontNewIcons",
"title": "Lucca Front New Icons Schema",
"type": "object",
"properties": {}
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontNewIcons",
"title": "Lucca Front New Icons Schema",
"type": "object",
"properties": {
"dryRun": {
"type": "boolean",
"description": "Run through the migration without making any changes.",
"default": false
},
"skipInstall": {
"type": "boolean",
"description": "Skip installing dependencies.",
"default": false
},
"verbose": {
"type": "boolean",
"description": "Enable verbose logging.",
"default": false
}
}
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const css_mapper_1 = require("../lib/css-mapper");
const installer_1 = require("../lib/local-deps/installer");
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
// 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)

@@ -9,7 +9,4 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports

exports.default = (options) => {
const skipInstallation = options?.skipInstallation ?? false;
return async (tree, context) => {
if (!skipInstallation) {
(0, installer_1.installLocalDependencies)(context);
}
await lf_schematic_context_1.currentSchematicContext.init(context, options);
await new css_mapper_1.CssMapper(tree, {

@@ -20,3 +17,3 @@ classes: {

'palette-secondary': 'palette-product',
'palette-lucca': 'palette-brand',
'palette-lucca': 'palette-brand'
},

@@ -28,5 +25,5 @@ variables: {

'--palettes-lucca-{val}': `--palettes-brand-{val}`,
'--colors-grey-{val}': `--colors-neutral-{val}`,
'--colors-grey-{val}': `--colors-neutral-{val}`
},
mixins: {},
mixins: {}
}, {

@@ -44,6 +41,6 @@ val: {

800: '800',
900: '900',
},
900: '900'
}
}).run();
};
};
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontPalettes",
"title": "Lucca Front Palettes Schema",
"type": "object",
"properties": {}
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontPalettes",
"title": "Lucca Front Palettes Schema",
"type": "object",
"properties": {
"dryRun": {
"type": "boolean",
"description": "Run through the migration without making any changes.",
"default": false
},
"skipInstall": {
"type": "boolean",
"description": "Skip installing dependencies.",
"default": false
},
"verbose": {
"type": "boolean",
"description": "Enable verbose logging.",
"default": false
}
}
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const css_mapper_1 = require("../lib/css-mapper");
const installer_1 = require("../lib/local-deps/installer");
const lf_schematic_context_1 = require("../lib/lf-schematic-context");
// 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)

@@ -9,7 +9,4 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports

exports.default = (options) => {
const skipInstallation = options?.skipInstallation ?? false;
return async (tree, context) => {
if (!skipInstallation) {
(0, installer_1.installLocalDependencies)(context);
}
await lf_schematic_context_1.currentSchematicContext.init(context, options);
await new css_mapper_1.CssMapper(tree, {

@@ -33,8 +30,8 @@ classes: {

'u-rowGap{tshirt}': 'pr-u-rowGap{tshirt}',
'u-columnGap{tshirt}': 'pr-u-columnGap{tshirt}',
'u-columnGap{tshirt}': 'pr-u-columnGap{tshirt}'
},
variables: {
'--spacings-{tshirt}': `--pr-t-spacings-{tshirt}`,
'--spacings-{tshirt}': `--pr-t-spacings-{tshirt}`
},
mixins: {},
mixins: {}
}, {

@@ -50,6 +47,6 @@ tshirt: {

XL: '600',
XXL: '800',
},
XXL: '800'
}
}).run();
};
};
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontTokensSpacing",
"title": "Lucca Front Tokens Spacing Schema",
"type": "object",
"properties": {}
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "LuccaFrontTokensSpacing",
"title": "Lucca Front Tokens Spacing Schema",
"type": "object",
"properties": {
"dryRun": {
"type": "boolean",
"description": "Run through the migration without making any changes.",
"default": false
},
"skipInstall": {
"type": "boolean",
"description": "Skip installing dependencies.",
"default": false
},
"verbose": {
"type": "boolean",
"description": "Enable verbose logging.",
"default": false
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet