Skip to content

Commit

Permalink
Merge pull request #476 from emberjs/v2-addon
Browse files Browse the repository at this point in the history
Convert to V2 Addon, drop support for ember-source < v4
  • Loading branch information
ef4 authored Dec 5, 2024
2 parents f6caf3c + 66bd024 commit 75f08ff
Showing 38 changed files with 1,687 additions and 2,576 deletions.
44 changes: 16 additions & 28 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ on:
push:
branches:
- master
- 'v*'
pull_request:
workflow_dispatch:
schedule:
@@ -19,47 +18,41 @@ jobs:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
# type checking requires build
- run: pnpm prepack
working-directory: addon
- run: pnpm build
- run: pnpm lint

test:
timeout-minutes: 10
name: "Tests: ${{ matrix.EMBROIDER && 'embroider' || 'classic' }}"
name: "Tests"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
EMBROIDER:
- '' # classic
- 'true'

steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm test:ember
working-directory: test-apps/base-tests
env:
EMBROIDER: ${{ matrix.EMBROIDER }}

test_ember-fetch:
timeout-minutes: 10
name: "Tests (ember-fetch @ v8)"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm test:ember
working-directory: test-apps/ember-fetch-v8

floating-dependencies:
timeout-minutes: 10
name: "Floating Dependencies: ${{ matrix.EMBROIDER && 'embroider' || 'classic' }}"
name: "Floating Dependencies"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
EMBROIDER:
- '' # classic
- 'true'

steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm test:ember
working-directory: test-apps/base-tests
env:
EMBROIDER: ${{ matrix.EMBROIDER }}

typecheck:
name: '${{ matrix.typescript-scenario }}'
@@ -107,17 +100,12 @@ jobs:
app:
- test-apps/base-tests
ember-try-scenario:
- ember-lts-3.16
- ember-lts-3.20
- ember-lts-3.24
- ember-lts-3.28
- ember-4.0
- ember-lts-4.12
- ember-lts-5.4
- ember-lts-5.12
- ember-release
- ember-beta
- ember-canary
- 3.x-embroider-safe
- 3.x-embroider-optimized

steps:
- uses: actions/checkout@v4
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -46,8 +46,10 @@ This addon implements the design specified in [RFC 581](https://github.com/ember

## Compatibility

- Ember.js v2.18 or above
- Ember CLI v2.13 or above
- `ember-auto-import` or embroider
- `ember-source` v4 or above
- `@ember/test-helpers` v3 or above
- `ember-qunit` v7 or above

## Installation

9 changes: 0 additions & 9 deletions addon/.ember-cli

This file was deleted.

32 changes: 3 additions & 29 deletions addon/.gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/README.md
/LICENSE.md
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

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

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
/addon/**/*.js

types/*.d.ts
*.d.ts
!/types/**/*.d.ts
declarations/
*.tgz
41 changes: 0 additions & 41 deletions addon/.npmignore

This file was deleted.

29 changes: 4 additions & 25 deletions addon/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
# 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

addon/**/*.js
**/*.d.ts
dist/
declarations/
node_modules/
*.md
*.html
.eslintcache
3 changes: 0 additions & 3 deletions addon/.watchmanconfig

This file was deleted.

62 changes: 0 additions & 62 deletions addon/RELEASE.md

This file was deleted.

5 changes: 5 additions & 0 deletions addon/addon-main.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

const { addonV1Shim } = require('@embroider/addon-shim');

module.exports = addonV1Shim(__dirname);
8 changes: 8 additions & 0 deletions addon/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

module.exports = {
plugins: [
['@babel/plugin-transform-typescript', { allowDeclareFields: true }],
['module:decorator-transforms', { runtime: { import: 'decorator-transforms/runtime' } }],
],
};
24 changes: 0 additions & 24 deletions addon/ember-cli-build.js

This file was deleted.

20 changes: 2 additions & 18 deletions addon/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -30,10 +30,6 @@ const parserOptions = {
js: {
ecmaFeatures: { modules: true },
ecmaVersion: 'latest',
requireConfigFile: false,
babelOptions: {
plugins: [['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }]],
},
},
ts: {
projectService: true,
@@ -53,7 +49,7 @@ export default ts.config(
* https://eslint.org/docs/latest/use/configure/ignore
*/
{
ignores: ['dist/', 'node_modules/', 'coverage/', '!**/.*'],
ignores: ['dist/', 'declarations/', 'node_modules/', 'coverage/', '!**/.*'],
},
/**
* https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
@@ -84,11 +80,7 @@ export default ts.config(
parser: ember.parser,
parserOptions: parserOptions.esm.ts,
},
extends: [
// Disabled until we're v2
// ...ts.configs.recommendedTypeChecked,
ember.configs.gts,
],
extends: [...ts.configs.recommendedTypeChecked, ember.configs.gts],
rules: {
'ember/no-classic-classes': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
@@ -156,13 +148,5 @@ export default ts.config(
...globals.node,
},
},
},
{
// Remove this after v2
rules: {
'no-unused-vars': 'off',
'no-redeclare': 'off',
'no-undef': 'off',
},
}
);
5 changes: 0 additions & 5 deletions addon/index.js

This file was deleted.

Loading

0 comments on commit 75f08ff

Please sign in to comment.