Skip to content

Commit 9e0b053

Browse files
author
Robert Jackson
authored
Merge pull request #805 from xg-wang/monorepo
2 parents c77780f + dcc4294 commit 9e0b053

File tree

347 files changed

+2363988
-479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+2363988
-479
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,36 @@ on:
1919
- cron: '0 6 * * 0'
2020

2121
jobs:
22-
test-legacy-mocha:
23-
name: Legacy Mocha Tests - ${{ matrix.node-version }}
24-
runs-on: ubuntu-latest
22+
test-all-packages:
23+
name: Ember Tests
24+
runs-on: ${{ matrix.os }}
2525

2626
strategy:
27-
fail-fast: false
2827
matrix:
29-
node-version: ['10', '12', '14']
28+
node-version: [14.x, 12.x, 10.x]
29+
os: [ubuntu-latest, windows-latest]
3030

3131
steps:
3232
- name: Checkout Code
3333
uses: actions/checkout@v2
3434
- name: Use Node.js ${{ matrix.node-version }}
35-
uses: volta-cli/action@v1
35+
uses: actions/setup-node@v1
3636
with:
3737
node-version: ${{ matrix.node-version }}
38-
39-
# Remove test-packages folder so that we don't leak node_modules between apps
40-
- name: Remove test-packages
41-
run: |
42-
rm -rf test-packages
4338
- name: Yarn Install
44-
working-directory: ./packages/ember-cli-fastboot
45-
run: |
46-
yarn install --ignore-engines --frozen-lockfile
47-
- name: Run Mocha Tests
48-
working-directory: ./packages/ember-cli-fastboot
49-
run: |
50-
volta install npm@4
51-
npm --version
52-
yarn test:mocha
53-
39+
run: yarn install --ignore-engines --frozen-lockfile
40+
- name: Run ember-cli-fastboot Tests
41+
run: yarn workspace ember-cli-fastboot test:ember
42+
- name: Run fastboot Tests
43+
if: ${{ matrix.os != 'windows-latest' }}
44+
run: yarn workspace fastboot test
45+
- name: Run fastboot-express-middleware Tests
46+
run: yarn workspace fastboot-express-middleware test
47+
- name: Run fastboot-app-server Tests
48+
run: yarn workspace fastboot-app-server test:mocha
5449

55-
test-ember:
56-
name: Ember Tests
50+
integration-tests:
51+
name: Integration Tests
5752
runs-on: ${{ matrix.os }}
5853

5954
strategy:
@@ -70,9 +65,8 @@ jobs:
7065
node-version: ${{ matrix.node-version }}
7166
- name: Yarn Install
7267
run: yarn install --ignore-engines --frozen-lockfile
73-
- name: Run Tests
74-
run: yarn workspace ember-cli-fastboot test:ember
75-
68+
- name: Integration Tests
69+
run: yarn workspace integration-tests test
7670

7771
test-packages:
7872
name: Test Packages

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
[![npm version](https://badge.fury.io/js/ember-cli-fastboot.svg)](https://badge.fury.io/js/ember-cli-fastboot)
44
[![Actions Status](https://github.com/ember-fastboot/ember-cli-fastboot/workflows/CI/badge.svg)](https://github.com/ember-fastboot/ember-cli-fastboot/actions)
55

6-
An Ember CLI addon that allows you to render and serve Ember.js apps on
7-
the server. Using FastBoot, you can serve rendered HTML to browsers and
6+
FastBoot allows you to render and serve Ember.js apps on the server.
7+
Using FastBoot, you can serve rendered HTML to browsers and
88
other clients without requiring them to download JavaScript assets.
99

1010
Currently, the set of Ember applications supported is extremely limited.
@@ -20,7 +20,7 @@ FastBoot requires Ember 2.3 or higher. It is also preferable that your app is ru
2020

2121
From within your Ember CLI application, run the following command:
2222

23-
```
23+
```sh
2424
ember install ember-cli-fastboot
2525
```
2626

@@ -35,13 +35,13 @@ You may be shocked to learn that minified code runs faster in Node than
3535
non-minified code, so you will probably want to run the production
3636
environment build for anything "serious."
3737

38-
```
38+
```sh
3939
ember serve --environment production
4040
```
4141

4242
You can also specify the port (default is 4200):
4343

44-
```
44+
```sh
4545
ember serve --port 8088
4646
```
4747

@@ -72,11 +72,11 @@ module.exports = function(environment) {
7272
}
7373
```
7474

75-
There are several options available, see FastBoot's [README](https://github.com/ember-fastboot/fastboot/tree/v2.0.3#usage) for more information, but be aware that `distPath` is provided internally by `ember-cli-fastboot`, hence it can not be modified by this file.
75+
There are several options available, see FastBoot's [README](./packages/fastboot/#usage) for more information, but be aware that `distPath` is provided internally by `ember-cli-fastboot`, hence it can not be modified by this file.
7676

7777
### FastBoot App Server Configuration
7878

79-
When using FastBoot App Server for production environment you have to manually pass options from `config/fastboot.js` file.
79+
When using [FastBoot App Server](./packages/fastboot-app-server/README.md) for production environment you have to manually pass options from `config/fastboot.js` file.
8080

8181
```js
8282
const FastBootAppServer = require('fastboot-app-server');
@@ -360,9 +360,8 @@ The contents of the Shoebox are written to the HTML as strings within
360360
consumed by the browser rendered application.
361361

362362
This looks like:
363+
363364
```html
364-
.
365-
.
366365
<script type="fastboot/shoebox" id="shoebox-main-store">
367366
{"data":[{"attributes":{"name":"AEC Professionals"},"id":106,"type":"audience"},
368367
{"attributes":{"name":"Components"},"id":111,"type":"audience"},
@@ -371,8 +370,6 @@ This looks like:
371370
{"attributes":{"name":"Staff"},"id":141,"type":"audience"},
372371
{"attributes":{"name":"Students"},"id":146,"type":"audience"}]}
373372
</script>
374-
.
375-
.
376373
```
377374

378375
You can add items into the shoebox with `shoebox.put`, and you can retrieve
@@ -415,7 +412,7 @@ Shoebox gives you great capabilities, but using it in the real app is pretty rou
415412
One way to abstract the shoebox data storage mechanics is to move the logic into
416413
the Application Adapter as shown below.
417414

418-
```
415+
```js
419416
export default class ApplicationAdapter extends JSONAPIAdapter.extend(
420417
// ...snip...
421418

@@ -448,6 +445,7 @@ export default class ApplicationAdapter extends JSONAPIAdapter.extend(
448445
}
449446
}
450447
```
448+
451449
With this strategy, any time an ember-data `findRecord` request happens while in
452450
Fastboot mode, the record will be put into the shoebox cache and returned. When
453451
subsequent calls are made for that record in the hydrated application, it will

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "3.0.0-beta.2",
3+
"version": "3.1.2",
44
"repository": {
55
"type": "git",
66
"url": "git@github.com:ember-fastboot/ember-cli-fastboot.git"
@@ -10,9 +10,9 @@
1010
"test-packages/*"
1111
],
1212
"devDependencies": {
13-
"release-it": "^14.0.2",
14-
"release-it-lerna-changelog": "^2.4.0",
15-
"release-it-yarn-workspaces": "^1.5.0"
13+
"release-it": "^14.2.2",
14+
"release-it-lerna-changelog": "^3.1.0",
15+
"release-it-yarn-workspaces": "^2.0.0"
1616
},
1717
"publishConfig": {
1818
"registry": "https://registry.npmjs.org"
@@ -29,7 +29,8 @@
2929
],
3030
"additionalManifests": {
3131
"versionUpdates": [
32-
"package.json"
32+
"package.json",
33+
"test-packages/*/package.json"
3334
],
3435
"dependencyUpdates": [
3536
"package.json",
@@ -46,5 +47,9 @@
4647
"tokenRef": "GITHUB_AUTH"
4748
},
4849
"npm": false
50+
},
51+
"volta": {
52+
"node": "12.19.0",
53+
"yarn": "1.22.5"
4954
}
5055
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ember Cli FastBoot
2+
3+
See the [main readme](../../README.md) or http://ember-fastboot.com/ for more information.

packages/ember-cli-fastboot/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ember-cli-fastboot",
3-
"version": "3.0.0-beta.2",
3+
"version": "3.1.2",
44
"description": "Server-side rendering for Ember.js apps",
55
"keywords": [
66
"ember-addon"
@@ -14,7 +14,7 @@
1414
},
1515
"scripts": {
1616
"build": "ember build",
17-
"lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support tests",
17+
"lint:js": "eslint ./*.js addon app fastboot config lib tests",
1818
"release": "release-it",
1919
"start": "ember serve",
2020
"test": "mocha && ember test",
@@ -33,8 +33,8 @@
3333
"ember-cli-lodash-subset": "2.0.1",
3434
"ember-cli-preprocess-registry": "^3.1.2",
3535
"ember-cli-version-checker": "^3.0.0",
36-
"fastboot": "^3.1.1",
37-
"fastboot-express-middleware": "^3.0.0",
36+
"fastboot": "3.1.2",
37+
"fastboot-express-middleware": "3.1.2",
3838
"fastboot-transform": "^0.1.3",
3939
"fs-extra": "^7.0.0",
4040
"json-stable-stringify": "^1.0.1",
@@ -54,7 +54,6 @@
5454
"ember-cli": "~3.3.0",
5555
"ember-cli-addon-tests": "^0.11.1",
5656
"ember-cli-dependency-checker": "^3.2.0",
57-
"ember-cli-eslint": "^4.2.3",
5857
"ember-cli-htmlbars": "^3.0.0",
5958
"ember-cli-htmlbars-inline-precompile": "^1.0.3",
6059
"ember-cli-inject-live-reload": "^1.8.2",
@@ -93,7 +92,7 @@
9392
]
9493
},
9594
"volta": {
96-
"node": "12.18.2",
97-
"yarn": "1.17.3"
95+
"node": "12.19.0",
96+
"yarn": "1.22.5"
9897
}
9998
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/**
2+
test/fixtures/**
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
module.exports = {
3+
parserOptions: {
4+
ecmaVersion: 2017,
5+
},
6+
extends: ['eslint:recommended', 'plugin:node/recommended'],
7+
plugins: ['node'],
8+
env: {
9+
node: true,
10+
es6: true,
11+
},
12+
overrides: [
13+
{
14+
files: ['test/**/*-test.js'],
15+
env: {
16+
mocha: true,
17+
},
18+
extends: ['plugin:mocha/recommended'],
19+
plugins: ['mocha'],
20+
},
21+
]
22+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [10.x, 12.x, 14.x]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- run: yarn install --frozen-lockfile
24+
- run: yarn test
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.eslintcache
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// set the NODE_ENV to test if not already set, NODE_ENV=test changes the default worker count to 1
2+
process.env.NODE_ENV = process.env.NODE_ENV || 'test';

0 commit comments

Comments
 (0)