Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript #418

Merged
merged 5 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
node-version: '16.x'
- name: Install
run: pnpm install
- run: pnpm build
- name: Test
env:
EMBER_VERSION: ${{ matrix.ember_version }}
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ node_modules
tmp
*.log
test/**/yarn.lock
test/**/*.js
test/**/*.js.map
transforms/**/*.js
transforms/**/*.js.map
helpers/**/*.js
helpers/**/*.js.map
!**/__testfixtures__/**/*
6 changes: 6 additions & 0 deletions helpers/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** Type predicate. Checks if the given value is a `Record<string, unknown>`. */
export function isRecord<R extends Record<string, unknown>>(
value: unknown
): value is R {
return value !== null && typeof value === 'object';
}
38 changes: 30 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,56 @@
"bin": {
"ember-no-implicit-this-codemod": "./bin/cli.js"
},
"files": [
"/bin",
"/helpers/**/*.js",
"/transforms/no-implicit-this/index.js",
"/transforms/no-implicit-this/helpers/**/*.js"
],
"scripts": {
"build": "tsc",
"clean": "tsc --build --clean",
"codemod": "jscodeshift -t ./transforms/no-implicit-this/index.js --extensions js,ts,hbs --run-in-band",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls",
"debug:codemod": "node --inspect-brk node_modules/jscodeshift/bin/jscodeshift.js -t ./transforms/no-implicit-this/index.js --run-in-band --extensions js,ts,hbs ",
"debug:codemod:not-working": "node --inspect-brk ./bin/cli",
"debug:telemetry": "node --inspect-brk ./bin/telemetry.js",
"lint:js": "eslint .",
"lint:ts": "tsc --noEmit",
"prepublishOnly": "yarn build",
"release": "release-it",
"test": "jest",
"pretest:integration": "yarn build",
"test:integration": "ts-node ./test/run-test.ts",
"update-docs": "codemod-cli update-docs"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"testMatch": [
"<rootDir>/transforms/**/test.js"
"<rootDir>/transforms/**/test.{js,ts}"
]
},
"dependencies": {
"codemod-cli": "^2.1.0",
"@babel/parser": "^7.23.6",
"codemod-cli": "^3.2.0",
"debug": "^4.1.1",
"ember-codemods-telemetry-helpers": "^3.0.0",
"ember-template-recast": "^3.3.2"
"ember-template-recast": "^6.1.4",
"zod": "^3.22.4"
},
"devDependencies": {
"@tsconfig/node16": "^1.0.4",
"@tsconfig/strictest": "^2.0.1",
"@types/babel__core": "^7.20.5",
"@types/chalk": "^2.2.0",
"@types/common-tags": "^1.8.0",
"@types/debug": "^4.1.8",
"@types/jscodeshift": "^0.11.6",
"@types/node": "^20.11.5",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"ast-types": "^0.14.2",
"babel-plugin-htmlbars-inline-precompile": "^3.0.1",
"chalk": "^4.1.1",
"common-tags": "^1.8.0",
Expand All @@ -55,11 +76,12 @@
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.4.0",
"execa": "^3.4.0",
"jest": "^26.6.3",
"jest": "^29.1.0",
"prettier": "^1.19.1",
"release-plan": "^0.6.0",
"ts-node": "^8.10.2",
"typescript": "~3.9.7"
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "~5.0.4"
},
"engines": {
"node": "16.* || 18.* || >= 20"
Expand Down
Loading