Skip to content

Commit

Permalink
Support subfolders in common folder (DevExpress#1428)
Browse files Browse the repository at this point in the history
  • Loading branch information
const314 authored Jul 10, 2023
1 parent 8b9e6db commit 45188b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/devextreme-angular-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Developer Express Inc.",
"name": "devextreme-angular-generator",
"version": "2.1.0",
"version": "2.1.1",
"description": "Angular UI and visualization components based on DevExtreme widgets",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
import { join as joinPaths } from 'path';
import { join as joinPaths, dirname as getDirName } from 'path';
import { createTemplateFromString } from './dot-generator';

const render: (model: { module: string, reexports: string[] }) => string = createTemplateFromString(`
Expand All @@ -23,8 +23,10 @@ export default class CommonReexportsGenerator {
}
Object.keys(metadata.CommonReexports).forEach((key) => {
const targetFileName = key === commonTargetFolderName ? 'index.ts' : `${key.replace(`${commonTargetFolderName}/`, '')}.ts`;
const fullPath = joinPaths(commonPath, targetFileName);
mkdirSync(getDirName(fullPath), { recursive: true });
writeFileSync(
joinPaths(commonPath, targetFileName),
fullPath,
this.generateReexports(key, metadata.CommonReexports[key]),
{ encoding: 'utf8' },
);
Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"core-js": "^2.6.12",
"del": "^2.2.2",
"devextreme": "23.1-next",
"devextreme-angular-generator": "^2.1.0",
"devextreme-angular-generator": "^2.1.1",
"devextreme-internal-tools": "10.0.0-beta.17",
"gulp": "^4.0.2",
"gulp-header": "^1.8.12",
Expand Down

0 comments on commit 45188b1

Please sign in to comment.