-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add full TS/glint support * Remove and ignore declarations * Update .eslintignore * Update random.ts * Update test watching * Fix pnpm and tests
- Loading branch information
1 parent
857d10d
commit 68c08dd
Showing
135 changed files
with
2,006 additions
and
1,790 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
dist/ | ||
node_modules/ | ||
# unconventional js | ||
/blueprints/*/files/ | ||
|
||
# compiled output | ||
/dist/ | ||
/declarations/ | ||
|
||
# misc | ||
/coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,50 @@ | ||
'use strict'; | ||
|
||
const { configs } = require('@nullvoxpopuli/eslint-configs'); | ||
|
||
module.exports = configs.ember({ prettierIntegration: true }); | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
}, | ||
plugins: ['ember'], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:ember/recommended', | ||
'plugin:prettier/recommended', | ||
], | ||
env: { | ||
browser: true, | ||
}, | ||
rules: {}, | ||
overrides: [ | ||
// ts files | ||
{ | ||
files: ['**/*.ts', '**/*.gts'], | ||
extends: [ | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
rules: { | ||
// Add any custom rules here | ||
}, | ||
}, | ||
// node files | ||
{ | ||
files: [ | ||
'./.eslintrc.cjs', | ||
'./.prettierrc.cjs', | ||
'./.template-lintrc.cjs', | ||
'./addon-main.cjs', | ||
], | ||
parserOptions: { | ||
sourceType: 'script', | ||
}, | ||
env: { | ||
browser: false, | ||
node: true, | ||
}, | ||
plugins: ['n'], | ||
extends: ['plugin:n/recommended'], | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# The authoritative copies of these live in the monorepo root (because they're | ||
# more useful on github that way), but the build copies them into here so they | ||
# will also appear in published NPM packages. | ||
/README.md | ||
/LICENSE.md | ||
|
||
# compiled output | ||
/dist | ||
/declarations | ||
|
||
# npm/pnpm/yarn pack output | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"@babel/plugin-transform-typescript", | ||
{ | ||
"allExtensions": true, | ||
"onlyRemoveTypeImports": true, | ||
"allowDeclareFields": true | ||
} | ||
], | ||
"@embroider/addon-dev/template-colocation-plugin", | ||
["@babel/plugin-proposal-decorators", { "legacy": true }], | ||
"@babel/plugin-transform-class-static-block", | ||
[ | ||
"babel-plugin-ember-template-compilation", | ||
{ | ||
"targetFormat": "hbs", | ||
"transforms": [] | ||
} | ||
], | ||
["@babel/plugin-proposal-decorators", { "version": "legacy" }], | ||
"@babel/plugin-proposal-class-properties" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,67 +12,77 @@ | |
"email": "[email protected]", | ||
"url": "https://github.com/RobbieTheWagner" | ||
}, | ||
"exports": { | ||
"./*": { | ||
"types": "./types/*.d.ts", | ||
"default": "./dist/*.js" | ||
} | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"types/*" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"dist", | ||
"types", | ||
"addon-main.cjs", | ||
"CHANGELOG.md", | ||
"README.md" | ||
], | ||
"scripts": { | ||
"start": "concurrently 'npm:watch:*'", | ||
"build": "concurrently 'npm:build:*'", | ||
"build:docs": "cp ../README.md ./README.md", | ||
"build:js": "rollup -c ./rollup.config.mjs", | ||
"watch:js": "rollup -c --watch --no-watch.clearScreen", | ||
"build:js": "rollup --config", | ||
"build:types": "glint --declaration", | ||
"lint": "concurrently 'npm:lint:js'", | ||
"lint:fix": "concurrently 'npm:lint:js:fix'", | ||
"lint:js": "eslint . --cache", | ||
"lint:js:fix": "eslint . --fix", | ||
"test": "echo 'Addon does not have tests, run tests in test-app'", | ||
"lint:types": "glint", | ||
"start": "concurrently 'npm:start:*'", | ||
"start:js": "rollup --config --watch --no-watch.clearScreen", | ||
"start:types": "glint --declaration --watch", | ||
"test": "echo 'A v2 addon does not have tests, run tests in test-app'", | ||
"prepack": "rollup --config", | ||
"prepare": "pnpm build", | ||
"prepublishOnly": "pnpm build" | ||
}, | ||
"dependencies": { | ||
"@embroider/addon-shim": "^1.8.6" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.23.2", | ||
"@babel/plugin-proposal-class-properties": "7.18.6", | ||
"@babel/plugin-proposal-decorators": "7.23.2", | ||
"@babel/plugin-syntax-decorators": "7.22.10", | ||
"@babel/core": "^7.23.2", | ||
"@babel/plugin-transform-typescript": "^7.22.15", | ||
"@babel/plugin-proposal-class-properties": "^7.16.7", | ||
"@babel/plugin-proposal-decorators": "^7.20.13", | ||
"@babel/plugin-transform-class-static-block": "^7.20.0", | ||
"@babel/runtime": "^7.17.0", | ||
"@embroider/addon-dev": "^4.1.1", | ||
"@glint/template": "^1.2.1", | ||
"@nullvoxpopuli/eslint-configs": "3.2.2", | ||
"@glint/core": "^1.2.0", | ||
"@glint/environment-ember-loose": "^1.2.0", | ||
"@glint/environment-ember-template-imports": "^1.2.0", | ||
"@glint/template": "^1.2.0", | ||
"@rollup/plugin-babel": "6.0.4", | ||
"@tsconfig/ember": "^2.0.0", | ||
"@types/ember": "^4.0.4", | ||
"@types/ember__object": "^4.0.6", | ||
"@types/ember__owner": "^4.0.4", | ||
"@types/ember__service": "^4.0.3", | ||
"@types/ember__controller": "^4.0.5", | ||
"@types/ember__string": "^3.16.3", | ||
"@types/ember__template": "^4.0.2", | ||
"@types/ember__polyfills": "^4.0.2", | ||
"@types/ember__utils": "^4.0.3", | ||
"@types/ember__runloop": "^4.0.3", | ||
"@types/ember__debug": "^4.0.4", | ||
"@types/ember__engine": "^4.0.5", | ||
"@types/ember__application": "^4.0.6", | ||
"@types/ember__test": "^4.0.2", | ||
"@types/ember__array": "^4.0.4", | ||
"@types/ember__error": "^4.0.3", | ||
"@types/ember__component": "^4.0.14", | ||
"@types/ember__modifier": "^4.0.6", | ||
"@types/ember__helper": "^4.0.3", | ||
"@types/ember__routing": "^4.0.13", | ||
"@typescript-eslint/eslint-plugin": "^6.7.2", | ||
"@typescript-eslint/parser": "^6.7.2", | ||
"concurrently": "8.2.2", | ||
"eslint": "^8.52.0", | ||
"eslint-config-prettier": "9.0.0", | ||
"eslint-plugin-decorator-position": "5.0.2", | ||
"eslint-plugin-ember": "11.11.1", | ||
"eslint-plugin-import": "2.29.0", | ||
"eslint-plugin-json": "3.1.0", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-n": "^16.0.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"eslint-plugin-simple-import-sort": "10.0.0", | ||
"prettier": "^3.0.3", | ||
"rollup": "^4.2.0" | ||
}, | ||
"peerDependencies": { | ||
"@glint/template": "^1.2.1", | ||
"ember-source": "^4.0.0 || ^5.0.0" | ||
}, | ||
"publishConfig": { | ||
|
@@ -130,6 +140,31 @@ | |
"./helpers/trunc.js": "./dist/_app_/helpers/trunc.js" | ||
} | ||
}, | ||
"files": [ | ||
"addon-main.cjs", | ||
"declarations", | ||
"dist", | ||
"CHANGELOG.md", | ||
"README.md" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./declarations/index.d.ts", | ||
"default": "./dist/index.js" | ||
}, | ||
"./*": { | ||
"types": "./declarations/*.d.ts", | ||
"default": "./dist/*.js" | ||
}, | ||
"./addon-main.js": "./addon-main.cjs" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"declarations/*" | ||
] | ||
} | ||
}, | ||
"engines": { | ||
"node": "14.* || 16.* || >= 18" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
export interface AbsSignature { | ||
Args: { | ||
Positional: [number]; | ||
}; | ||
Return: number; | ||
} | ||
|
||
/** | ||
* Uses `Math.abs` to take the absolute value of the number passed to the helper. | ||
* | ||
* ```hbs | ||
* {{abs a}} | ||
* ``` | ||
* | ||
* @param number The number to take the absolute value of | ||
* @return The absolute value of the passed number | ||
*/ | ||
export function abs([number]: [number]) { | ||
return Math.abs(number); | ||
} | ||
|
||
export default helper<AbsSignature>(abs); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { helper } from '@ember/component/helper'; | ||
|
||
export interface AcosSignature { | ||
Args: { | ||
Positional: [number]; | ||
}; | ||
Return: number; | ||
} | ||
|
||
/** | ||
* Executes `Math.acos` on the number passed to the helper. | ||
* | ||
* ```hbs | ||
* {{acos a}} | ||
* ``` | ||
* | ||
* @param number The number to pass to `Math.acos` | ||
* @return The acos of the passed number | ||
*/ | ||
export function acos([number]: [number]) { | ||
return Math.acos(number); | ||
} | ||
|
||
export default helper<AcosSignature>(acos); |
Oops, something went wrong.