Skip to content

Commit

Permalink
Convert to Yarn workspace (#2184)
Browse files Browse the repository at this point in the history
* convert to yarn workspace

* ignore node_modules and bower_components in subfolders

* split application tests into separate app

* fix linting

* run CI on all workspaces

* cleanup scripts

* ignore compiled output in all packages

* remove unnecessary dependencies in test-app

* remove unnecessary dependencies from ember-simple-auth

* fix Procfiles

* cleanup test-app package.json

* remove greenkeeper config

* remove unnecessary dummy app config

* run lerna-changelog in project root

* fix diagrams task

* move npmignore into ember-simple-auth package

* removed guides from npmignore

…since that is now in a higher level folder

* fix client Procfile
  • Loading branch information
marcoow authored May 7, 2020
1 parent 6962969 commit 102712f
Show file tree
Hide file tree
Showing 271 changed files with 1,153 additions and 328 deletions.
13 changes: 0 additions & 13 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
/blueprints/*/files

# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/coverage/

Expand Down
49 changes: 45 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
name: Linting
runs-on: ubuntu-latest

strategy:
matrix:
workspace:
- ember-simple-auth
- test-app

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
Expand All @@ -35,22 +41,24 @@ jobs:
run: yarn install

- name: lint
run: yarn lint
run: yarn workspace ${{ matrix.workspace }} lint

tests:
name: Tests
runs-on: ubuntu-latest

strategy:
matrix:
workspace:
- ember-simple-auth
- test-app
test-suite:
- test:one ember-3.0
- test:one ember-lts-3.4
- test:one ember-lts-3.8
- test:one ember-lts-3.12
- test:one ember-release
- test:one ember-beta
- test:node
- test:one ember-canary
include:
- test-suite: "test:one ember-canary"
Expand All @@ -77,13 +85,19 @@ jobs:
run: yarn install

- name: tests
run: yarn ${{ matrix.test-suite }}
run: yarn workspace ${{ matrix.workspace }} ${{ matrix.test-suite }}
continue-on-error: ${{matrix.allow-failure}}

extra-tests:
name: Tests (Floating Dependenies)
runs-on: ubuntu-latest

strategy:
matrix:
workspace:
- ember-simple-auth
- test-app

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
Expand All @@ -105,5 +119,32 @@ jobs:
run: yarn install --no-lockfile

- name: tests
run: yarn test
run: yarn workspace ${{ matrix.workspace }} test
continue-on-error: true

node-tests:
name: Node Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10.x

- name: get yarn cache dir
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-test-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: install dependencies
run: yarn install

- name: tests
run: yarn workspace ember-simple-auth test:node
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
node-version: 12.x
registry-url: 'https://registry.npmjs.org'

- run: npm publish
- run: cd packages/ember-simple-auth && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
.DS_Store

# compiled output
/dist
/fastboot-dist
/tmp
dist
fastboot-dist
tmp

# dependencies
/node_modules
/bower_components
node_modules
bower_components

# misc
/.sass-cache
Expand Down
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

1 change: 1 addition & 0 deletions Procfile.client
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: yarn workspace test-app start:fastboot
1 change: 1 addition & 0 deletions Procfile.server
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: yarn workspace test-app start:demo-api
6 changes: 0 additions & 6 deletions guides/assets/esa-initial-flow.config.json

This file was deleted.

6 changes: 6 additions & 0 deletions guides/assets/esa-initial-flow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed guides/assets/esa-initial-flow.txt.png
Binary file not shown.
2 changes: 1 addition & 1 deletion guides/auth-torii-with-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ configuration and base classes. For GitHub specifically, the authentication flow
<access_token>` header request to, say, `https://api.github.com/user`,
which returns the GitHub user’s user info, at which point it can be matched to the app's own `User` model.

You can find a sequence diagram for the full flow [here](./assets/esa-initial-flow.txt.png).
You can find a sequence diagram for the full flow [here](./assets/esa-initial-flow.svg).

This guide assumes you know how to start an Ember app and are familiar with the various
files and concepts.
Expand Down
123 changes: 7 additions & 116 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,124 +1,15 @@
{
"name": "ember-simple-auth",
"version": "3.0.0",
"description": "A lightweight library for implementing authentication/authorization with Ember.js applications.",
"keywords": [
"ember-addon"
],
"license": "MIT",
"author": "simplabs GmbH",
"directories": {
"doc": "doc",
"test": "tests"
},
"private": true,
"repository": "https://github.com/simplabs/ember-simple-auth",
"scripts": {
"build": "ember build",
"changelog": "lerna-changelog",
"diagrams": "mermaid --sequenceConfig guides/assets/esa-initial-flow.config.json --width 2400 -o guides/assets guides/assets/esa-initial-flow.txt",
"lint": "eslint app addon blueprints config server tests *.js",
"start": "ember serve",
"start:fastboot": "NODE_ENV=production node fastboot-server.js",
"start:demo-api": "node server/demo-api.js",
"test": "ember test",
"test:all": "ember try:each",
"test:one": "ember try:one",
"test:fastboot": "ember fastboot:test",
"test:node": "mocha node-tests --recursive"
},
"dependencies": {
"base-64": "^0.1.0",
"broccoli-file-creator": "^2.0.0",
"broccoli-funnel": "^1.2.0 || ^2.0.0",
"broccoli-merge-trees": "^2.0.0 || ^3.0.0",
"ember-cli-babel": "^7.12.0",
"ember-cli-is-package-missing": "^1.0.0",
"ember-cookies": "^0.5.0",
"silent-error": "^1.0.0"
},
"devDependencies": {
"body-parser": "^1.19.0",
"bootstrap": "^4.3.1",
"broccoli-asset-rev": "^3.0.0",
"chai": "^4.1.0",
"cors": "^2.8.5",
"ember-ajax": "^5.0.0",
"ember-bootstrap": "~3.1.0",
"ember-cli": "~3.18.0",
"ember-cli-blueprint-test-helpers": "^0.19.2",
"ember-cli-chai": "^0.5.0",
"ember-cli-content-security-policy": "~1.1.1",
"ember-cli-dependency-checker": "^3.0.0",
"ember-cli-fastboot": "^2.2.1",
"ember-cli-htmlbars": "^5.0.0",
"ember-cli-htmlbars-inline-precompile": "^3.0.1",
"ember-cli-inject-live-reload": "^2.0.0",
"ember-cli-mocha": "^0.15.0-beta.1",
"ember-cli-pretender": "^3.0.0",
"ember-cli-shims": "^1.2.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-uglify": "^2.0.0",
"ember-cli-yuidoc": "^0.9.1",
"ember-data": "~3.18.0",
"ember-debug-handlers-polyfill": "^1.1.0",
"ember-disable-prototype-extensions": "^1.1.2",
"ember-engines": "^0.8.5",
"ember-export-application-global": "^2.0.0",
"ember-fastboot-addon-tests": "^0.5.0",
"ember-fetch": "^8.0.1",
"ember-load-initializers": "^2.0.0",
"ember-mocha": "^0.16.2",
"ember-resolver": "^8.0.0",
"ember-sinon": "~5.0.0",
"ember-source": "~3.18.0",
"ember-source-channel-url": "^1.1.0",
"ember-test-selectors": "^4.0.0",
"ember-try": "^1.1.0",
"eslint": "^5.16.0",
"eslint-config-simplabs": "^0.4.0",
"eslint-plugin-ember": "^8.1.1",
"eslint-plugin-mocha": "^6.1.1",
"eslint-plugin-node": "^11.0.0",
"express": "^4.17.1",
"fastboot-app-server": "^2.0.0",
"git-repo-version": "^1.0.0",
"glob": "^7.1.6",
"handlebars": "~4.7.1",
"lerna-changelog": "^1.0.0",
"loader.js": "^4.5.1",
"marked": "^1.0.0",
"mermaid": "^7.0.3",
"mocha": "^7.0.1",
"morgan": "^1.10.0",
"my-engine": "./tests/dummy/lib/my-engine",
"rimraf": "^3.0.0",
"sinon-chai": "~3.5.0",
"torii": "^0.10.0"
"diagrams": "mmdc -i guides/assets/esa-initial-flow.txt -o guides/assets/esa-initial-flow.svg"
},
"engines": {
"node": "10.* || >= 12.*"
},
"ember-addon": {
"configPath": "tests/dummy/config",
"versionCompatibility": {
"ember": ">=1.12"
}
},
"fastbootDependencies": [
"node-fetch"
"workspaces": [
"packages/*"
],
"greenkeeper": {
"ignore": [
"eslint-plugin-ember",
"eslint-plugin-mocha"
]
},
"resolutions": {
"@babel/plugin-transform-typescript": "~7.4.5",
"cssstyle": "~1.2.2",
"jsdom": "^11.10.0"
},
"peerDependencies": {
"ember-fetch": "^8.0.1"
"devDependencies": {
"@mermaid-js/mermaid-cli": "^8.4.8",
"lerna-changelog": "^1.0.1"
}
}
File renamed without changes.
15 changes: 15 additions & 0 deletions packages/ember-simple-auth/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/blueprints/*/files

# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# misc
/coverage/

# ember-try
/.node_modules.ember-try/
1 change: 0 additions & 1 deletion .eslintrc.js → packages/ember-simple-auth/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = {
{
files: [
'ember-cli-build.js',
'fastboot-server.js',
'index.js',
'testem.js',
'blueprints/utils.js',
Expand Down
1 change: 0 additions & 1 deletion .npmignore → packages/ember-simple-auth/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
/tmp
/fastboot-dist
/fastboot-tests
/guides
**/.gitkeep
.bowerrc
.editorconfig
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ var sourceTrees = [];
module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
storeConfigInMeta: true,
'ember-bootstrap': {
bootstrapVersion: 4,
importBootstrapFont: false,
importBootstrapCSS: true
},
fingerprint: {
generateAssetMap: EmberAddon.env() === 'production'
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 102712f

Please sign in to comment.