Skip to content

Commit e4d0b7c

Browse files
authored
Merge pull request #821 from ember-fastboot/co-to-async
2 parents 2a6ed5d + 4dfb9e6 commit e4d0b7c

File tree

10 files changed

+47
-79
lines changed

10 files changed

+47
-79
lines changed

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"use strict";
2+
3+
module.exports = {
4+
singleQuote: true,
5+
printWidth: 100,
6+
trailingComma: "es5",
7+
};

packages/ember-cli-fastboot/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"chai": "^4.1.2",
5050
"chai-fs": "^2.0.0",
5151
"chai-string": "^1.4.0",
52-
"co": "^4.6.0",
5352
"ember-ajax": "^3.1.0",
5453
"ember-cli": "~3.3.0",
5554
"ember-cli-addon-tests": "^0.11.1",
@@ -92,7 +91,6 @@
9291
]
9392
},
9493
"volta": {
95-
"node": "12.19.0",
96-
"yarn": "1.22.5"
94+
"extends": "../../package.json"
9795
}
9896
}

packages/ember-cli-fastboot/test/new-package-json-test.js

Lines changed: 35 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -14,100 +14,82 @@ describe('FastbootConfig', function() {
1414
let subject;
1515
let project;
1616

17-
beforeEach(co.wrap(function* () {
18-
input = yield createTempDir();
17+
beforeEach(async function() {
18+
input = await createTempDir();
1919
project = {
20-
addons: [ ],
21-
pkg: { }
20+
addons: [],
21+
pkg: {},
2222
};
2323
subject = new FastbootConfig(input.path(), {
2424
project,
2525
outputPaths: {
2626
app: { js: 'app.js' },
27-
vendor: { js: 'vendor.js' }
27+
vendor: { js: 'vendor.js' },
2828
},
2929
appConfig: {
30-
modulePrefix: 'app'
31-
}
30+
modulePrefix: 'app',
31+
},
3232
});
3333
output = createBuilder(subject);
34-
}));
34+
});
3535

36-
afterEach(co.wrap(function* () {
37-
yield input.dispose();
38-
yield output.dispose();
39-
}));
36+
afterEach(async function() {
37+
await input.dispose();
38+
await output.dispose();
39+
});
4040

41-
it('it builds only when information changes', co.wrap(function* () {
41+
it('it builds only when information changes', async function() {
4242
input.write({
4343
'index.js': `export { A } from "./lib/a";`,
44-
'lib': {
44+
lib: {
4545
'a.js': `export class A {};`,
4646
'b.js': `export class B {};`,
47-
'c.js': `export class C {};`
48-
}
47+
'c.js': `export class C {};`,
48+
},
4949
});
5050

51-
yield output.build();
51+
await output.build();
5252

53-
expect(
54-
output.read()
55-
).to.deep.equal({
56-
'package.json': `{"dependencies":{},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleWhitelist":[],"schemaVersion":3}}`
53+
expect(output.read()).to.deep.equal({
54+
'package.json': `{"dependencies":{},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleWhitelist":[],"schemaVersion":3}}`,
5755
});
5856

59-
yield output.build();
57+
await output.build();
6058

61-
expect(
62-
output.changes()
63-
).to.deep.equal({ });
59+
expect(output.changes()).to.deep.equal({});
6460

65-
project.pkg.fastbootDependencies = [
66-
'apple',
67-
'orange'
68-
];
61+
project.pkg.fastbootDependencies = ['apple', 'orange'];
6962

7063
project.pkg.dependencies = {
7164
apple: '*',
7265
orange: '^1.0.0',
73-
pizza: '^1.0.0'
66+
pizza: '^1.0.0',
7467
};
7568

76-
yield output.build();
69+
await output.build();
7770

78-
expect(
79-
output.changes()
80-
).to.deep.equal({
81-
'package.json': 'change'
71+
expect(output.changes()).to.deep.equal({
72+
'package.json': 'change',
8273
});
8374

84-
expect(
85-
output.read()
86-
).to.deep.equal({
87-
'package.json': `{"dependencies":{"apple":"*","orange":"^1.0.0"},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleWhitelist":["apple","orange"],"schemaVersion":3}}`
75+
expect(output.read()).to.deep.equal({
76+
'package.json': `{"dependencies":{"apple":"*","orange":"^1.0.0"},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleWhitelist":["apple","orange"],"schemaVersion":3}}`,
8877
});
8978

90-
project.pkg.fastbootDependencies = [
91-
'apple',
92-
'orange'
93-
];
79+
project.pkg.fastbootDependencies = ['apple', 'orange'];
9480

9581
project.pkg.dependencies.pizza = '^3.0.0';
9682

97-
yield output.build();
83+
await output.build();
9884

99-
expect(
100-
output.changes()
101-
).to.deep.equal({ });
85+
expect(output.changes()).to.deep.equal({});
10286

10387
project.pkg.dependencies.apple = '^3.0.0';
10488

105-
yield output.build();
89+
await output.build();
10690

107-
expect(
108-
output.read()
109-
).to.deep.equal({
110-
'package.json': `{"dependencies":{"apple":"^3.0.0","orange":"^1.0.0"},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleWhitelist":["apple","orange"],"schemaVersion":3}}`
91+
expect(output.read()).to.deep.equal({
92+
'package.json': `{"dependencies":{"apple":"^3.0.0","orange":"^1.0.0"},"fastboot":{"appName":"app","config":{"app":{"modulePrefix":"app"}},"manifest":{"appFiles":["app.js","app-fastboot.js"],"htmlFile":"index.html","vendorFiles":["vendor.js"]},"moduleWhitelist":["apple","orange"],"schemaVersion":3}}`,
11193
});
112-
}));
94+
});
11395
});

packages/fastboot-app-server/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
"node": "10.* || 12.* || >= 14"
4848
},
4949
"volta": {
50-
"node": "12.19.0",
51-
"yarn": "1.22.5"
50+
"extends": "../../package.json"
5251
},
5352
"publishConfig": {
5453
"registry": "https://registry.npmjs.org"

packages/fastboot-express-middleware/.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/fastboot-express-middleware/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
"node": "10.* || 12.* || >= 14"
4848
},
4949
"volta": {
50-
"node": "12.19.0",
51-
"yarn": "1.22.5"
50+
"extends": "../../package.json"
5251
},
5352
"publishConfig": {
5453
"registry": "https://registry.npmjs.org"

packages/fastboot/.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/fastboot/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
"node": "10.* || >=12"
6060
},
6161
"volta": {
62-
"node": "12.19.0",
63-
"yarn": "1.22.5"
62+
"extends": "../../package.json"
6463
},
6564
"publishConfig": {
6665
"registry": "https://registry.npmjs.org"

test-packages/integration-tests/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"mocha": "^8.2.1"
1313
},
1414
"volta": {
15-
"node": "12.19.0",
16-
"yarn": "1.22.5"
15+
"extends": "../../package.json"
1716
}
1817
}

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5549,11 +5549,6 @@ clone@^2.0.0, clone@^2.1.2:
55495549
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"
55505550
integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=
55515551

5552-
co@^4.6.0:
5553-
version "4.6.0"
5554-
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
5555-
integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=
5556-
55575552
code-point-at@^1.0.0:
55585553
version "1.1.0"
55595554
resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"

0 commit comments

Comments
 (0)