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

re-rolling yarn.lock #47

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
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
57 changes: 26 additions & 31 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,48 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
legacyDecorators: true,
},
},
plugins: [
'ember'
],
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true
},
rules: {
'ember/no-jquery': 'error'
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',
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'lib/**/*.js',
'tests/dummy/config/**/*.js'
],
excludedFiles: [
'addon/**',
'addon-test-support/**',
'app/**',
'tests/dummy/app/**'
'./tests/dummy/config/**/*.js',
],
parserOptions: {
sourceType: 'script'
sourceType: 'script',
},
env: {
browser: false,
node: true
node: true,
},
plugins: ['node'],
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, {
// add your custom rules and overrides for node files here
})
}
]
extends: ['plugin:node/recommended'],
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
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
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
/.editorconfig
/.ember-cli
/.env*
/.eslintcache
/.eslintignore
/.eslintrc.js
/.git/
/.gitignore
/.prettierignore
/.prettierrc.js
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
Expand All @@ -23,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: 'octane'
extends: 'recommended',
};
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

## Linting

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

## Running tests

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Compatibility

* Ember.js v3.12.4 or above
* Ember CLI v2.13 or above
* Node.js v10 or above
* Node.js v12 or above


Installation
Expand Down
5 changes: 3 additions & 2 deletions addon/helpers/-has-block-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ export default helper(

assert(
'-has-block-params takes exactly three arguments: the blocks ' +
'info hash, the name of the block and the fallback value',
'info hash, the name of the block and the fallback value',
params.length === 3 &&
(blocksInfo === undefined || isBlocksInfo(blocksInfo)) &&
typeof block === 'string' && typeof fallback === 'boolean'
typeof block === 'string' &&
typeof fallback === 'boolean'
);

assert(
Expand Down
5 changes: 3 additions & 2 deletions addon/helpers/-has-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ export default helper(

assert(
'-has-block takes exactly three arguments: the blocks info ' +
'hash, the name of the block and the fallback value',
'hash, the name of the block and the fallback value',
params.length === 3 &&
(blocksInfo === undefined || isBlocksInfo(blocksInfo)) &&
typeof block === 'string' && typeof fallback === 'boolean'
typeof block === 'string' &&
typeof fallback === 'boolean'
);

assert(
Expand Down
2 changes: 1 addition & 1 deletion addon/helpers/-is-named-block-invocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default helper(
function _isNamedBlockInvocation(params, hash) {
assert(
'-is-named-block-invocation takes exactly two arguments: ' +
'the invocation value to check and the name of the block',
'the invocation value to check and the name of the block',
params.length === 2 && typeof params[1] === 'string'
);

Expand Down
7 changes: 5 additions & 2 deletions addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ export function isNamedBlockInvocation(value, block) {
* @returns {value is BlocksInfo}
*/
export function isBlocksInfo(value) {
return typeof value === 'object' && value !== null &&
return (
typeof value === 'object' &&
value !== null &&
Object.getPrototypeOf(value) === null &&
Object.values(value).every(v => typeof v === 'number');
Object.values(value).every((v) => typeof v === 'number')
);
}
86 changes: 45 additions & 41 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,97 +1,101 @@
'use strict';

const getChannelURL = require('ember-source-channel-url');
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function() {
module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.12',
npm: {
devDependencies: {
'ember-source': '~3.12.4'
}
}
'ember-source': '~3.12.4',
},
},
},
{
name: 'ember-lts-3.16',
npm: {
devDependencies: {
'ember-source': '~3.16.1'
}
}
'ember-source': '~3.16.1',
},
},
},
{
name: 'ember-lts-3.20',
npm: {
devDependencies: {
'ember-source': '~3.20.0'
}
}
'ember-source': '~3.20.0',
},
},
},
{
name: 'ember-release',
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'ember-source': await getChannelURL('release')
}
}
'ember-source': '~3.24.0',
},
},
},
{
name: 'ember-beta',
name: 'ember-release',
npm: {
devDependencies: {
'ember-source': await getChannelURL('beta')
}
}
'ember-source': await getChannelURL('release'),
},
},
},
{
name: 'ember-canary',
name: 'ember-beta',
npm: {
devDependencies: {
'ember-source': await getChannelURL('canary')
}
}
'ember-source': await getChannelURL('beta'),
},
},
},
// The default `.travis.yml` runs this scenario via `yarn 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',
name: 'ember-canary',
npm: {
devDependencies: {}
}
devDependencies: {
'ember-source': await getChannelURL('canary'),
},
},
},
{
name: 'ember-default-with-jquery',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true
})
'jquery-integration': true,
}),
},
npm: {
devDependencies: {
'@ember/jquery': '^0.5.1'
}
}
'@ember/jquery': '^1.1.0',
},
},
},
{
name: 'ember-classic',
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'application-template-wrapper': true,
'default-async-observers': false,
'template-only-glimmer-components': false
})
'template-only-glimmer-components': false,
}),
},
npm: {
devDependencies: {
'ember-source': '~3.28.0',
},
ember: {
edition: 'classic'
}
}
}
]
edition: 'classic',
},
},
},
embroiderSafe(),
embroiderOptimized(),
],
};
};
4 changes: 2 additions & 2 deletions config/environment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = function(/* environment, appConfig */) {
return { };
module.exports = function (/* environment, appConfig */) {
return {};
};
11 changes: 9 additions & 2 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
module.exports = function (defaults) {
let app = new EmberAddon(defaults, {
'ember-cli-babel': {
throwUnlessParallelizable: true,
Expand All @@ -16,5 +16,12 @@ module.exports = function(defaults) {
behave. You most likely want to be modifying `./index.js` or app's build file
*/

return app.toTree();
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app, {
skipBabel: [
{
package: 'qunit',
},
],
});
};
Loading