Skip to content

Commit

Permalink
update ember-cli project and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcobain committed Nov 26, 2022
1 parent 628cc6a commit 530c267
Show file tree
Hide file tree
Showing 58 changed files with 8,098 additions and 5,961 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
64 changes: 31 additions & 33 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,55 +1,53 @@
'use strict';

module.exports = {
globals: {
server: true,
},
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: [
'ember'
],
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true
},
rules: {
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./tests/dummy/config/**/*.js',
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
node: true,
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
"node/no-unpublished-require": 0
})
}
]
extends: ['plugin:node/recommended'],
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI

on:
push:
branches:
- main
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: 'Tests'
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Run Tests
run: yarn test:ember

floating:
name: 'Floating Dependencies'
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- name: Install Dependencies
run: yarn install --no-lockfile
- name: Run Tests
run: yarn test:ember

try-scenarios:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: 'test'
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.28
- ember-lts-4.4
- ember-release
- ember-beta
- ember-canary
- ember-classic
- embroider-safe
- embroider-optimized

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand Down
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
Expand All @@ -22,6 +26,7 @@
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

Expand Down
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
singleQuote: true,
};
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
extends: 'recommended',
};
33 changes: 18 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ language: node_js
node_js:
# we recommend testing addons with the same minimum supported node version as Ember CLI
# so that your addon works for all apps
- '6'
- "12"

sudo: false
dist: trusty
dist: xenial

addons:
chrome: stable
Expand All @@ -26,36 +25,40 @@ branches:
- /^v\d+\.\d+\.\d+/

jobs:
fail_fast: true
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

include:
# runs linting and tests with current locked deps
- stage: "Tests"
name: "Tests"
script:
- yarn lint
- yarn test:ember

- stage: 'Tests'
name: 'Tests'
- stage: "Additional Tests"
name: "Floating Dependencies"
install:
- yarn install --no-lockfile --non-interactive
script:
- npm run lint:hbs
- npm run lint:js
- npm test
- yarn test:ember

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- stage: 'Additional Tests'
env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
- env: EMBER_TRY_SCENARIO=ember-lts-3.24
- env: EMBER_TRY_SCENARIO=ember-lts-3.28
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
- env: EMBER_TRY_SCENARIO=ember-default-with-jquery
- env: EMBER_TRY_SCENARIO=ember-classic
- env: EMBER_TRY_SCENARIO=embroider-safe
- env: EMBER_TRY_SCENARIO=embroider-optimized

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

install:
- yarn install --no-lockfile --non-interactive

script:
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
## Installation

* `git clone <repository-url>`
* `cd my-addon`
* `npm install`
* `cd ember-data-copyable`
* `yarn install`

## Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`
* `yarn lint`
* `yarn lint:fix`

## Running tests

Expand All @@ -23,4 +22,4 @@
* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
Loading

0 comments on commit 530c267

Please sign in to comment.