Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Upgrade to 3.6 #619

Merged
merged 7 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
18 changes: 11 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ module.exports = {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'ember'
],
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
Expand All @@ -17,12 +15,14 @@ module.exports = {
browser: true
},
rules: {
'prettier/prettier': ['error', { singleQuote: true }],
'prettier/prettier': ['error', { singleQuote: true }]
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'index.js',
'testem.js',
Expand All @@ -45,9 +45,13 @@ module.exports = {
node: true
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
rules: Object.assign(
{},
require('eslint-plugin-node').configs.recommended.rules,
{
// add your custom rules and overrides for node files here
}
)
}
]
};
22 changes: 11 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

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

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

# misc
/.sass-cache
/connect.lock
/coverage/*
/coverage/
/libpeerconnection.log
npm-debug.log*
yarn-error.log
testem.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
46 changes: 27 additions & 19 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
/bower_components
# compiled output
/dist/
/tmp/

# dependencies
/bower_components/

# misc
/.bowerrc
/.editorconfig
/.ember-cli
/.eslintignore
/.eslintrc.js
/.gitignore
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/bower.json
/config/ember-try.js
/dist
/tests
/tmp
**/.gitkeep
.bowerrc
.codeclimate.yml
.editorconfig
.ember-cli
.eslintrc.js
.gitignore
.watchmanconfig
.travis.yml
bower.json
ember-cli-build.js
testem.js
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
/tests/
/yarn.lock
.gitkeep

# 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
5 changes: 5 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
};
51 changes: 32 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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"
- '6'

sudo: false
dist: trusty
Expand All @@ -20,21 +20,40 @@ env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1
matrix:

branches:
only:
- master
# npm version tags
- /^v\d+\.\d+\.\d+/

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

include:
# runs linting and tests with current locked deps

- stage: 'Tests'
name: 'Tests'
script:
- yarn run lint:hbs
- yarn run lint:js
- yarn test
after_script:
- codeclimate-test-reporter < coverage/lcov.info

# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.16
- EMBER_TRY_SCENARIO=ember-lts-2.18
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
- EMBER_TRY_SCENARIO=ember-default

matrix:
fast_finish: true
allow_failures:
- stage: 'Additional Tests'
env: EMBER_TRY_SCENARIO=ember-lts-2.16
- env: EMBER_TRY_SCENARIO=ember-lts-2.18
- env: EMBER_TRY_SCENARIO=ember-lts-3.4
- 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

before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
Expand All @@ -44,10 +63,4 @@ install:
- yarn install --no-lockfile --non-interactive

script:
- yarn lint:js
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup

after_script:
- codeclimate-test-reporter < coverage/lcov.info
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# How To Contribute

## Installation

* `git clone <repository-url>`
* `cd my-addon`
* `npm install`

## Linting

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

## Running tests

* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions

## Running the dummy application

* `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/).
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ An EmberJS validation framework that is completely and utterly computed property

## Features

__No observers were used nor harmed while developing and testing this addon.__
**No observers were used nor harmed while developing and testing this addon.**

- Lazily computed validations
- Ruby on rails inspired validators
Expand Down Expand Up @@ -45,6 +45,7 @@ If you are upgrading from 3.x to 4.x, please checkout the [upgrading documentati
- ### [Live Demo](http://offirgolan.github.io/ember-cp-validations)

- ### Documentation

- [4.x](http://offirgolan.github.io/ember-cp-validations/docs)
- [3.x](https://rawgit.com/offirgolan/ember-cp-validations/c4123c983e54f24dd790ffa1bad66cfdf2f47ec6/docs/index.html)

Expand Down
11 changes: 9 additions & 2 deletions addon/decorators/has-validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
*/

export function hasValidations(validations) {
return function decorator(target) {
target.prototype.reopen(validations);
return desc => {
return {
...desc,
finisher(klass) {
klass.prototype.reopen(validations);

return klass;
}
};
};
}
37 changes: 37 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,40 @@ module.exports = function() {
scenarios: [
{
name: 'ember-lts-2.16',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true
})
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1',
'ember-source': '~2.16.0'
}
}
},
{
name: 'ember-lts-2.18',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true
})
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1',
'ember-source': '~2.18.0'
}
}
},
{
name: 'ember-lts-3.4',
npm: {
devDependencies: {
'ember-source': '~3.4.0'
}
}
},
{
name: 'ember-release',
npm: {
Expand All @@ -51,11 +71,28 @@ module.exports = function() {
}
}
},
// The default `.travis.yml` runs this scenario via `npm test`,
// not via `ember try`. It's still included here so that running
// `ember try:each` manually or from a customized CI config will run it
// along with all the other scenarios.
{
name: 'ember-default',
npm: {
devDependencies: {}
}
},
{
name: 'ember-default-with-jquery',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true
})
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1'
}
}
}
]
};
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
name: 'ember-cp-validations',
name: require('./package').name,

setupPreprocessorRegistry: function(type, registry) {
var VGet = require('./htmlbars-plugins/v-get');
Expand Down
Loading