Skip to content

Commit

Permalink
remove fs-extra because we don't need it
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed May 27, 2024
1 parent 4468e13 commit a7bd938
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const Blueprint = require('ember-cli/lib/models/blueprint');
const fs = require('fs-extra');
const fs = require('fs');
const { join } = require('path');
const emberCliUpdate = require('./lib/ember-cli-update');
const copyWithTemplate = require('./lib/copy-with-template');

const appBlueprint = Blueprint.lookup('app');

Expand Down Expand Up @@ -64,7 +65,7 @@ module.exports = {
);

let packageJson = join(options.target, 'package.json');
let json = await fs.readJSON(packageJson);
let json = JSON.parse(fs.readFileSync(packageJson));

json.scripts = {
...json.scripts,
Expand All @@ -73,7 +74,7 @@ module.exports = {
'test:ember': 'vite build --mode test && ember test --path dist',
};

await fs.writeFile(packageJson, JSON.stringify(json, null, 2));
fs.writeFileSync(packageJson, JSON.stringify(json, null, 2));

await emberCliUpdate({
projectDir: options.target,
Expand Down
47 changes: 24 additions & 23 deletions lib/ember-cli-update.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fs = require('fs-extra');
const fs = require('fs');
const { join } = require('path');

module.exports = async function ({
Expand All @@ -7,28 +7,29 @@ module.exports = async function ({
version,
options = [],
} = {}) {
fs.writeJSON(
fs.writeFileSync(
join(projectDir, 'config', 'ember-cli-update.json'),
{
schemaVersion: '1.0.0',
projectName,
packages: [
{
name: '@embroider/app-blueprint',
version,
blueprints: [
{
name: '@embroider/app-blueprint',
isBaseBlueprint: true,
// TODO pass more of the original options through
options: [`--package-manager ${options.packageManager}`],
},
],
},
],
},
{
spaces: 2,
},
JSON.stringify(
{
schemaVersion: '1.0.0',
projectName,
packages: [
{
name: '@embroider/app-blueprint',
version,
blueprints: [
{
name: '@embroider/app-blueprint',
isBaseBlueprint: true,
// TODO pass more of the original options through
options: [`--package-manager ${options.packageManager}`],
},
],
},
],
},
null,
{ spaces: 2 },
),
);
};

0 comments on commit a7bd938

Please sign in to comment.