Skip to content

Commit

Permalink
Merge pull request #805 from xg-wang/monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Jan 29, 2021
2 parents c77780f + dcc4294 commit 9e0b053
Show file tree
Hide file tree
Showing 347 changed files with 2,363,988 additions and 479 deletions.
46 changes: 20 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,36 @@ on:
- cron: '0 6 * * 0'

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

strategy:
fail-fast: false
matrix:
node-version: ['10', '12', '14']
node-version: [14.x, 12.x, 10.x]
os: [ubuntu-latest, windows-latest]

steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: volta-cli/action@v1
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

# Remove test-packages folder so that we don't leak node_modules between apps
- name: Remove test-packages
run: |
rm -rf test-packages
- name: Yarn Install
working-directory: ./packages/ember-cli-fastboot
run: |
yarn install --ignore-engines --frozen-lockfile
- name: Run Mocha Tests
working-directory: ./packages/ember-cli-fastboot
run: |
volta install npm@4
npm --version
yarn test:mocha
run: yarn install --ignore-engines --frozen-lockfile
- name: Run ember-cli-fastboot Tests
run: yarn workspace ember-cli-fastboot test:ember
- name: Run fastboot Tests
if: ${{ matrix.os != 'windows-latest' }}
run: yarn workspace fastboot test
- name: Run fastboot-express-middleware Tests
run: yarn workspace fastboot-express-middleware test
- name: Run fastboot-app-server Tests
run: yarn workspace fastboot-app-server test:mocha

test-ember:
name: Ember Tests
integration-tests:
name: Integration Tests
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -70,9 +65,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Yarn Install
run: yarn install --ignore-engines --frozen-lockfile
- name: Run Tests
run: yarn workspace ember-cli-fastboot test:ember

- name: Integration Tests
run: yarn workspace integration-tests test

test-packages:
name: Test Packages
Expand Down
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[![npm version](https://badge.fury.io/js/ember-cli-fastboot.svg)](https://badge.fury.io/js/ember-cli-fastboot)
[![Actions Status](https://github.com/ember-fastboot/ember-cli-fastboot/workflows/CI/badge.svg)](https://github.com/ember-fastboot/ember-cli-fastboot/actions)

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

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

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

```
```sh
ember install ember-cli-fastboot
```

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

```
```sh
ember serve --environment production
```

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

```
```sh
ember serve --port 8088
```

Expand Down Expand Up @@ -72,11 +72,11 @@ module.exports = function(environment) {
}
```

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.
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.

### FastBoot App Server Configuration

When using FastBoot App Server for production environment you have to manually pass options from `config/fastboot.js` file.
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.

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

This looks like:

```html
.
.
<script type="fastboot/shoebox" id="shoebox-main-store">
{"data":[{"attributes":{"name":"AEC Professionals"},"id":106,"type":"audience"},
{"attributes":{"name":"Components"},"id":111,"type":"audience"},
Expand All @@ -371,8 +370,6 @@ This looks like:
{"attributes":{"name":"Staff"},"id":141,"type":"audience"},
{"attributes":{"name":"Students"},"id":146,"type":"audience"}]}
</script>
.
.
```

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

```
```js
export default class ApplicationAdapter extends JSONAPIAdapter.extend(
// ...snip...

Expand Down Expand Up @@ -448,6 +445,7 @@ export default class ApplicationAdapter extends JSONAPIAdapter.extend(
}
}
```
With this strategy, any time an ember-data `findRecord` request happens while in
Fastboot mode, the record will be put into the shoebox cache and returned. When
subsequent calls are made for that record in the hydrated application, it will
Expand Down
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "3.0.0-beta.2",
"version": "3.1.2",
"repository": {
"type": "git",
"url": "git@github.com:ember-fastboot/ember-cli-fastboot.git"
Expand All @@ -10,9 +10,9 @@
"test-packages/*"
],
"devDependencies": {
"release-it": "^14.0.2",
"release-it-lerna-changelog": "^2.4.0",
"release-it-yarn-workspaces": "^1.5.0"
"release-it": "^14.2.2",
"release-it-lerna-changelog": "^3.1.0",
"release-it-yarn-workspaces": "^2.0.0"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand All @@ -29,7 +29,8 @@
],
"additionalManifests": {
"versionUpdates": [
"package.json"
"package.json",
"test-packages/*/package.json"
],
"dependencyUpdates": [
"package.json",
Expand All @@ -46,5 +47,9 @@
"tokenRef": "GITHUB_AUTH"
},
"npm": false
},
"volta": {
"node": "12.19.0",
"yarn": "1.22.5"
}
}
3 changes: 3 additions & 0 deletions packages/ember-cli-fastboot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ember Cli FastBoot

See the [main readme](../../README.md) or http://ember-fastboot.com/ for more information.
13 changes: 6 additions & 7 deletions packages/ember-cli-fastboot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-cli-fastboot",
"version": "3.0.0-beta.2",
"version": "3.1.2",
"description": "Server-side rendering for Ember.js apps",
"keywords": [
"ember-addon"
Expand All @@ -14,7 +14,7 @@
},
"scripts": {
"build": "ember build",
"lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support tests",
"lint:js": "eslint ./*.js addon app fastboot config lib tests",
"release": "release-it",
"start": "ember serve",
"test": "mocha && ember test",
Expand All @@ -33,8 +33,8 @@
"ember-cli-lodash-subset": "2.0.1",
"ember-cli-preprocess-registry": "^3.1.2",
"ember-cli-version-checker": "^3.0.0",
"fastboot": "^3.1.1",
"fastboot-express-middleware": "^3.0.0",
"fastboot": "3.1.2",
"fastboot-express-middleware": "3.1.2",
"fastboot-transform": "^0.1.3",
"fs-extra": "^7.0.0",
"json-stable-stringify": "^1.0.1",
Expand All @@ -54,7 +54,6 @@
"ember-cli": "~3.3.0",
"ember-cli-addon-tests": "^0.11.1",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-eslint": "^4.2.3",
"ember-cli-htmlbars": "^3.0.0",
"ember-cli-htmlbars-inline-precompile": "^1.0.3",
"ember-cli-inject-live-reload": "^1.8.2",
Expand Down Expand Up @@ -93,7 +92,7 @@
]
},
"volta": {
"node": "12.18.2",
"yarn": "1.17.3"
"node": "12.19.0",
"yarn": "1.22.5"
}
}
2 changes: 2 additions & 0 deletions packages/fastboot-app-server/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/**
test/fixtures/**
22 changes: 22 additions & 0 deletions packages/fastboot-app-server/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';
module.exports = {
parserOptions: {
ecmaVersion: 2017,
},
extends: ['eslint:recommended', 'plugin:node/recommended'],
plugins: ['node'],
env: {
node: true,
es6: true,
},
overrides: [
{
files: ['test/**/*-test.js'],
env: {
mocha: true,
},
extends: ['plugin:mocha/recommended'],
plugins: ['mocha'],
},
]
};
24 changes: 24 additions & 0 deletions packages/fastboot-app-server/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile
- run: yarn test
2 changes: 2 additions & 0 deletions packages/fastboot-app-server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.eslintcache
2 changes: 2 additions & 0 deletions packages/fastboot-app-server/.mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// set the NODE_ENV to test if not already set, NODE_ENV=test changes the default worker count to 1
process.env.NODE_ENV = process.env.NODE_ENV || 'test';
6 changes: 6 additions & 0 deletions packages/fastboot-app-server/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.gitignore
.eslintcache
.eslintignore
.eslintrc.js
.travis.yml
test/
45 changes: 45 additions & 0 deletions packages/fastboot-app-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## v3.0.0 (2020-10-26)

#### :boom: Breaking Change
* [#124](https://github.com/ember-fastboot/fastboot-app-server/pull/124) Update FastBoot v3 ([@bobisjan](https://github.com/bobisjan))
* [#123](https://github.com/ember-fastboot/fastboot-app-server/pull/123) Drop Node 8 and 13 support ([@bobisjan](https://github.com/bobisjan))

#### :rocket: Enhancement
* [#120](https://github.com/ember-fastboot/fastboot-app-server/pull/120) Remove legacy Node.js support leftovers ([@bobisjan](https://github.com/bobisjan))
* [#96](https://github.com/ember-fastboot/fastboot-app-server/pull/96) Expose `distPath` on `reload` event ([@nathanhammond](https://github.com/nathanhammond))

#### :memo: Documentation
* [#49](https://github.com/ember-fastboot/fastboot-app-server/pull/49) Avoid `server.js` naming conflict ([@oskarrough](https://github.com/oskarrough))
* [#79](https://github.com/ember-fastboot/fastboot-app-server/pull/79) Adds notes to readme about overriding the workerCount ([@Duder-onomy](https://github.com/Duder-onomy))
* [#106](https://github.com/ember-fastboot/fastboot-app-server/pull/106) Add link to s3-notifier ([@allthesignals](https://github.com/allthesignals))
* [#115](https://github.com/ember-fastboot/fastboot-app-server/pull/115) Add link to fastboot-gcloud-storage-notifier in README ([@YoranBrondsema](https://github.com/YoranBrondsema))
* [#114](https://github.com/ember-fastboot/fastboot-app-server/pull/114) Add link to fastboot-gcloud-storage-downloader in README ([@YoranBrondsema](https://github.com/YoranBrondsema))
* [#122](https://github.com/ember-fastboot/fastboot-app-server/pull/122) Update README.md ([@wagenet](https://github.com/wagenet))

#### :house: Internal
* [#128](https://github.com/ember-fastboot/fastboot-app-server/pull/128) Update linting setup ([@rwjblue](https://github.com/rwjblue))
* [#129](https://github.com/ember-fastboot/fastboot-app-server/pull/129) Update mocha to latest. ([@rwjblue](https://github.com/rwjblue))
* [#127](https://github.com/ember-fastboot/fastboot-app-server/pull/127) Update dependencies to latest. ([@rwjblue](https://github.com/rwjblue))
* [#126](https://github.com/ember-fastboot/fastboot-app-server/pull/126) Migrate to GitHub Actions. ([@rwjblue](https://github.com/rwjblue))
* [#125](https://github.com/ember-fastboot/fastboot-app-server/pull/125) Add release automation. ([@rwjblue](https://github.com/rwjblue))
* [#121](https://github.com/ember-fastboot/fastboot-app-server/pull/121) Migrate to ESLint ([@bobisjan](https://github.com/bobisjan))

#### Committers: 8
- Greg Larrenaga ([@Duder-onomy](https://github.com/Duder-onomy))
- Jan Bobisud ([@bobisjan](https://github.com/bobisjan))
- Matt Gardner ([@allthesignals](https://github.com/allthesignals))
- Nathan Hammond ([@nathanhammond](https://github.com/nathanhammond))
- Oskar ([@oskarrough](https://github.com/oskarrough))
- Peter Wagenet ([@wagenet](https://github.com/wagenet))
- Robert Jackson ([@rwjblue](https://github.com/rwjblue))
- Yoran Brondsema ([@YoranBrondsema](https://github.com/YoranBrondsema))

### 1.1.2-beta.1

* Bump fastboot version to allow opting into rehydration.

### 1.1.0

* README updates
* Bumping version of `base-auth` to 2.0.0
* Bumping version of `fastboot` and `fastboot-express-middleware` to 1.1.0
9 changes: 9 additions & 0 deletions packages/fastboot-app-server/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2015

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 comments on commit 9e0b053

Please sign in to comment.