Skip to content

Commit 2e7a2dc

Browse files
mistrykaran91spike-rabbit
authored andcommitted
fix(schematics): update path imports for cross-platform compatibility and update mapping file
1 parent fe9fea5 commit 2e7a2dc

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

projects/element-ng/schematics/migrations/wizard-migration/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { Rule, SchematicContext, Tree, UpdateRecorder } from '@angular-devkit/schematics';
7-
import { join, dirname } from 'path';
7+
import { join, dirname } from 'path/posix';
88
import * as ts from 'typescript';
99

1010
import {

projects/element-ng/schematics/ts-import-to-siemens-migration/mappings/dashboards-ng-mappings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@ export const DASHBOARDS_NG_MAPPINGS: { [symbol: string]: string } = {
4949
'WidgetInstanceEditorWizard': '@siemens/dashboards-ng',
5050
'WidgetInstanceEditorWizardState': '@siemens/dashboards-ng',
5151
'WidgetPositionConfig': '@siemens/dashboards-ng',
52-
'SimplDashboardsNgModule': '@siemens/dashboards-ng'
52+
'SimplDashboardsNgModule': '@siemens/dashboards-ng',
53+
'SiWidgetStorage': '@siemens/dashboards-ng'
5354
};

projects/element-ng/schematics/utils/project-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
allWorkspaceTargets,
1010
getWorkspace
1111
} from '@schematics/angular/utility/workspace';
12-
import { dirname, isAbsolute, resolve } from 'path';
12+
import { dirname, isAbsolute, resolve } from 'path/posix';
1313

1414
import { parseTsconfigFile } from './ts-utils.js';
1515

projects/element-ng/schematics/utils/schematics-file-system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { normalize } from '@angular-devkit/core';
77
import { DirEntry, Tree } from '@angular-devkit/schematics';
8-
import { relative } from 'path';
8+
import { relative } from 'path/posix';
99

1010
export class SchematicsFileSystem {
1111
private readonly basePath = normalize(process.cwd());

projects/element-ng/schematics/utils/template-utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: MIT
44
*/
55
import { Tree, UpdateRecorder } from '@angular-devkit/schematics';
6-
import { join, dirname } from 'path';
6+
import { join, dirname } from 'path/posix';
77
import ts, { NoSubstitutionTemplateLiteral, PropertyAssignment, StringLiteral } from 'typescript';
88

99
import { findAttribute, findElement } from './html-utils.js';
@@ -199,7 +199,7 @@ export const renameElementTag = ({
199199
}: RenameElementTagParams): void => {
200200
getInlineTemplates(sourceFile).forEach(template =>
201201
renameElementTagInTemplate({
202-
template: template.text,
202+
template: sourceFile.text.substring(template.getStart() + 1, template.getEnd() - 1),
203203
offset: template.getStart() + 1,
204204
toName,
205205
fromName,
@@ -231,7 +231,7 @@ export const renameAttribute = ({
231231
}: RenameElementTagParams): void => {
232232
getInlineTemplates(sourceFile).forEach(template =>
233233
renameAttributeInTemplate({
234-
template: template.text,
234+
template: sourceFile.text.substring(template.getStart() + 1, template.getEnd() - 1),
235235
offset: template.getStart() + 1,
236236
toName,
237237
fromName,
@@ -270,7 +270,7 @@ export const renameApi = ({
270270
}): void => {
271271
getInlineTemplates(sourceFile).forEach(template =>
272272
renameApiInTemplate({
273-
template: template.text,
273+
template: sourceFile.text.substring(template.getStart() + 1, template.getEnd() - 1),
274274
offset: template.getStart() + 1,
275275
elementName,
276276
recorder,
@@ -311,7 +311,7 @@ export const removeSymbol = ({
311311
}): void => {
312312
getInlineTemplates(sourceFile).forEach(template =>
313313
removeSymbols({
314-
template: template.text,
314+
template: sourceFile.text.substring(template.getStart() + 1, template.getEnd() - 1),
315315
offset: template.getStart() + 1,
316316
elementName,
317317
attributeSelector,

projects/element-ng/schematics/utils/ts-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
import { normalize } from '@angular-devkit/core';
66
import { SchematicsException, Tree } from '@angular-devkit/schematics';
7-
import { isAbsolute } from 'path';
7+
import { isAbsolute } from 'path/posix';
88
import ts from 'typescript';
99

1010
import { ComponentNamesInstruction } from '../migrations/data/component-names.js';

0 commit comments

Comments
 (0)