Skip to content

Commit

Permalink
Merge pull request #105 from mkszepp/ember-v5-support
Browse files Browse the repository at this point in the history
Update addon to support ember v5
  • Loading branch information
NullVoxPopuli authored Jul 25, 2023
2 parents 0c2e253 + adcea57 commit c703e3c
Show file tree
Hide file tree
Showing 21 changed files with 4,054 additions and 5,437 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ jobs:
test:
name: "Tests"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Volta
uses: volta-cli/action@v1
uses: volta-cli/action@v3
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint
Expand All @@ -34,11 +35,12 @@ jobs:
floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Volta
uses: volta-cli/action@v1
uses: volta-cli/action@v3
- name: Install Dependencies
run: yarn install --no-lockfile
- name: Run Tests
Expand All @@ -48,13 +50,18 @@ jobs:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: "test"
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.24
- ember-lts-3.28
- ember-lts-4.4
- ember-lts-4.8
- ember-lts-4.12
- ember-5.0
- ember-release
- ember-beta
- ember-canary
Expand All @@ -63,9 +70,9 @@ jobs:
- embroider-optimized

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Volta
uses: volta-cli/action@v1
uses: volta-cli/action@v3
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Run Tests
Expand All @@ -79,9 +86,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Set up Volta
uses: volta-cli/action@v1
uses: volta-cli/action@v3
- name: Set up npm
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}"> ~/.npmrc
Expand Down
2 changes: 1 addition & 1 deletion ember-element-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"extends": "../package.json"
},
"peerDependencies": {
"ember-source": "^3.8 || >= 4.0.0"
"ember-source": "^3.8 || ^4.0.0 || >= 5.0.0"
},
"release-it": {
"plugins": {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
"test": "yarn workspaces run test"
},
"volta": {
"node": "14.20.0",
"yarn": "1.22.17"
"node": "14.21.3",
"yarn": "1.22.19",
"npm": "9.8.1"
},
"devDependencies": {
"concurrently": "^7.2.2"
Expand Down
8 changes: 7 additions & 1 deletion test-app/.ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
"disableAnalytics": false,

/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
15 changes: 9 additions & 6 deletions test-app/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
Expand All @@ -26,6 +29,7 @@ module.exports = {
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./index.js',
Expand All @@ -43,8 +47,7 @@ module.exports = {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
extends: ['plugin:n/recommended'],
},
{
// test files
Expand Down
3 changes: 3 additions & 0 deletions test-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
9 changes: 8 additions & 1 deletion test-app/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
'use strict';

module.exports = {
singleQuote: true,
overrides: [
{
files: '*.{js,ts}',
options: {
singleQuote: true,
},
},
],
};
8 changes: 8 additions & 0 deletions test-app/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

# addons
/.node_modules.ember-try/
5 changes: 5 additions & 0 deletions test-app/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
};
1 change: 0 additions & 1 deletion test-app/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>TestApp</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
Expand Down
1 change: 1 addition & 0 deletions test-app/app/styles/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */
2 changes: 1 addition & 1 deletion test-app/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": "4.2.0",
"version": "4.12.0",
"blueprints": [
{
"name": "app",
Expand Down
37 changes: 31 additions & 6 deletions test-app/config/ember-try.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

// eslint-disable-next-line node/no-unpublished-require
const getChannelURL = require('ember-source-channel-url');
// eslint-disable-next-line node/no-unpublished-require
const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function () {
Expand All @@ -13,31 +11,57 @@ module.exports = async function () {
name: 'ember-lts-3.24',
npm: {
devDependencies: {
'ember-resolver': '^8.0.0',
'ember-source': '~3.24.3',
'ember-cli': '^4.0.0',
'ember-qunit': '^5.0.0',
'@ember/test-helpers': '^2.1.0',
'ember-cli-htmlbars': '^5.0.0',
'@embroider/core': null,
'@embroider/compat': null,
'@embroider/webpack': null,
},
},
},
{
name: 'ember-lts-3.28',
npm: {
devDependencies: {
'ember-resolver': '^8.0.0',
'ember-source': '~3.28.0',
},
},
},
{
name: 'ember-lts-3.20',
name: 'ember-lts-4.4',
npm: {
devDependencies: {
'ember-source': '~3.20.0',
'ember-resolver': '^8.0.0',
'ember-source': '~4.4.0',
},
},
},
{
name: 'ember-lts-3.24',
name: 'ember-lts-4.8',
npm: {
devDependencies: {
'ember-source': '~4.8.0',
},
},
},
{
name: 'ember-lts-4.12',
npm: {
devDependencies: {
'ember-source': '~4.12.0',
},
},
},
{
name: 'ember-5.0',
npm: {
devDependencies: {
'ember-source': '~3.24.0',
'ember-source': '~5.0.0',
},
},
},
Expand Down Expand Up @@ -76,6 +100,7 @@ module.exports = async function () {
},
npm: {
devDependencies: {
'ember-resolver': '^8.0.0',
'ember-source': '~3.28.0',
},
ember: {
Expand Down
7 changes: 2 additions & 5 deletions test-app/config/environment.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
'use strict';

module.exports = function (environment) {
let ENV = {
const ENV = {
modulePrefix: 'test-app',
environment,
rootURL: '/',
locationType: 'history',
EmberENV: {
EXTEND_PROTOTYPES: false,
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false,
},
},

APP: {
Expand Down
11 changes: 1 addition & 10 deletions test-app/ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
'use strict';

// eslint-disable-next-line node/no-unpublished-require
const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function (defaults) {
let app = new EmberApp(defaults, {
const app = new EmberApp(defaults, {
// Add options here
});

/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/

if (app.env === 'test') {
app.import('node_modules/ember-source/dist/ember-template-compiler.js', {
type: 'test',
});
}

// eslint-disable-next-line node/no-unpublished-require
const { maybeEmbroider } = require('@embroider/test-setup');
return maybeEmbroider(app, {
skipBabel: [
Expand Down
Loading

0 comments on commit c703e3c

Please sign in to comment.