Skip to content

Commit 8539e79

Browse files
committed
improve sort package.json, use super to build fileInfo
1 parent ae19d4d commit 8539e79

2 files changed

Lines changed: 7 additions & 17 deletions

File tree

index.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22

3-
const path = require('path');
43
const { sortPackageJson } = require('sort-package-json');
5-
const FileInfo = require('@ember-tooling/blueprint-model/utilities/file-info');
64

75
let date = new Date();
86

@@ -95,23 +93,14 @@ module.exports = {
9593
* _js_eslint.config.mjs is deleted
9694
* _ts_eslint.config.mjs is renamed to eslint.config.mjs
9795
*/
98-
buildFileInfo(intoDir, templateVariables, file, _commandOptions) {
99-
let mappedPath = this.mapFile(file, templateVariables);
100-
let options = {
101-
action: 'write',
102-
outputBasePath: path.normalize(intoDir),
103-
outputPath: path.join(intoDir, mappedPath),
104-
displayPath: path.normalize(mappedPath),
105-
inputPath: this.srcPath(file),
106-
templateVariables,
107-
ui: this.ui,
108-
};
96+
buildFileInfo(_intoDir, _templateVariables, file, _commandOptions) {
97+
let fileInfo = this._super.buildFileInfo.apply(this, arguments);
10998

11099
if (file in replacers) {
111-
options.replacer = replacers[file].bind(this);
100+
fileInfo.replacer = replacers[file].bind(this);
112101
}
113102

114-
return new FileInfo(options);
103+
return fileInfo;
115104
},
116105
};
117106

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"format": "prettier --write ."
1717
},
1818
"devDependencies": {
19-
"@ember-tooling/blueprint-model": "^0.3.0",
2019
"prettier": "^3.5.3",
21-
"release-plan": "^0.16.0",
20+
"release-plan": "^0.16.0"
21+
},
22+
"dependencies": {
2223
"sort-package-json": "^3.4.0"
2324
},
2425
"packageManager": "pnpm@10.6.5"

0 commit comments

Comments
 (0)