Skip to content

Commit

Permalink
fix: Update Ember v3.21.2...v3.26.1
Browse files Browse the repository at this point in the history
Add embroider tests and update addon to latest.

BREAKING CHANGE: Drop Node.js < 12. Might still work, but no longer tested.
  • Loading branch information
knownasilya committed Jun 1, 2021
1 parent 7829328 commit 5fe9e23
Show file tree
Hide file tree
Showing 22 changed files with 116 additions and 70 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# misc
/coverage/
!.*
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ module.exports = {
},
},
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
Expand All @@ -21,6 +25,7 @@ module.exports = {
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'.template-lintrc.js',
'.prettierrc.js',
'ember-cli-build.js',
Expand Down
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
3 changes: 3 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 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
2 changes: 2 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
singleQuote: true,
};
4 changes: 3 additions & 1 deletion .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
- '10'
- '12'

dist: xenial

Expand Down Expand Up @@ -54,6 +54,8 @@ jobs:
- 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
Expand Down
21 changes: 10 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@

## Installation

* `git clone <repository-url>`
* `cd ember-shadow-dom`
* `npm install`
- `git clone <repository-url>`
- `cd ember-shadow-dom`
- `npm install`

## Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`
- `yarn lint`
- `yarn lint: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
- `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).
- `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/).
18 changes: 4 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ you're used to.

- Ember.js v3.16 or above
- Ember CLI v2.13 or above
- Node.js v10 or above
- Node.js v12 or above

If using Ember < 3.20, this addon will use the private version of `{{in-element}}` via a polyfill.

Expand All @@ -34,9 +34,7 @@ This addon provides a component called `ShadowRoot`.
```hbs
<ShadowRoot>
<style>
.internal {
color: red;
}
.internal { color: red; }
</style>
<span class='internal'>Internal</span>
Expand All @@ -53,9 +51,7 @@ In Shadow DOM you can generally use `<slots>`, but with Ember you can just use `
{{! components/test.hbs }}
<ShadowRoot>
<style>
.internal {
color: red;
}
.internal { color: red; }
</style>
<span class='internal'>
Expand All @@ -79,13 +75,7 @@ And the contents `Hello World!` will be inside the shadow root. If you need mult
{{! components/card.hbs }}
<ShadowRoot ...attributes>
<style>
.title {
color: red;
}
.body {
margin-top: 1rem;
}
.title { color: red; } .body { margin-top: 1rem; }
</style>
<header class='title'>
Expand Down
3 changes: 3 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

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

module.exports = async function () {
return {
Expand Down Expand Up @@ -74,6 +75,8 @@ module.exports = async function () {
},
},
},
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 {};
};
5 changes: 3 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, {
// Add options here
});
Expand All @@ -14,5 +14,6 @@ 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);
};
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
name: require('./package').name
name: require('./package').name,
};
46 changes: 28 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,62 @@
},
"scripts": {
"build": "ember build --environment=production",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel 'lint:!(fix)'",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "ember serve",
"test": "npm-run-all lint:* test:*",
"test": "npm-run-all lint test:*",
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each",
"release": "standard-version"
},
"dependencies": {
"@ember/render-modifiers": "^1.0.2",
"@glimmer/component": "^1.0.0",
"@glimmer/tracking": "^1.0.1",
"ember-cli-babel": "^7.22.1",
"ember-cli-htmlbars": "^5.3.1",
"@glimmer/component": "^1.0.4",
"@glimmer/tracking": "^1.0.4",
"ember-cli-babel": "^7.26.3",
"ember-cli-htmlbars": "^5.7.1",
"ember-element-helper": "^0.3.1",
"ember-in-element-polyfill": "^1.0.0"
},
"devDependencies": {
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.2.5",
"@embroider/test-setup": "^0.37.0",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.6.0",
"ember-cli": "^3.21.2",
"ember-auto-import": "^1.11.2",
"ember-cli": "^3.26.1",
"ember-cli-app-version": "^3.2.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-fastboot": "^2.2.3",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-sri": "^2.1.1",
"ember-cli-terser": "^4.0.0",
"ember-cli-terser": "^4.0.1",
"ember-export-application-global": "^2.0.1",
"ember-load-initializers": "^2.1.1",
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-qunit": "^4.6.0",
"ember-page-title": "^6.2.1",
"ember-qunit": "^5.1.4",
"ember-resolver": "^8.0.2",
"ember-source": "~3.21.3",
"ember-source": "~3.26.1",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^2.11.0",
"ember-template-lint": "^3.2.0",
"ember-truth-helpers": "^2.1.0",
"ember-try": "^1.4.0",
"eslint": "^7.10.0",
"eslint-plugin-ember": "^9.2.0",
"eslint": "^7.23.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-ember": "^10.3.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.3.1",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"qunit-dom": "^1.5.0",
"prettier": "^2.2.1",
"qunit": "^2.14.1",
"qunit-dom": "^1.6.0",
"standard-version": "^9.0.0"
},
"resolutions": {
Expand All @@ -78,6 +88,6 @@
"configPath": "tests/dummy/config"
},
"volta": {
"node": "10.16.3"
"node": "12.22.1"
}
}
16 changes: 6 additions & 10 deletions testem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome'],
browser_start_timeout: 120,
browser_args: {
Chrome: {
Expand All @@ -20,8 +16,8 @@ module.exports = {
'--disable-software-rasterizer',
'--mute-audio',
'--remote-debugging-port=0',
'--window-size=1440,900'
].filter(Boolean)
}
}
'--window-size=1440,900',
].filter(Boolean),
},
},
};
3 changes: 1 addition & 2 deletions tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export default class Router extends EmberRouter {
rootURL = config.rootURL;
}

Router.map(function() {
});
Router.map(function () {});
4 changes: 3 additions & 1 deletion tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{{page-title 'Ember Shadow Dom'}}

<h2 id='title'>
Welcome to Ember
Ember Shadow Dom
</h2>

{{outlet}}
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "3.21.2",
"version": "3.26.1",
"blueprints": [
{
"name": "addon",
Expand Down
8 changes: 4 additions & 4 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

module.exports = function(environment) {
module.exports = function (environment) {
let ENV = {
modulePrefix: 'dummy',
environment,
Expand All @@ -16,14 +16,14 @@ module.exports = function(environment) {
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
}
Date: false,
},
},

APP: {
// Here you can pass flags/options to your application instance
// when it is created
}
},
};

if (environment === 'development') {
Expand Down

0 comments on commit 5fe9e23

Please sign in to comment.