Skip to content

Commit

Permalink
feat: move to monorepo structure with multiple packages
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This will completely change the way ember-caluma is
used. A migration guide will be added in time.
  • Loading branch information
anehx committed Sep 9, 2021
1 parent 020b1bf commit 676df5f
Show file tree
Hide file tree
Showing 761 changed files with 5,392 additions and 4,803 deletions.
27 changes: 16 additions & 11 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# unconventional js
/blueprints/*/files/
/vendor/
**/blueprints/*/*files/
**/vendor/

# compiled output
/dist/
/tmp/
**/dist/
**/tmp/

# dependencies
/bower_components/
/node_modules/
**/bower_components/
**/node_modules/

# misc
/coverage/
**/coverage/
!.*
/.yarn/
/.git/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
**/.node_modules.ember-try/
**/bower.json.ember-try
**/package.json.ember-try

# ember-cli-addon-docs
/tests/dummy/app/snippets/
packages/-ember-caluma/app/snippets/

# TODO remove
packages/-ember-caluma/testem.browserstack.js
51 changes: 42 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
"use strict";

module.exports = {
extends: "@adfinis-sygroup/eslint-config/ember-addon",
root: true,
parser: "babel-eslint",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ["ember"],
extends: "@adfinis-sygroup/eslint-config",
env: {
es6: true,
browser: true,
},
rules: {
"ember/no-jquery": "error",
// TODO: https://github.com/projectcaluma/ember-caluma/issues/529
Expand All @@ -17,12 +31,30 @@ module.exports = {
"ember/no-component-lifecycle-hooks": "warn",
},
settings: {
"import/internal-regex": "^ember-caluma/",
"import/internal-regex": "^(@projectcaluma|ember-caluma)/",
},
overrides: [
...require("@adfinis-sygroup/eslint-config/ember-addon").overrides,
// node files
{
files: ["bin/*.js", "testem*.js"],
files: [
".eslintrc.js",
".prettierrc.js",
".template-lintrc.js",
"config/*.js",
"packages/*/ember-cli-build.js",
"packages/*/index.js",
"packages/*/testem*.js",
"packages/*/blueprints/**/index.js",
"packages/*/config/*.js",
"packages/*/tests/dummy/config/*.js",
"packages/*/bin/*.js",
],
excludedFiles: [
"packages/*/addon/**",
"packages/*/addon-test-support/**",
"packages/*/app/**",
"packages/*/tests/dummy/app/**",
],
parserOptions: {
sourceType: "script",
},
Expand All @@ -31,11 +63,12 @@ module.exports = {
node: true,
},
plugins: ["node"],
rules: Object.assign(
{},
require("eslint-plugin-node").configs.recommended.rules,
{ "prefer-const": ["error"] }
),
extends: ["plugin:node/recommended"],
},
{
// Test files:
files: ["packages/*/tests/**/*-test.{js,ts}"],
extends: ["plugin:qunit/recommended"],
},
],
};
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
- uses: actions/cache@v2
with:
path: node_modules
key: node-modules-v2-${{ hashFiles('yarn.lock') }}
key: node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
node-modules-v2-${{ hashFiles('yarn.lock') }}
node-modules-v2-
node-modules-${{ hashFiles('yarn.lock') }}
node-modules-
- name: Install Dependencies
run: yarn install

- name: Deploy to Github Pages
run: yarn ember deploy production
run: yarn workspace ember-caluma ember deploy production
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
ADDON_DOCS_VERSION_PATH: ${GITHUB_REF#refs/heads/}
ADDON_DOCS_UPDATE_LATEST: "true"
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- uses: actions/cache@v2
with:
path: node_modules
key: node-modules-v2-${{ hashFiles('yarn.lock') }}
key: node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
node-modules-v2-${{ hashFiles('yarn.lock') }}
node-modules-v2-
node-modules-${{ hashFiles('yarn.lock') }}
node-modules-
- name: Install dependencies
run: yarn install
Expand Down
72 changes: 49 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
- uses: actions/cache@v2
with:
path: node_modules
key: node-modules-v2-${{ hashFiles('yarn.lock') }}
key: node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
node-modules-v2-${{ hashFiles('yarn.lock') }}
node-modules-v2-
node-modules-${{ hashFiles('yarn.lock') }}
node-modules-
- name: Install dependencies
run: yarn install
Expand All @@ -47,6 +47,15 @@ jobs:
runs-on: [ubuntu-latest]
timeout-minutes: 10

strategy:
matrix:
workspace:
- "@projectcaluma/ember-core"
- "@projectcaluma/ember-form"
- "@projectcaluma/ember-form-builder"
- "@projectcaluma/ember-testing"
- "@projectcaluma/ember-workflow"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand All @@ -56,30 +65,39 @@ jobs:
- uses: actions/cache@v2
with:
path: node_modules
key: node-modules-v2-${{ hashFiles('yarn.lock') }}
key: node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
node-modules-v2-${{ hashFiles('yarn.lock') }}
node-modules-v2-
node-modules-${{ hashFiles('yarn.lock') }}
node-modules-
- name: Install dependencies
run: yarn install

- name: Run tests
run: yarn test:ember
env:
COVERAGE: true
run: yarn workspace ${{ matrix.workspace }} test:ember
# env:
# COVERAGE: true

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage/lcov.info
# - name: Upload coverage report to Codecov
# uses: codecov/codecov-action@v1
# with:
# file: ./coverage/lcov.info

test-floating:
name: Floating Tests
needs: [lint]
runs-on: [ubuntu-latest]
timeout-minutes: 10

strategy:
matrix:
workspace:
- "@projectcaluma/ember-core"
- "@projectcaluma/ember-form"
- "@projectcaluma/ember-form-builder"
- "@projectcaluma/ember-testing"
- "@projectcaluma/ember-workflow"

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand All @@ -90,7 +108,7 @@ jobs:
run: yarn install --no-lockfile

- name: Run tests
run: yarn test:ember
run: yarn workspace ${{ matrix.workspace }} test:ember

# test-browserstack:
# name: Browserstack Tests
Expand Down Expand Up @@ -144,8 +162,16 @@ jobs:

strategy:
matrix:
workspace:
- "@projectcaluma/ember-core"
- "@projectcaluma/ember-form"
- "@projectcaluma/ember-form-builder"
- "@projectcaluma/ember-testing"
- "@projectcaluma/ember-workflow"
scenario:
- ember-lts-3.24
# We are a bit early to adopt this but we need to since ember-try has
# a problem with workspaces and LTS 3.24
- ember-lts-3.28
- ember-release

steps:
Expand All @@ -157,10 +183,10 @@ jobs:
- uses: actions/cache@v2
with:
path: node_modules
key: node-modules-v2-${{ hashFiles('yarn.lock') }}
key: node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
node-modules-v2-${{ hashFiles('yarn.lock') }}
node-modules-v2-
node-modules-${{ hashFiles('yarn.lock') }}
node-modules-
- name: Install dependencies
run: yarn install
Expand All @@ -171,11 +197,11 @@ jobs:
node-modules
package
yarn.lock
key: node-modules-v2-${{ matrix.scenario }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('config/ember-try.js') }}
key: node-modules-${{ matrix.scenario }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('config/ember-try.js') }}
restore-keys: |
node-modules-v2-${{ matrix.scenario }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('config/ember-try.js') }}
node-modules-v2-${{ matrix.scenario }}-
node-modules-v2-
node-modules-${{ matrix.scenario }}-${{ hashFiles('yarn.lock') }}-${{ hashFiles('config/ember-try.js') }}
node-modules-${{ matrix.scenario }}-
node-modules-
- name: Run tests
run: yarn ember try:one ${{ matrix.scenario }} --skip-cleanup
run: yarn workspace ${{ matrix.workspace }} ember try:one ${{ matrix.scenario }} --skip-cleanup
33 changes: 17 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/
dist/
tmp/

# dependencies
/bower_components/
/node_modules/
bower_components/
node_modules/

# misc
/.sass-cache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log
*.swp
*.swo
.env*
.pnp*
.sass-cache
.eslintcache
connect.lock
coverage/
libpeerconnection.log
npm-debug.log*
testem.log
yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
9 changes: 9 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# TODOs after the monorepo migration:

- [ ] Test coverage
- [ ] Browserstack tests
- [ ] Update all documentation and installation guides
- [ ] Write migration guide from v8.x to v9.x
- [ ] Initial release of @projectcaluma/ember-xy packages
- [ ] Automated releasing with semantic-release
- [ ] Dependabot config
9 changes: 0 additions & 9 deletions addon/gql/mutations/save-default-date-answer.graphql

This file was deleted.

9 changes: 0 additions & 9 deletions addon/gql/mutations/save-default-float-answer.graphql

This file was deleted.

9 changes: 0 additions & 9 deletions addon/gql/mutations/save-default-integer-answer.graphql

This file was deleted.

9 changes: 0 additions & 9 deletions addon/gql/mutations/save-default-list-answer.graphql

This file was deleted.

9 changes: 0 additions & 9 deletions addon/gql/mutations/save-default-string-answer.graphql

This file was deleted.

Loading

0 comments on commit 676df5f

Please sign in to comment.