Skip to content

Commit

Permalink
feat: life-ycle
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel-M-R committed Nov 25, 2021
1 parent a4cd1a1 commit 06f8256
Show file tree
Hide file tree
Showing 31 changed files with 3,629 additions and 3,522 deletions.
2 changes: 1 addition & 1 deletion .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
extends: ['@commitlint/config-conventional'],
};
7 changes: 1 addition & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ insert_final_newline = true
indent_style = space
indent_size = 2

[*.{html,css,hbs,js}]
indent_style = tab
indent_size = tab
tab_width = 4

[*.{hbs,yml,yaml}]
[*.hbs]
insert_final_newline = false

[*.{diff,md}]
Expand Down
109 changes: 50 additions & 59 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,63 +1,54 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
overrides: [
// node files
{
files: [
'.huskyrc.js',
'.commitlintrc.js',
'.eslintrc.js',
'.prettierrc.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/**',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
rules: {
'qunit/require-expect': 'off',
},
},
],
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'./.commitlintrc.js',
'./.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',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
44 changes: 41 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,53 @@ jobs:
- name: Install dependencies
run: yarn install
- name: Test
run: |
yarn lint
yarn test
run: yarn test
- name: Release dry-run
run: yarn test:release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Upload codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: true
regression:
if: github.ref != 'refs/heads/master'
needs: test
runs-on: ubuntu-latest
name: Regression test - ${{ matrix.ember_try_scenario }} - Experimental ${{ matrix.experimental }}
strategy:
matrix:
ember_try_scenario:
- ember-lts-3.20
- ember-lts-3.24
- ember-release
- ember-beta
- ember-default-with-jquery
- ember-classic
- embroider-safe
- embroider-optimized
experimental: [false]
include:
- ember_try_scenario: ember-canary
experimental: true
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 12
cache: yarn
- name: Install dependencies
run: yarn install
- name: Test
run: yarn ember try:one ${{ matrix.ember_try_scenario }}
release:
if: github.ref == 'refs/heads/master'
needs: [test]
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
/node_modules/

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

# ember-try
/.node_modules.ember-try/
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
6 changes: 0 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.commitlintrc.js
/.huskyrc.js
/.nycrc.json
/.releaserc
/greenkeeper.json
/jsconfig.json
/.travis.yml
/.watchmanconfig
/bower.json
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@

# misc
/coverage/
/.nyc_output/
!.*
.eslintcache
*.html
*.hbs

# ember-try
/.node_modules.ember-try/
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
singleQuote: true,
singleQuote: true,
};
40 changes: 20 additions & 20 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
'use strict';

module.exports = {
extends: 'recommended',
rules: {
'no-bare-strings': true,
'block-indentation': 'tab',
'no-html-comments': true,
'no-nested-interactive': true,
'self-closing-void-elements': true,
'no-triple-curlies': true,
'deprecated-each-syntax': true,
'link-rel-noopener': true,
'no-invalid-interactive': true,
'require-valid-alt-text': true,
'style-concatenation': true,
'deprecated-inline-view-helper': true,
'no-unused-block-params': true,
'inline-link-to': true,
'no-inline-styles': true,
'simple-unless': false,
},
ignore: ['tests/dummy/**'],
extends: 'recommended',
rules: {
'no-bare-strings': true,
'block-indentation': 'tab',
'no-html-comments': true,
'no-nested-interactive': true,
'self-closing-void-elements': true,
'no-triple-curlies': true,
'deprecated-each-syntax': true,
'link-rel-noopener': true,
'no-invalid-interactive': true,
'require-valid-alt-text': true,
'style-concatenation': true,
'deprecated-inline-view-helper': true,
'no-unused-block-params': true,
'inline-link-to': true,
'no-inline-styles': true,
'simple-unless': false,
},
ignore: ['tests/dummy/**'],
};
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

## Linting

- `yarn lint`
- `yarn lint:fix`
- `yarn lint:hbs`
- `yarn lint:js`
- `yarn lint:js -- --fix`

## Running tests

Expand Down
30 changes: 15 additions & 15 deletions addon/constants.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
export const STATES = {
ONLINE: 'ONLINE',
OFFLINE: 'OFFLINE',
RECONNECTING: 'RECONNECTING',
LIMITED: 'LIMITED',
ONLINE: 'ONLINE',
OFFLINE: 'OFFLINE',
RECONNECTING: 'RECONNECTING',
LIMITED: 'LIMITED',
};

export const CONFIG = {
reconnect: {
auto: false,
path: '/favicon.ico',
delay: 5000,
multiplier: 1.5,
timeout: 15000,
maxDelay: 60000,
maxTimes: -1,
},
reconnect: {
auto: false,
path: '/favicon.ico',
delay: 5000,
multiplier: 1.5,
timeout: 15000,
maxDelay: 60000,
maxTimes: -1,
},
};

export default {
STATES,
CONFIG,
STATES,
CONFIG,
};
Loading

0 comments on commit 06f8256

Please sign in to comment.