Skip to content

drop rsvp and fs-extra dependencies #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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 .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
/node-tests
7 changes: 3 additions & 4 deletions blueprints/ember-bootstrap-power-select/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-env node */
'use strict';

const rsvp = require('rsvp');
const fs = require('fs-extra');
const fs = require('node:fs');
const fsPromises = require('node:fs/promises');
const path = require('path');
const writeFile = rsvp.denodeify(fs.writeFile);
const BuildConfigEditor = require('ember-cli-build-config-editor');
const chalk = require('chalk');

Expand Down Expand Up @@ -54,7 +53,7 @@ module.exports = {
});
} else {
this.ui.writeLine(`Created ${file}`);
return writeFile(file, importStatement);
return fsPromises.writeFile(file, importStatement);
}
},

Expand Down
45 changes: 45 additions & 0 deletions node-tests/blueprints/ember-bootstrap-power-select-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* eslint-env node, mocha */
const {
setupTestHooks,
emberNew,
emberGenerate,
emberDestroy,
modifyPackages,
} = require('ember-cli-blueprint-test-helpers/helpers');

const { expect, file } = require('ember-cli-blueprint-test-helpers/chai');

describe('Acceptance: ember generate and destroy ember-bootstrap-power-select', function () {
// create and destroy temporary working directories
setupTestHooks(this);

it('ember-bootstrap-power-select foo', function () {
const args = ['ember-bootstrap-power-select', 'foo'];

// create a new Ember.js app in the working directory
return emberNew()
.then(() => emberGenerate(args))
.then(() => {
expect(file('ember-cli-build.js')).to.contain('ember-power-select');
})
.then(() => emberDestroy(args));
});
});

describe('Acceptance: ember generate and destroy ember-bootstrap-power-select with style preprocessor', function () {
setupTestHooks(this);

it('ember-bootstrap-power-select foo with style preprocessor', function () {
const args = ['ember-bootstrap-power-select', 'foo'];

return emberNew()
.then(() => modifyPackages([{ name: 'ember-cli-sass' }]))
.then(() => emberGenerate(args))
.then(() => {
expect(file('app/styles/app.scss')).to.contain(
'ember-power-select/themes/bootstrap'
);
})
.then(() => emberDestroy(args));
});
});
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
"start": "ember server",
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each"
"test:ember-compatibility": "ember try:each",
"test:blueprint": "mocha node-tests --recursive"
},
"dependencies": {
"chalk": "^5.0.0",
"chalk": "^4.1.2",
"ember-cli-babel": "^7.26.11",
"ember-cli-build-config-editor": "^0.5.0",
"ember-cli-htmlbars": "^6.2.0",
"fs-extra": "^11.0.0",
"rsvp": "^4.0.1"
"ember-cli-htmlbars": "^6.2.0"
},
"devDependencies": {
"@ember/optional-features": "2.0.0",
Expand All @@ -49,6 +48,7 @@
"ember-auto-import": "2.6.3",
"ember-bootstrap": "5.1.1",
"ember-cli": "4.12.1",
"ember-cli-blueprint-test-helpers": "^0.19.2",
"ember-cli-dependency-checker": "3.3.1",
"ember-cli-inject-live-reload": "2.1.0",
"ember-cli-sri": "2.1.1",
Expand All @@ -69,6 +69,7 @@
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-qunit": "7.3.4",
"loader.js": "4.7.0",
"mocha": "^5.0.0",
"prettier": "2.8.8",
"qunit": "2.19.4",
"qunit-dom": "2.0.0",
Expand Down
Loading