Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/update/Update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export async function updateWorkspace(rootPath: string): Promise<boolean> {
case "webcomponents":
guideLink = "https://www.infragistics.com/products/ignite-ui-web-components/web-components/components/general-licensing";
logicFilesExtension = "ts";
styleExtensions = ["css", "scss", "sass"];
shouldUpgradeHTML = true;
break;
default:
Expand Down
31 changes: 27 additions & 4 deletions spec/unit/update-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,7 @@ export const GridComponent = () => {
([ "package.json" ], // root package.json
[], //index.html
[], // logic files
[], [], [], // for each style extension
[ "./project/package.json" ]); // inner package.json files
(fsSpy.readFile as jasmine.Spy).and.callFake((filePath: string) => {
if (filePath.indexOf("package.json") > -1) {
Expand All @@ -1127,7 +1128,7 @@ export const GridComponent = () => {
}
}));
expect(fsSpy.writeFile).toHaveBeenCalledTimes(2);
expect(fsSpy.glob).toHaveBeenCalledTimes(5);
expect(fsSpy.glob).toHaveBeenCalledTimes(8);
});

it("Should update import paths in files correctly", async () => {
Expand Down Expand Up @@ -1177,6 +1178,24 @@ import { ModuleManager } from '@infragistics/igniteui-webcomponents-core';
export default class App extends LitElement {
const title = 'igniteui-webcomponents example';
}`},
{
path: "src/styles.css",
content:
`@import "igniteui-webcomponents-grids/grids/themes/light/fluent.css";`,
expected:
`@import "@infragistics/igniteui-webcomponents-grids/grids/themes/light/fluent.css";`},
{
path: "src/app.scss",
content:
`@use "igniteui-webcomponents-grids/grids/themes/light/bootstrap.css";`,
expected:
`@use "@infragistics/igniteui-webcomponents-grids/grids/themes/light/bootstrap.css";`},
{
path: "src/app.sass",
content:
`@import "igniteui-webcomponents-grids/grids/themes/dark/material.css"`,
expected:
`@import "@infragistics/igniteui-webcomponents-grids/grids/themes/dark/material.css"`},
{
path: ".github/workflows/node.js.yml",
content:
Expand Down Expand Up @@ -1268,6 +1287,7 @@ export default class App extends LitElement {
([ "package.json" ], // root package.json
["index.html"], // html file
["src/app.ts"], // logic files
["src/styles.css"], ["src/app.scss"], ["src/app.sass"], // for each style extension
[]); // inner package.json files
(fsSpy.readFile as jasmine.Spy).and.callFake((filePath: string) => {
if (filePath.indexOf("package.json") > -1) {
Expand All @@ -1284,7 +1304,7 @@ export default class App extends LitElement {
for (const fileEntry of mockFileArray) {
expect((fsSpy.writeFile as jasmine.Spy)).toHaveBeenCalledWith(fileEntry.path, fileEntry.expected);
}
expect(fsSpy.glob).toHaveBeenCalledTimes(5);
expect(fsSpy.glob).toHaveBeenCalledTimes(8);
});

it("Should update package.json files from workspaces", async () => {
Expand Down Expand Up @@ -1381,8 +1401,10 @@ export default class App extends LitElement {
([ "package.json" ], // root package.json
[], //index.html
[], // projectA logic files
[], [], [], // projectA for each style extension
[ "./projectA/package.json" ], // projectA package.json
[], // projectB logic files
[], [], [], // projectB for each style extension
[ "./projectB/package.json" ]); // projectB package.json
(fsSpy.readFile as jasmine.Spy).and.callFake((filePath: string) => {
if (filePath.indexOf("package.json") < 0) {
Expand All @@ -1399,7 +1421,7 @@ export default class App extends LitElement {
for (const fileEntry of mockFileArray) {
expect((fsSpy.writeFile as jasmine.Spy)).toHaveBeenCalledWith(fileEntry.path, fileEntry.expected);
}
expect(fsSpy.glob).toHaveBeenCalledTimes(7);
expect(fsSpy.glob).toHaveBeenCalledTimes(13);
});

it("Should update vite.config.ts file correctly", async () => {
Expand Down Expand Up @@ -1474,6 +1496,7 @@ export default defineConfig(({ mode }) => {
([ "package.json" ], // root package.json
[], // html file
["src/app.ts"], // logic files
[], [], [], // for each style extension
[], // inner package.json files
["vite.config.ts"]); // vite config files
(fsSpy.readFile as jasmine.Spy).and.callFake((filePath: string) => {
Expand All @@ -1491,7 +1514,7 @@ export default defineConfig(({ mode }) => {
for (const fileEntry of mockFileArray) {
expect((fsSpy.writeFile as jasmine.Spy)).toHaveBeenCalledWith(fileEntry.path, fileEntry.expected);
}
expect(fsSpy.glob).toHaveBeenCalledTimes(5);
expect(fsSpy.glob).toHaveBeenCalledTimes(8);
});
});
});
Loading