Skip to content

Commit 2c7a0d2

Browse files
authored
Merge pull request #51 from johanrd/plain-function
Convert to v2 addon, plain function with types
2 parents d09b3df + a78ceb1 commit 2c7a0d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+14201
-12366
lines changed

.gitignore

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# See https://help.github.com/ignore-files/ for more about ignoring files.
22

33
# compiled output
4-
/dist/
5-
/tmp/
4+
dist/
5+
tmp/
66

77
# dependencies
8-
/bower_components/
9-
/node_modules/
8+
node_modules/
109

1110
# misc
1211
/.env*

RELEASE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ npm install --global release-it
4747
* Second, ensure that you have installed your projects dependencies:
4848

4949
```
50-
yarn install
50+
pnpm install
5151
```
5252

5353
* And last (but not least 😁) do your release. It requires a

addon/helpers/set.js

-18
This file was deleted.

app/helpers/set.js

-1
This file was deleted.

config/ember-try.js

-89
This file was deleted.

config/environment.js

-5
This file was deleted.

ember-cli-build.js

-18
This file was deleted.

ember-set-helper/.eslintignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
4+
# compiled output
5+
/dist/
6+
/declarations/
7+
8+
# misc
9+
/coverage/

ember-set-helper/.eslintrc.cjs

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

ember-set-helper/.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# The authoritative copies of these live in the monorepo root (because they're
2+
# more useful on github that way), but the build copies them into here so they
3+
# will also appear in published NPM packages.
4+
/README.md
5+
/LICENSE.md
6+
7+
# compiled output
8+
/dist
9+
/declarations
10+
11+
# npm/pnpm/yarn pack output
12+
*.tgz

ember-set-helper/.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# unconventional js
2+
/blueprints/*/files/
3+
4+
# compiled output
5+
/dist/
6+
/declarations/
7+
8+
# misc
9+
/coverage/

ember-set-helper/.prettierrc.cjs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
module.exports = {
4+
plugins: ['prettier-plugin-ember-template-tag'],
5+
singleQuote: true,
6+
};
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

33
module.exports = {
4-
name: require('./package').name,
4+
extends: 'recommended',
55
};

ember-set-helper/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);

ember-set-helper/babel.config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"plugins": [
3+
["@babel/plugin-transform-typescript", { "allExtensions": true, "onlyRemoveTypeImports": true, "allowDeclareFields": true }],
4+
"@embroider/addon-dev/template-colocation-plugin",
5+
["babel-plugin-ember-template-compilation", {
6+
"targetFormat": "hbs",
7+
"transforms": []
8+
}],
9+
["module:decorator-transforms", { "runtime": { "import": "decorator-transforms/runtime" } }],
10+
]
11+
}

ember-set-helper/package.json

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"name": "ember-set-helper",
3+
"version": "2.0.1",
4+
"description": "A better `mut` helper!",
5+
"keywords": [
6+
"ember-addon"
7+
],
8+
"repository": "",
9+
"license": "MIT",
10+
"author": "Chris Garrett",
11+
"exports": {
12+
".": {
13+
"types": "./declarations/index.d.ts",
14+
"default": "./dist/index.js"
15+
},
16+
"./*": {
17+
"types": "./declarations/*.d.ts",
18+
"default": "./dist/*.js"
19+
},
20+
"./addon-main.js": "./addon-main.cjs"
21+
},
22+
"typesVersions": {
23+
"*": {
24+
"*": [
25+
"declarations/*"
26+
]
27+
}
28+
},
29+
"files": [
30+
"addon-main.cjs",
31+
"declarations",
32+
"dist"
33+
],
34+
"scripts": {
35+
"build": "concurrently 'npm:build:*'",
36+
"build:js": "rollup --config",
37+
"build:types": "glint --declaration",
38+
"lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
39+
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
40+
"lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
41+
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
42+
"lint:js": "eslint . --cache",
43+
"lint:js:fix": "eslint . --fix",
44+
"lint:types": "glint",
45+
"prepack": "rollup --config",
46+
"start": "concurrently 'npm:start:*'",
47+
"start:js": "rollup --config --watch --no-watch.clearScreen",
48+
"start:types": "glint --declaration --watch",
49+
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
50+
},
51+
"dependencies": {
52+
"@embroider/addon-shim": "^1.8.7",
53+
"decorator-transforms": "^1.0.1"
54+
},
55+
"devDependencies": {
56+
"@babel/core": "^7.23.6",
57+
"@babel/plugin-transform-typescript": "^7.23.6",
58+
"@babel/runtime": "^7.17.0",
59+
"@embroider/addon-dev": "^4.1.0",
60+
"@glint/core": "^1.2.1",
61+
"@glint/environment-ember-loose": "^1.2.1",
62+
"@glint/environment-ember-template-imports": "^1.2.1",
63+
"@glint/template": "^1.2.1",
64+
"@rollup/plugin-babel": "^6.0.4",
65+
"@tsconfig/ember": "^3.0.2",
66+
"@types/ember": "^4.0.10",
67+
"@types/ember__application": "^4.0.10",
68+
"@types/ember__array": "^4.0.9",
69+
"@types/ember__component": "^4.0.21",
70+
"@types/ember__controller": "^4.0.11",
71+
"@types/ember__debug": "^4.0.7",
72+
"@types/ember__destroyable": "^4.0.4",
73+
"@types/ember__engine": "^4.0.10",
74+
"@types/ember__error": "^4.0.5",
75+
"@types/ember__helper": "^4.0.5",
76+
"@types/ember__modifier": "^4.0.8",
77+
"@types/ember__object": "^4.0.11",
78+
"@types/ember__owner": "^4.0.8",
79+
"@types/ember__polyfills": "^4.0.5",
80+
"@types/ember__routing": "^4.0.19",
81+
"@types/ember__runloop": "^4.0.8",
82+
"@types/ember__service": "^4.0.8",
83+
"@types/ember__string": "^3.16.3",
84+
"@types/ember__template": "^4.0.5",
85+
"@types/ember__test": "^4.0.5",
86+
"@types/ember__utils": "^4.0.6",
87+
"@typescript-eslint/eslint-plugin": "^6.14.0",
88+
"@typescript-eslint/parser": "^6.14.0",
89+
"babel-plugin-ember-template-compilation": "^2.2.1",
90+
"concurrently": "^8.2.2",
91+
"ember-template-lint": "^5.13.0",
92+
"eslint": "^8.56.0",
93+
"eslint-config-prettier": "^9.1.0",
94+
"eslint-plugin-ember": "^11.12.0",
95+
"eslint-plugin-n": "^16.4.0",
96+
"eslint-plugin-prettier": "^5.0.1",
97+
"prettier": "^3.1.1",
98+
"prettier-plugin-ember-template-tag": "^1.1.0",
99+
"rollup": "^4.9.1",
100+
"rollup-plugin-copy": "^3.5.0",
101+
"typescript": "^5.3.3"
102+
},
103+
"publishConfig": {
104+
"registry": "https://registry.npmjs.org"
105+
},
106+
"ember": {
107+
"edition": "octane"
108+
},
109+
"ember-addon": {
110+
"version": 2,
111+
"type": "addon",
112+
"main": "addon-main.cjs",
113+
"app-js": {
114+
"./helpers/set.js": "./dist/_app_/helpers/set.js"
115+
}
116+
}
117+
}

0 commit comments

Comments
 (0)