Skip to content

Commit 6402fff

Browse files
committedJun 12, 2023
Convert to native package
1 parent d4e152e commit 6402fff

25 files changed

+872
-645
lines changed
 

‎addon/.ember-cli

-15
This file was deleted.

‎addon/.eslintrc.cjs

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
'use strict';
2+
3+
module.exports = {
4+
root: true,
5+
parser: '@babel/eslint-parser',
6+
parserOptions: {
7+
ecmaVersion: 'latest',
8+
sourceType: 'module',
9+
ecmaFeatures: {
10+
legacyDecorators: true,
11+
},
12+
babelOptions: {
13+
root: __dirname,
14+
},
15+
},
16+
plugins: ['ember'],
17+
extends: [
18+
'eslint:recommended',
19+
'plugin:ember/recommended',
20+
'plugin:prettier/recommended',
21+
],
22+
env: {
23+
browser: true,
24+
},
25+
rules: {
26+
'ember/no-test-support-import': 'off',
27+
'ember/no-classic-classes': 'off',
28+
},
29+
overrides: [
30+
// node files
31+
{
32+
files: [
33+
'./.eslintrc.js',
34+
'./.prettierrc.js',
35+
'./.template-lintrc.js',
36+
'./addon-main.js',
37+
],
38+
parserOptions: {
39+
sourceType: 'script',
40+
},
41+
env: {
42+
browser: false,
43+
node: true,
44+
},
45+
plugins: ['node'],
46+
extends: ['plugin:node/recommended'],
47+
},
48+
],
49+
};

‎addon/.eslintrc.js

-66
This file was deleted.

‎addon/.npmignore

-40
This file was deleted.

‎addon/.watchmanconfig

-3
This file was deleted.

‎addon/addon-main.cjs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
'use strict';
2+
3+
const { addonV1Shim } = require('@embroider/addon-shim');
4+
module.exports = addonV1Shim(__dirname);

‎addon/addon/.gitkeep

Whitespace-only changes.

‎addon/app/.gitkeep

Whitespace-only changes.

‎addon/babel.config.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"plugins": [
3+
"@embroider/addon-dev/template-colocation-plugin",
4+
["@babel/plugin-proposal-decorators", { "legacy": true }],
5+
"@babel/plugin-proposal-class-properties"
6+
]
7+
}

‎addon/config/environment.js

-6
This file was deleted.

‎addon/ember-cli-build.js

-38
This file was deleted.

‎addon/index.js

-102
This file was deleted.

‎addon/package.json

+28-42
Original file line numberDiff line numberDiff line change
@@ -17,80 +17,63 @@
1717
"Dan Gebhardt",
1818
"Steve Calvert"
1919
],
20-
"directories": {
21-
"doc": "doc",
22-
"test": "tests"
20+
"exports": {
21+
".": "./dist/index.js",
22+
"./*": "./dist/*.js",
23+
"./addon-main.js": "./addon-main.cjs"
2324
},
25+
"files": [
26+
"dist",
27+
"addon-main.cjs"
28+
],
2429
"types": "types/index.d.ts",
2530
"scripts": {
26-
"build": "ember build --environment=production",
27-
"lint": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
28-
"lint:fix": "npm-run-all --print-name --aggregate-output --continue-on-error --parallel \"lint:*:fix\"",
31+
"build": "rollup --config",
32+
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
33+
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
2934
"lint:js": "eslint . --cache",
3035
"lint:js:fix": "eslint . --fix",
31-
"start": "ember serve",
32-
"test": "npm-run-all --print-name \"lint\" \"test:*\"",
36+
"start": "rollup --config --watch",
3337
"test:types": "tsc --noEmit --project types",
34-
"test:ember": "ember test",
35-
"test:ember-compatibility": "ember try:each"
38+
"prepack": "rollup --config"
3639
},
3740
"dependencies": {
38-
"broccoli-funnel": "^3.0.8",
39-
"broccoli-merge-trees": "^3.0.2",
40-
"common-tags": "^1.8.0",
41-
"ember-auto-import": "^2.6.1",
42-
"ember-cli-babel": "^7.26.11",
43-
"ember-cli-test-loader": "^3.0.0",
44-
"resolve-package-path": "^4.0.3",
45-
"silent-error": "^1.1.1",
46-
"validate-peer-dependencies": "^2.2.0"
41+
"@embroider/addon-shim": "^1.0.0",
42+
"ember-cli-test-loader": "^3.0.0"
4743
},
4844
"devDependencies": {
4945
"@babel/core": "^7.21.0",
5046
"@babel/eslint-parser": "^7.19.1",
51-
"@ember/optional-features": "^2.0.0",
52-
"@ember/string": "^3.1.1",
5347
"@ember/test-helpers": "^3.0.3",
54-
"@embroider/test-setup": "^3.0.1",
48+
"@embroider/addon-dev": "^3.0.0",
5549
"@glimmer/component": "^1.1.2",
50+
"@rollup/plugin-babel": "^5.3.0",
5651
"@tsconfig/ember": "^2.0.0",
5752
"@types/qunit": "^2.19.4",
5853
"@types/rsvp": "^4.0.4",
59-
"ember-angle-bracket-invocation-polyfill": "^3.0.2",
60-
"ember-cli": "~4.10.0",
61-
"ember-cli-dependency-checker": "^3.3.1",
54+
"concurrently": "^8.0.1",
6255
"ember-cli-htmlbars": "^6.2.0",
63-
"ember-cli-inject-live-reload": "^2.1.0",
64-
"ember-cli-terser": "^4.0.2",
65-
"ember-disable-prototype-extensions": "^1.1.3",
66-
"ember-load-initializers": "^2.1.2",
67-
"ember-resolver": "^9.0.1",
68-
"ember-source": "~4.10.0",
69-
"ember-source-channel-url": "^3.0.0",
70-
"ember-try": "^2.0.0",
56+
"ember-resolver": "^10.1.0",
57+
"ember-source": "^4.10.0",
7158
"eslint": "^8.35.0",
7259
"eslint-config-prettier": "^8.6.0",
7360
"eslint-plugin-disable-features": "^0.1.3",
7461
"eslint-plugin-node": "^11.1.0",
7562
"eslint-plugin-prettier": "^4.2.1",
7663
"expect-type": "^0.15.0",
77-
"loader.js": "^4.7.0",
78-
"npm-run-all": "^4.1.5",
79-
"prettier": "2.8.8",
64+
"prettier": "^2.8.8",
8065
"qunit": "^2.19.4",
8166
"release-it": "^15.7.0",
8267
"release-it-lerna-changelog": "^5.0.0",
83-
"typescript": "^4.9.5",
84-
"webpack": "^5.75.0"
68+
"rollup": "^2.67.0",
69+
"rollup-plugin-copy": "^3.4.0",
70+
"typescript": "^4.9.5"
8571
},
8672
"peerDependencies": {
8773
"@ember/test-helpers": ">=3.0.3",
8874
"ember-source": ">=4.0.0",
8975
"qunit": "^2.13.0"
9076
},
91-
"engines": {
92-
"node": "16.* || >= 18"
93-
},
9477
"publishConfig": {
9578
"registry": "https://registry.npmjs.org"
9679
},
@@ -108,7 +91,10 @@
10891
"edition": "octane"
10992
},
11093
"ember-addon": {
111-
"configPath": "tests/dummy/config"
94+
"version": 2,
95+
"type": "addon",
96+
"main": "addon-main.cjs",
97+
"app-js": {}
11298
},
11399
"release-it": {
114100
"plugins": {

‎addon/rollup.config.mjs

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { babel } from '@rollup/plugin-babel';
2+
// import copy from 'rollup-plugin-copy';
3+
import { Addon } from '@embroider/addon-dev/rollup';
4+
5+
const addon = new Addon({
6+
srcDir: 'src',
7+
destDir: 'dist',
8+
});
9+
10+
export default {
11+
// This provides defaults that work well alongside `publicEntrypoints` below.
12+
// You can augment this if you need to.
13+
output: addon.output(),
14+
15+
plugins: [
16+
// These are the modules that users should be able to import from your
17+
// addon. Anything not listed here may get optimized away.
18+
addon.publicEntrypoints(['**/*.js']),
19+
20+
// Follow the V2 Addon rules about dependencies. Your code can import from
21+
// `dependencies` and `peerDependencies` as well as standard Ember-provided
22+
// package names.
23+
addon.dependencies(),
24+
25+
// This babel config should *not* apply presets or compile away ES modules.
26+
// It exists only to provide development niceties for you, like automatic
27+
// template colocation.
28+
//
29+
// By default, this will load the actual babel config from the file
30+
// babel.config.json.
31+
babel({
32+
babelHelpers: 'bundled',
33+
}),
34+
35+
// addons are allowed to contain imports of .css files, which we want rollup
36+
// to leave alone and keep in the published output.
37+
addon.keepAssets(['**/*.css']),
38+
39+
// Remove leftover build artifacts when starting a new build.
40+
addon.clean(),
41+
42+
// Copy Readme and License into published package
43+
// copy({
44+
// targets: [
45+
// { src: '../README.md', dest: '.' },
46+
// { src: '../LICENSE.md', dest: '.' },
47+
// ],
48+
// }),
49+
],
50+
};

‎addon/addon-test-support/adapter.js ‎addon/src/adapter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import Ember from 'ember';
1+
import TestAdapter from '@ember/test/adapter';
22
import * as QUnit from 'qunit';
33

44
export function nonTestDoneCallback() {}
55

6-
let Adapter = Ember.Test.Adapter.extend({
6+
let Adapter = TestAdapter.extend({
77
init() {
88
this.doneCallbacks = [];
99
this.qunit = this.qunit || QUnit;

‎addon/addon-test-support/index.js ‎addon/src/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* globals Testem */
2+
import 'qunit/qunit/qunit.css';
3+
import './test-container-styles.css';
24

35
export { default as QUnitAdapter, nonTestDoneCallback } from './adapter';
46
export { loadTests } from './test-loader';
@@ -124,10 +126,12 @@ export function setupTestAdapter() {
124126
*/
125127
export function setupEmberTesting() {
126128
QUnit.testStart(() => {
129+
// eslint-disable-next-line ember/no-ember-testing-in-module-scope
127130
Ember.testing = true;
128131
});
129132

130133
QUnit.testDone(() => {
134+
// eslint-disable-next-line ember/no-ember-testing-in-module-scope
131135
Ember.testing = false;
132136
});
133137
}
File renamed without changes.

‎addon/testem.js

-23
This file was deleted.

‎addon/tests/integration/setup-test-test.js

-60
This file was deleted.

‎package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
"license": "MIT",
66
"repository": "https://github.com/emberjs/ember-qunit",
77
"scripts": {
8-
"lint": "pnpm --filter '*' lint",
9-
"lint:fix": "pnpm --filter '*' lint:fix",
10-
"test": "pnpm --filter '*' test"
8+
"prepare": "pnpm --filter ember-qunit build",
9+
"lint": "pnpm --filter '*' run lint",
10+
"lint:fix": "pnpm --filter '*' run lint:fix",
11+
"test": "pnpm --filter '*' run test"
1112
},
1213
"volta": {
1314
"node": "18.16.0",
14-
"pnpm": "8.6.1"
15+
"pnpm": "8.6.2"
1516
}
1617
}

‎pnpm-lock.yaml

+722-243
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"test:ember-compatibility": "ember try:each"
2323
},
2424
"dependencies": {
25-
"ember-qunit": "link:../addon"
25+
"ember-qunit": "workspace:*"
2626
},
2727
"devDependencies": {
2828
"@babel/core": "^7.21.0",

0 commit comments

Comments
 (0)
Please sign in to comment.