From f2d668fc5c877088085164da4e1b30adcb343a75 Mon Sep 17 00:00:00 2001 From: Vincent Scavinner Date: Thu, 26 Oct 2023 15:45:01 +0200 Subject: [PATCH 1/8] feat: add and configure @typescript-eslint on ember-prismic-dom --- ember-prismic-dom/.eslintrc.cjs | 7 +- ember-prismic-dom/package.json | 2 + pnpm-lock.yaml | 213 ++++++++++++++++++++++++++++++++ 3 files changed, 221 insertions(+), 1 deletion(-) diff --git a/ember-prismic-dom/.eslintrc.cjs b/ember-prismic-dom/.eslintrc.cjs index 8df4063a..99abd63b 100644 --- a/ember-prismic-dom/.eslintrc.cjs +++ b/ember-prismic-dom/.eslintrc.cjs @@ -2,7 +2,7 @@ module.exports = { root: true, - parser: '@babel/eslint-parser', + parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 'latest', sourceType: 'module', @@ -42,5 +42,10 @@ module.exports = { plugins: ['node'], extends: ['plugin:node/recommended'], }, + // ts files + { + files: ['**/*.ts'], + extends: ['@qonto/eslint-config-typescript'], + }, ], }; diff --git a/ember-prismic-dom/package.json b/ember-prismic-dom/package.json index 332780a7..5855f536 100644 --- a/ember-prismic-dom/package.json +++ b/ember-prismic-dom/package.json @@ -38,7 +38,9 @@ "@babel/plugin-syntax-decorators": "^7.22.10", "@babel/runtime": "^7.23.2", "@embroider/addon-dev": "^3.0.0", + "@qonto/eslint-config-typescript": "1.0.0-rc.0", "@rollup/plugin-babel": "^6.0.4", + "@typescript-eslint/parser": "^6.9.0", "concurrently": "^8.2.2", "ember-template-lint": "^5.11.2", "eslint": "^8.53.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b7a8002c..3d98792b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,9 +60,15 @@ importers: '@embroider/addon-dev': specifier: ^3.0.0 version: 3.0.0(rollup@3.22.0) + '@qonto/eslint-config-typescript': + specifier: 1.0.0-rc.0 + version: 1.0.0-rc.0(eslint@8.52.0)(typescript@5.2.2) '@rollup/plugin-babel': specifier: ^6.0.4 version: 6.0.4(@babel/core@7.23.2)(rollup@3.22.0) + '@typescript-eslint/parser': + specifier: ^6.9.0 + version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) concurrently: specifier: ^8.2.2 version: 8.2.2 @@ -2238,6 +2244,21 @@ packages: /@prismicio/richtext@1.1.0: resolution: {integrity: sha512-925JuFiZiIkwu9jmlR9O/U8xCSZk/Y6BQDXKpavoVsKo+n90ml1hGdtWkglIupX+ITQO1ZINyDgUgiY1oG9dsA==} + /@qonto/eslint-config-typescript@1.0.0-rc.0(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-laAtWhbOEaJH/Rq649bDM4gUW1OfVMNOgKe1Fg1R0/pCCmQgQ6AP0dz97Yj390HvHC4EDwiaPh8c7+agL/KY8A==} + engines: {node: '>= 18.*'} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + dependencies: + '@typescript-eslint/eslint-plugin': 6.9.1(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + eslint: 8.52.0 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + /@release-it-plugins/lerna-changelog@6.0.0(release-it@16.2.1): resolution: {integrity: sha512-/1xNLriHKKTdM+/LSQIng5V25gipw0brAXtWVQcOBR63NmW/Ftnd2IJpnM5WzFkOCcL9hoqc8rcIMMv1EOcaIg==} engines: {node: '>= 16'} @@ -2530,6 +2551,10 @@ packages: '@types/glob': 8.1.0 '@types/node': 20.2.5 + /@types/semver@7.5.4: + resolution: {integrity: sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==} + dev: true + /@types/send@0.17.1: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: @@ -2551,6 +2576,179 @@ packages: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} dev: true + /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@eslint-community/regexpp': 4.9.1 + '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.9.1 + '@typescript-eslint/type-utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.9.1 + debug: 4.3.4 + eslint: 8.52.0 + graphemer: 1.4.0 + ignore: 5.2.4 + natural-compare: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser@6.9.0(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 6.9.0 + '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.9.0 + debug: 4.3.4 + eslint: 8.52.0 + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/scope-manager@6.9.0: + resolution: {integrity: sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/visitor-keys': 6.9.0 + dev: true + + /@typescript-eslint/scope-manager@6.9.1: + resolution: {integrity: sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/visitor-keys': 6.9.1 + dev: true + + /@typescript-eslint/type-utils@6.9.1(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + debug: 4.3.4 + eslint: 8.52.0 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/types@6.9.0: + resolution: {integrity: sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + + /@typescript-eslint/types@6.9.1: + resolution: {integrity: sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + + /@typescript-eslint/typescript-estree@6.9.0(typescript@5.2.2): + resolution: {integrity: sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/visitor-keys': 6.9.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/typescript-estree@6.9.1(typescript@5.2.2): + resolution: {integrity: sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/visitor-keys': 6.9.1 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.3(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@6.9.1(eslint@8.52.0)(typescript@5.2.2): + resolution: {integrity: sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@types/json-schema': 7.0.12 + '@types/semver': 7.5.4 + '@typescript-eslint/scope-manager': 6.9.1 + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) + eslint: 8.52.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@6.9.0: + resolution: {integrity: sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.9.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@typescript-eslint/visitor-keys@6.9.1: + resolution: {integrity: sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.9.1 + eslint-visitor-keys: 3.4.3 + dev: true + /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true @@ -12770,6 +12968,15 @@ packages: engines: {node: '>=12'} dev: true + /ts-api-utils@1.0.3(typescript@5.2.2): + resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} + engines: {node: '>=16.13.0'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.2.2 + dev: true + /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true @@ -12861,6 +13068,12 @@ packages: /typescript-memoize@1.1.1: resolution: {integrity: sha512-GQ90TcKpIH4XxYTI2F98yEQYZgjNMOGPpOgdjIBhaLaWji5HPWlRnZ4AeA1hfBxtY7bCGDJsqDDHk/KaHOl5bA==} + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + /uc.micro@1.0.6: resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} dev: true From 30c321fbe4f359ae7aa75adc12b60a860b13b4f6 Mon Sep 17 00:00:00 2001 From: Vincent Scavinner Date: Thu, 26 Oct 2023 15:48:22 +0200 Subject: [PATCH 2/8] feat: add and configure @typescript-eslint on test-app --- pnpm-lock.yaml | 37 ++++++++++++++++++++++--------------- test-app/.eslintrc.js | 9 +++++++-- test-app/package.json | 12 +++++++----- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d98792b..0231a663 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,7 +22,7 @@ importers: version: 3.0.3 release-it: specifier: ^16.2.1 - version: 16.2.1 + version: 16.2.1(typescript@5.2.2) ember-prismic-dom: dependencies: @@ -133,6 +133,12 @@ importers: '@prismicio/richtext': specifier: ^1.1.0 version: 1.1.0 + '@qonto/eslint-config-typescript': + specifier: 1.0.0-rc.0 + version: 1.0.0-rc.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/parser': + specifier: ^6.9.0 + version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) broccoli-asset-rev: specifier: ^3.0.0 version: 3.0.0 @@ -234,13 +240,13 @@ importers: version: 2.0.0 release-it: specifier: ^16.2.1 - version: 16.2.1 + version: 16.2.1(typescript@5.2.2) release-it-lerna-changelog: specifier: ^5.0.0 version: 5.0.0(release-it@16.2.1) stylelint: specifier: ^15.11.0 - version: 15.11.0 + version: 15.11.0(typescript@5.2.2) stylelint-config-prettier: specifier: ^9.0.5 version: 9.0.5(stylelint@15.11.0) @@ -2269,7 +2275,7 @@ packages: lerna-changelog: 2.2.0 lodash.template: 4.5.0 mdast-util-from-markdown: 1.3.1 - release-it: 16.2.1 + release-it: 16.2.1(typescript@5.2.2) tmp: 0.2.1 validate-peer-dependencies: 2.2.0 which: 2.0.2 @@ -2286,7 +2292,7 @@ packages: dependencies: detect-indent: 6.1.0 detect-newline: 3.1.0 - release-it: 16.2.1 + release-it: 16.2.1(typescript@5.2.2) semver: 7.5.4 url-join: 4.0.1 validate-peer-dependencies: 1.2.0 @@ -5024,7 +5030,7 @@ packages: vary: 1.1.2 dev: true - /cosmiconfig@8.3.6: + /cosmiconfig@8.3.6(typescript@5.2.2): resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} engines: {node: '>=14'} peerDependencies: @@ -5037,6 +5043,7 @@ packages: js-yaml: 4.1.0 parse-json: 5.2.0 path-type: 4.0.0 + typescript: 5.2.2 dev: true /cross-spawn@6.0.5: @@ -11286,7 +11293,7 @@ packages: lerna-changelog: 2.2.0 lodash.template: 4.5.0 mdast-util-from-markdown: 1.3.1 - release-it: 16.2.1 + release-it: 16.2.1(typescript@5.2.2) tmp: 0.2.1 validate-peer-dependencies: 2.2.0 which: 2.0.2 @@ -11295,7 +11302,7 @@ packages: - supports-color dev: true - /release-it@16.2.1: + /release-it@16.2.1(typescript@5.2.2): resolution: {integrity: sha512-+bHiKPqkpld+NaiW+K/2WsjaHgfPB00J6uk8a+g8QyuBtzfFoMVe+GKsfaDO5ztEHRrSg+7luoXzd8IfvPNPig==} engines: {node: '>=16'} hasBin: true @@ -11304,7 +11311,7 @@ packages: '@octokit/rest': 19.0.13 async-retry: 1.3.3 chalk: 5.3.0 - cosmiconfig: 8.3.6 + cosmiconfig: 8.3.6(typescript@5.2.2) execa: 7.2.0 git-url-parse: 13.1.0 globby: 13.2.2 @@ -12428,7 +12435,7 @@ packages: peerDependencies: stylelint: '>= 11.x < 15' dependencies: - stylelint: 15.11.0 + stylelint: 15.11.0(typescript@5.2.2) dev: true /stylelint-config-recommended@13.0.0(stylelint@15.11.0): @@ -12437,7 +12444,7 @@ packages: peerDependencies: stylelint: ^15.10.0 dependencies: - stylelint: 15.11.0 + stylelint: 15.11.0(typescript@5.2.2) dev: true /stylelint-config-standard@34.0.0(stylelint@15.11.0): @@ -12446,7 +12453,7 @@ packages: peerDependencies: stylelint: ^15.10.0 dependencies: - stylelint: 15.11.0 + stylelint: 15.11.0(typescript@5.2.2) stylelint-config-recommended: 13.0.0(stylelint@15.11.0) dev: true @@ -12459,10 +12466,10 @@ packages: dependencies: prettier: 3.0.3 prettier-linter-helpers: 1.0.0 - stylelint: 15.11.0 + stylelint: 15.11.0(typescript@5.2.2) dev: true - /stylelint@15.11.0: + /stylelint@15.11.0(typescript@5.2.2): resolution: {integrity: sha512-78O4c6IswZ9TzpcIiQJIN49K3qNoXTM8zEJzhaTE/xRTCZswaovSEVIa/uwbOltZrk16X4jAxjaOhzz/hTm1Kw==} engines: {node: ^14.13.1 || >=16.0.0} hasBin: true @@ -12473,7 +12480,7 @@ packages: '@csstools/selector-specificity': 3.0.0(postcss-selector-parser@6.0.13) balanced-match: 2.0.0 colord: 2.9.3 - cosmiconfig: 8.3.6 + cosmiconfig: 8.3.6(typescript@5.2.2) css-functions-list: 3.2.1 css-tree: 2.3.1 debug: 4.3.4 diff --git a/test-app/.eslintrc.js b/test-app/.eslintrc.js index cadd243f..e08057c7 100644 --- a/test-app/.eslintrc.js +++ b/test-app/.eslintrc.js @@ -2,7 +2,7 @@ module.exports = { root: true, - parser: '@babel/eslint-parser', + parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 'latest', sourceType: 'module', @@ -47,11 +47,16 @@ module.exports = { }, extends: ['plugin:n/recommended'], }, + // test files { - // test files files: ['tests/**/*-test.{js,ts}'], extends: ['plugin:qunit/recommended'], rules: { 'ember/no-empty-glimmer-component-classes': 'off' }, }, + // ts files + { + files: ['**/*.ts'], + extends: ['@qonto/eslint-config-typescript'], + }, ], }; diff --git a/test-app/package.json b/test-app/package.json index 754220f1..424c4013 100644 --- a/test-app/package.json +++ b/test-app/package.json @@ -33,6 +33,9 @@ "@embroider/test-setup": "3.0.2", "@glimmer/component": "^1.1.2", "@glimmer/tracking": "^1.1.2", + "@prismicio/richtext": "^1.1.0", + "@qonto/eslint-config-typescript": "1.0.0-rc.0", + "@typescript-eslint/parser": "^6.9.0", "broccoli-asset-rev": "^3.0.0", "concurrently": "^8.2.2", "ember-auto-import": "^2.6.3", @@ -61,20 +64,19 @@ "eslint-plugin-n": "^16.2.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-qunit": "^7.3.4", + "lerna-changelog": "^2.2.0", "loader.js": "^4.7.0", "prettier": "^3.0.3", "qunit": "^2.20.0", "qunit-dom": "^2.0.0", + "release-it": "^16.2.1", + "release-it-lerna-changelog": "^5.0.0", "stylelint": "^15.11.0", "stylelint-config-prettier": "^9.0.5", "stylelint-config-standard": "^34.0.0", "stylelint-prettier": "^4.0.2", "tracked-built-ins": "^3.3.0", - "webpack": "^5.89.0", - "@prismicio/richtext": "^1.1.0", - "lerna-changelog": "^2.2.0", - "release-it": "^16.2.1", - "release-it-lerna-changelog": "^5.0.0" + "webpack": "^5.89.0" }, "engines": { "node": "16.* || >= 18" From 2e35463610a248912d2fb616ede4976d95caf635 Mon Sep 17 00:00:00 2001 From: Vincent Scavinner Date: Thu, 26 Oct 2023 15:50:08 +0200 Subject: [PATCH 3/8] feat: add TypeScript and its configuration to ember-prismic-dom --- ember-prismic-dom/package.json | 4 +++- ember-prismic-dom/tsconfig.json | 9 +++++++++ pnpm-lock.yaml | 10 ++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 ember-prismic-dom/tsconfig.json diff --git a/ember-prismic-dom/package.json b/ember-prismic-dom/package.json index 5855f536..d4422b89 100644 --- a/ember-prismic-dom/package.json +++ b/ember-prismic-dom/package.json @@ -40,6 +40,7 @@ "@embroider/addon-dev": "^3.0.0", "@qonto/eslint-config-typescript": "1.0.0-rc.0", "@rollup/plugin-babel": "^6.0.4", + "@tsconfig/ember": "^3.0.1", "@typescript-eslint/parser": "^6.9.0", "concurrently": "^8.2.2", "ember-template-lint": "^5.11.2", @@ -50,7 +51,8 @@ "eslint-plugin-prettier": "^5.0.1", "prettier": "^3.0.3", "rollup": "^3.22.0", - "rollup-plugin-copy": "^3.5.0" + "rollup-plugin-copy": "^3.5.0", + "typescript": "^5.2.2" }, "publishConfig": { "registry": "https://registry.npmjs.org" diff --git a/ember-prismic-dom/tsconfig.json b/ember-prismic-dom/tsconfig.json new file mode 100644 index 00000000..ab3b60da --- /dev/null +++ b/ember-prismic-dom/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@tsconfig/ember/tsconfig.json", + "include": ["src/**/*"], + "compilerOptions": { + "allowJs": true, + "declarationDir": "declarations", + "skipLibCheck": true + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0231a663..3a222078 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -66,6 +66,9 @@ importers: '@rollup/plugin-babel': specifier: ^6.0.4 version: 6.0.4(@babel/core@7.23.2)(rollup@3.22.0) + '@tsconfig/ember': + specifier: ^3.0.1 + version: 3.0.1 '@typescript-eslint/parser': specifier: ^6.9.0 version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) @@ -99,6 +102,9 @@ importers: rollup-plugin-copy: specifier: ^3.5.0 version: 3.5.0 + typescript: + specifier: ^5.2.2 + version: 5.2.2 test-app: dependencies: @@ -2383,6 +2389,10 @@ packages: resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==} dev: true + /@tsconfig/ember@3.0.1: + resolution: {integrity: sha512-IBoECN9o9StxTZSy12eNSPdqiH5VzngD5Qx9YQDfteiXk9XyJhnyRQuBoU/MQCVnqau9fJpgKoA8Sy/0qItFXw==} + dev: true + /@types/acorn@4.0.6: resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} dependencies: From 4cc02da576a7f88c7b8b482fefb7cbb82f63b71d Mon Sep 17 00:00:00 2001 From: Vincent Scavinner Date: Thu, 26 Oct 2023 15:52:07 +0200 Subject: [PATCH 4/8] feat: import ember preview types in ember-prismic-dom --- ember-prismic-dom/src/unpublished-development-types/index.d.ts | 2 ++ ember-prismic-dom/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 ember-prismic-dom/src/unpublished-development-types/index.d.ts diff --git a/ember-prismic-dom/src/unpublished-development-types/index.d.ts b/ember-prismic-dom/src/unpublished-development-types/index.d.ts new file mode 100644 index 00000000..2109bac6 --- /dev/null +++ b/ember-prismic-dom/src/unpublished-development-types/index.d.ts @@ -0,0 +1,2 @@ +import 'ember-source/types'; +import 'ember-source/types/preview'; diff --git a/ember-prismic-dom/tsconfig.json b/ember-prismic-dom/tsconfig.json index ab3b60da..777f9a12 100644 --- a/ember-prismic-dom/tsconfig.json +++ b/ember-prismic-dom/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "@tsconfig/ember/tsconfig.json", - "include": ["src/**/*"], + "include": ["src/**/*", "unpublished-development-types/**/*"], "compilerOptions": { "allowJs": true, "declarationDir": "declarations", From d2493bc545a75634f45c7eacec459d08d0493aee Mon Sep 17 00:00:00 2001 From: Vincent Scavinner Date: Thu, 26 Oct 2023 16:01:08 +0200 Subject: [PATCH 5/8] feat: add glint to ember-prismic-dom --- .gitignore | 1 + ember-prismic-dom/.eslintignore | 1 + ember-prismic-dom/.prettierignore | 1 + ember-prismic-dom/package.json | 26 ++- ember-prismic-dom/rollup.config.mjs | 22 +-- .../unpublished-development-types/index.d.ts | 8 + ember-prismic-dom/tsconfig.json | 3 + pnpm-lock.yaml | 148 +++++++++++++++--- 8 files changed, 171 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index ec933ae1..3671a941 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # compiled output dist/ .pnpm-store/ +declarations/ # dependencies node_modules/ diff --git a/ember-prismic-dom/.eslintignore b/ember-prismic-dom/.eslintignore index e69140be..4e982747 100644 --- a/ember-prismic-dom/.eslintignore +++ b/ember-prismic-dom/.eslintignore @@ -3,6 +3,7 @@ # compiled output /dist/ +/declarations/ # misc /coverage/ diff --git a/ember-prismic-dom/.prettierignore b/ember-prismic-dom/.prettierignore index 4178fd57..2d1b8715 100644 --- a/ember-prismic-dom/.prettierignore +++ b/ember-prismic-dom/.prettierignore @@ -4,6 +4,7 @@ # compiled output /dist/ +/declarations/ /tmp/ # dependencies diff --git a/ember-prismic-dom/package.json b/ember-prismic-dom/package.json index d4422b89..052e8413 100644 --- a/ember-prismic-dom/package.json +++ b/ember-prismic-dom/package.json @@ -10,6 +10,7 @@ "author": "", "files": [ "addon-main.cjs", + "declarations", "dist" ], "scripts": { @@ -18,9 +19,12 @@ "lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'", "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern", "lint:js": "eslint . --cache", + "lint:types": "glint", "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern", "lint:js:fix": "eslint . --fix", - "start": "rollup --config --watch", + "start": "concurrently 'pnpm:start:*'", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "glint -d --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "prepack": "rollup --config", "prepare": "rollup --config" @@ -38,6 +42,9 @@ "@babel/plugin-syntax-decorators": "^7.22.10", "@babel/runtime": "^7.23.2", "@embroider/addon-dev": "^3.0.0", + "@glint/core": "^1.2.1", + "@glint/environment-ember-loose": "^1.2.1", + "@glint/template": "^1.2.1", "@qonto/eslint-config-typescript": "1.0.0-rc.0", "@rollup/plugin-babel": "^6.0.4", "@tsconfig/ember": "^3.0.1", @@ -73,10 +80,23 @@ } }, "exports": { - ".": "./dist/index.js", - "./*": "./dist/*.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, + "./*": { + "types": "./declarations/*.d.ts", + "default": "./dist/*.js" + }, "./addon-main.js": "./addon-main.cjs" }, + "typesVersions": { + "*": { + "*": [ + "declarations/*" + ] + } + }, "peerDependencies": { "ember-source": "^3.28.0 || ^4.0.0" } diff --git a/ember-prismic-dom/rollup.config.mjs b/ember-prismic-dom/rollup.config.mjs index 48bc7650..1134d54d 100644 --- a/ember-prismic-dom/rollup.config.mjs +++ b/ember-prismic-dom/rollup.config.mjs @@ -1,10 +1,10 @@ -import { babel } from "@rollup/plugin-babel"; -import copy from "rollup-plugin-copy"; -import { Addon } from "@embroider/addon-dev/rollup"; +import { babel } from '@rollup/plugin-babel'; +import copy from 'rollup-plugin-copy'; +import { Addon } from '@embroider/addon-dev/rollup'; const addon = new Addon({ - srcDir: "src", - destDir: "dist", + srcDir: 'src', + destDir: 'dist', }); export default { @@ -15,12 +15,12 @@ export default { plugins: [ // These are the modules that users should be able to import from your // addon. Anything not listed here may get optimized away. - addon.publicEntrypoints(["index.js", "**/*.js"]), + addon.publicEntrypoints(['index.js', '**/*.js']), // These are the modules that should get reexported into the traditional // "app" tree. Things in here should also be in publicEntrypoints above, but // not everything in publicEntrypoints necessarily needs to go here. - addon.appReexports(["components/**/*.js", "helpers/**/*.js"]), + addon.appReexports(['components/**/*.js', 'helpers/**/*.js']), // Follow the V2 Addon rules about dependencies. Your code can import from // `dependencies` and `peerDependencies` as well as standard Ember-provided @@ -34,7 +34,7 @@ export default { // By default, this will load the actual babel config from the file // babel.config.json. babel({ - babelHelpers: "bundled", + babelHelpers: 'bundled', }), // Ensure that standalone .hbs files are properly integrated as Javascript. @@ -42,7 +42,7 @@ export default { // addons are allowed to contain imports of .css files, which we want rollup // to leave alone and keep in the published output. - addon.keepAssets(["**/*.css"]), + addon.keepAssets(['**/*.css']), // Remove leftover build artifacts when starting a new build. addon.clean(), @@ -50,8 +50,8 @@ export default { // Copy Readme and License into published package copy({ targets: [ - { src: "../README.md", dest: "." }, - { src: "../LICENSE.md", dest: "." }, + { src: '../README.md', dest: '.' }, + { src: '../LICENSE.md', dest: '.' }, ], }), ], diff --git a/ember-prismic-dom/src/unpublished-development-types/index.d.ts b/ember-prismic-dom/src/unpublished-development-types/index.d.ts index 2109bac6..e415a720 100644 --- a/ember-prismic-dom/src/unpublished-development-types/index.d.ts +++ b/ember-prismic-dom/src/unpublished-development-types/index.d.ts @@ -1,2 +1,10 @@ +import '@glint/environment-ember-loose'; import 'ember-source/types'; import 'ember-source/types/preview'; + +declare module '@glint/environment-ember-loose/registry' { + export default interface Registry { + // Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates) + // See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons + } +} diff --git a/ember-prismic-dom/tsconfig.json b/ember-prismic-dom/tsconfig.json index 777f9a12..fa7eb7fe 100644 --- a/ember-prismic-dom/tsconfig.json +++ b/ember-prismic-dom/tsconfig.json @@ -1,6 +1,9 @@ { "extends": "@tsconfig/ember/tsconfig.json", "include": ["src/**/*", "unpublished-development-types/**/*"], + "glint": { + "environment": "ember-loose" + }, "compilerOptions": { "allowJs": true, "declarationDir": "declarations", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3a222078..165fbb5d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,10 +34,10 @@ importers: version: 1.1.0 ember-element-helper: specifier: ^0.8.5 - version: 0.8.5(ember-source@4.12.0) + version: 0.8.5(@glint/environment-ember-loose@1.2.1)(@glint/template@1.2.1)(ember-source@4.12.0) ember-source: specifier: ^3.28.0 || ^4.0.0 - version: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + version: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) devDependencies: '@babel/core': specifier: 7.23.2 @@ -60,6 +60,15 @@ importers: '@embroider/addon-dev': specifier: ^3.0.0 version: 3.0.0(rollup@3.22.0) + '@glint/core': + specifier: ^1.2.1 + version: 1.2.1(typescript@5.2.2) + '@glint/environment-ember-loose': + specifier: ^1.2.1 + version: 1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1) + '@glint/template': + specifier: ^1.2.1 + version: 1.2.1 '@qonto/eslint-config-typescript': specifier: 1.0.0-rc.0 version: 1.0.0-rc.0(eslint@8.52.0)(typescript@5.2.2) @@ -153,7 +162,7 @@ importers: version: 8.2.2 ember-auto-import: specifier: ^2.6.3 - version: 2.6.3(webpack@5.89.0) + version: 2.6.3(@glint/template@1.2.1)(webpack@5.89.0) ember-cli: specifier: ~4.12.2 version: 4.12.2 @@ -201,7 +210,7 @@ importers: version: 11.0.1(ember-source@4.12.0) ember-source: specifier: ~4.12.0 - version: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + version: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) ember-source-channel-url: specifier: ^3.0.0 version: 3.0.0 @@ -1579,14 +1588,14 @@ packages: ember-source: ^4.0.0 || ^5.0.0 dependencies: '@ember/test-waiters': 3.0.2 - '@embroider/macros': 1.13.2 + '@embroider/macros': 1.13.2(@glint/template@1.2.1) '@simple-dom/interface': 1.4.0 broccoli-debug: 0.6.5 broccoli-funnel: 3.0.8 - ember-auto-import: 2.6.3(webpack@5.89.0) + ember-auto-import: 2.6.3(@glint/template@1.2.1)(webpack@5.89.0) ember-cli-babel: 7.26.11 ember-cli-htmlbars: 6.3.0 - ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) transitivePeerDependencies: - '@glint/template' - supports-color @@ -1701,7 +1710,7 @@ packages: - supports-color dev: true - /@embroider/macros@1.11.0: + /@embroider/macros@1.11.0(@glint/template@1.2.1): resolution: {integrity: sha512-P/WSB+PqKSja5qXjYvhLyUM0ivcDoI9kkqs+R0GNujfVhS0EIIAMHfD9uHDBbhzFit39pT0QJqgcXGE2rprCPA==} engines: {node: 12.* || 14.* || >= 16} peerDependencies: @@ -1711,6 +1720,7 @@ packages: optional: true dependencies: '@embroider/shared-internals': 2.1.0 + '@glint/template': 1.2.1 assert-never: 1.2.1 babel-import-util: 1.3.0 ember-cli-babel: 7.26.11 @@ -1721,7 +1731,7 @@ packages: transitivePeerDependencies: - supports-color - /@embroider/macros@1.13.2: + /@embroider/macros@1.13.2(@glint/template@1.2.1): resolution: {integrity: sha512-AUgJ71xG8kjuTx8XB1AQNBiebJuXRfhcHr318dCwnQz9VRXdYSnEEqf38XRvGYIoCvIyn/3c72LrSwzaJqknOA==} engines: {node: 12.* || 14.* || >= 16} peerDependencies: @@ -1731,6 +1741,7 @@ packages: optional: true dependencies: '@embroider/shared-internals': 2.5.0 + '@glint/template': 1.2.1 assert-never: 1.2.1 babel-import-util: 2.0.1 ember-cli-babel: 7.26.11 @@ -1817,7 +1828,7 @@ packages: resolve: 1.22.3 dev: true - /@embroider/util@1.11.0(ember-source@4.12.0): + /@embroider/util@1.11.0(@glint/environment-ember-loose@1.2.1)(@glint/template@1.2.1)(ember-source@4.12.0): resolution: {integrity: sha512-v6Jdjl87jzsAtYgU/xkx+7CykoC06E6qd3j8ULe8jC8hVXKkjWR7Nks5D5V970/fravGd/FMOT3tVIF3Dj5yaw==} engines: {node: 14.* || >= 16} peerDependencies: @@ -1830,10 +1841,12 @@ packages: '@glint/template': optional: true dependencies: - '@embroider/macros': 1.13.2 + '@embroider/macros': 1.13.2(@glint/template@1.2.1) + '@glint/environment-ember-loose': 1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1) + '@glint/template': 1.2.1 broccoli-funnel: 3.0.8 ember-cli-babel: 7.26.11 - ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) transitivePeerDependencies: - supports-color dev: false @@ -1974,6 +1987,60 @@ packages: transitivePeerDependencies: - '@babel/core' + /@glint/core@1.2.1(typescript@5.2.2): + resolution: {integrity: sha512-25Zn65aLSN1M7s0D950sTNElZYRqa6HFA0xcT03iI/vQd1F6c3luMAXbFrsTSHlktZx2dqJ38c2dUnZJQBQgMw==} + hasBin: true + peerDependencies: + typescript: '>=4.8.0' + dependencies: + '@glimmer/syntax': 0.84.3 + escape-string-regexp: 4.0.0 + semver: 7.5.4 + silent-error: 1.1.1 + typescript: 5.2.2 + uuid: 8.3.2 + vscode-languageserver: 8.1.0 + vscode-languageserver-textdocument: 1.0.11 + vscode-uri: 3.0.8 + yargs: 17.7.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@glint/environment-ember-loose@1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1): + resolution: {integrity: sha512-ZA0Ht7vwd1FosVLtMFrB2Er62P1v6yX/UuS6z9UVR6DMPfrL5qx6vef+EGJPLBrBKZMlm7zMB6Fyca201y4hDA==} + peerDependencies: + '@glimmer/component': ^1.1.2 + '@glint/template': ^1.2.1 + '@types/ember__array': ^4.0.2 + '@types/ember__component': ^4.0.10 + '@types/ember__controller': ^4.0.2 + '@types/ember__object': ^4.0.4 + '@types/ember__routing': ^4.0.11 + ember-cli-htmlbars: ^6.0.1 + ember-modifier: ^3.2.7 || ^4.0.0 + peerDependenciesMeta: + '@types/ember__array': + optional: true + '@types/ember__component': + optional: true + '@types/ember__controller': + optional: true + '@types/ember__object': + optional: true + '@types/ember__routing': + optional: true + ember-cli-htmlbars: + optional: true + ember-modifier: + optional: true + dependencies: + '@glimmer/component': 1.1.2(@babel/core@7.23.2) + '@glint/template': 1.2.1 + + /@glint/template@1.2.1: + resolution: {integrity: sha512-rlYy/93fAhYjXmTchWcwCpPFMfrqBYEskzbDYawS2oz4DVwtf4fOITLKB0QddQMI7WUCjgXAiIGZqcNa/R4YeQ==} + /@handlebars/parser@2.0.0: resolution: {integrity: sha512-EP9uEDZv/L5Qh9IWuMUGJRfwhXJ4h1dqKTT4/3+tY0eu7sPis7xh23j61SYUnNF4vqCQvvUXpDo9Bh/+q1zASA==} dev: true @@ -5483,7 +5550,7 @@ packages: /electron-to-chromium@1.4.537: resolution: {integrity: sha512-W1+g9qs9hviII0HAwOdehGYkr+zt7KKdmCcJcjH0mYg6oL8+ioT3Skjmt7BLoAQqXhjf40AXd+HlR4oAWMlXjA==} - /ember-auto-import@2.6.3(webpack@5.89.0): + /ember-auto-import@2.6.3(@glint/template@1.2.1)(webpack@5.89.0): resolution: {integrity: sha512-uLhrRDJYWCRvQ4JQ1e64XlSrqAKSd6PXaJ9ZsZI6Tlms9T4DtQFxNXasqji2ZRJBVrxEoLCRYX3RTldsQ0vNGQ==} engines: {node: 12.* || 14.* || >= 16} dependencies: @@ -5491,7 +5558,7 @@ packages: '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.23.2) '@babel/plugin-proposal-decorators': 7.23.2(@babel/core@7.23.2) '@babel/preset-env': 7.22.4(@babel/core@7.23.2) - '@embroider/macros': 1.11.0 + '@embroider/macros': 1.11.0(@glint/template@1.2.1) '@embroider/shared-internals': 2.5.0 babel-loader: 8.3.0(@babel/core@7.23.2)(webpack@5.89.0) babel-plugin-ember-modules-api-polyfill: 3.5.0 @@ -5530,7 +5597,7 @@ packages: ember-source: ^3.28.0 || >= 4.0.0 dependencies: ember-cli-babel: 7.26.11 - ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) git-repo-info: 2.1.1 transitivePeerDependencies: - supports-color @@ -6015,15 +6082,15 @@ packages: engines: {node: '>= 0.10.0'} dev: true - /ember-element-helper@0.8.5(ember-source@4.12.0): + /ember-element-helper@0.8.5(@glint/environment-ember-loose@1.2.1)(@glint/template@1.2.1)(ember-source@4.12.0): resolution: {integrity: sha512-yZYzuasn6ZC8Nwv0MpaLYGtm68ZxIBSNSe/CYxNWkDdgcuAb2lAG1gx37XkwBIiwPQET0W2agwq7++/HwdMF8g==} engines: {node: 14.* || 16.* || >= 18} peerDependencies: ember-source: ^3.8 || ^4.0.0 || >= 5.0.0 dependencies: '@embroider/addon-shim': 1.8.3 - '@embroider/util': 1.11.0(ember-source@4.12.0) - ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + '@embroider/util': 1.11.0(@glint/environment-ember-loose@1.2.1)(@glint/template@1.2.1)(ember-source@4.12.0) + ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) transitivePeerDependencies: - '@glint/environment-ember-loose' - '@glint/template' @@ -6075,7 +6142,7 @@ packages: '@embroider/addon-shim': 1.8.6 ember-cli-normalize-entity-name: 1.0.0 ember-cli-string-utils: 1.1.0 - ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) transitivePeerDependencies: - supports-color dev: true @@ -6087,7 +6154,7 @@ packages: ember-source: '>= 3.28.0' dependencies: '@embroider/addon-shim': 1.8.6 - ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) transitivePeerDependencies: - supports-color dev: true @@ -6101,9 +6168,9 @@ packages: dependencies: '@ember/test-helpers': 3.2.0(ember-source@4.12.0)(webpack@5.89.0) '@embroider/addon-shim': 1.8.6 - '@embroider/macros': 1.13.2 + '@embroider/macros': 1.13.2(@glint/template@1.2.1) ember-cli-test-loader: 3.1.0 - ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) qunit: 2.20.0 transitivePeerDependencies: - '@glint/template' @@ -6120,7 +6187,7 @@ packages: optional: true dependencies: ember-cli-babel: 7.26.11 - ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0) + ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) transitivePeerDependencies: - supports-color dev: true @@ -6148,7 +6215,7 @@ packages: - encoding dev: true - /ember-source@4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(webpack@5.89.0): + /ember-source@4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0): resolution: {integrity: sha512-h0lV902A4Mny2eiqXPy15uXXoCc7BnUegE4axLAy4IoxEkJ1o5h0aLJFiB4Tzb1htx8vgHjJz//Y5Jig7NSDTw==} engines: {node: '>= 14.*'} peerDependencies: @@ -6167,7 +6234,7 @@ packages: broccoli-funnel: 3.0.8 broccoli-merge-trees: 4.2.0 chalk: 4.1.2 - ember-auto-import: 2.6.3(webpack@5.89.0) + ember-auto-import: 2.6.3(@glint/template@1.2.1)(webpack@5.89.0) ember-cli-babel: 7.26.11 ember-cli-get-component-path-option: 1.0.0 ember-cli-is-package-missing: 1.0.0 @@ -13366,6 +13433,37 @@ packages: engines: {node: '>= 0.8'} dev: true + /vscode-jsonrpc@8.1.0: + resolution: {integrity: sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==} + engines: {node: '>=14.0.0'} + dev: true + + /vscode-languageserver-protocol@3.17.3: + resolution: {integrity: sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==} + dependencies: + vscode-jsonrpc: 8.1.0 + vscode-languageserver-types: 3.17.3 + dev: true + + /vscode-languageserver-textdocument@1.0.11: + resolution: {integrity: sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==} + dev: true + + /vscode-languageserver-types@3.17.3: + resolution: {integrity: sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==} + dev: true + + /vscode-languageserver@8.1.0: + resolution: {integrity: sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==} + hasBin: true + dependencies: + vscode-languageserver-protocol: 3.17.3 + dev: true + + /vscode-uri@3.0.8: + resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} + dev: true + /w3c-hr-time@1.0.2: resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==} deprecated: Use your platform's native performance.now() and performance.timeOrigin. From 241012f3405c9e5c2640270f54acc1f1d22c1c35 Mon Sep 17 00:00:00 2001 From: Vincent Scavinner Date: Fri, 3 Nov 2023 16:36:36 +0100 Subject: [PATCH 6/8] feat: build addon using Babel TypeScript preset --- ember-prismic-dom/babel.config.json | 1 + ember-prismic-dom/package.json | 5 +- ember-prismic-dom/rollup.config.mjs | 6 +- .../src/components/prismic/children.hbs | 1 + .../src/components/prismic/dom.hbs | 1 + .../src/components/prismic/element.hbs | 1 + .../src/components/prismic/image.hbs | 1 + pnpm-lock.yaml | 62 +++++++++++++++++++ 8 files changed, 76 insertions(+), 2 deletions(-) diff --git a/ember-prismic-dom/babel.config.json b/ember-prismic-dom/babel.config.json index cfcf8a3c..739f8261 100644 --- a/ember-prismic-dom/babel.config.json +++ b/ember-prismic-dom/babel.config.json @@ -1,4 +1,5 @@ { + "presets": [["@babel/preset-typescript"]], "plugins": [ "@embroider/addon-dev/template-colocation-plugin", ["@babel/plugin-proposal-decorators", { "legacy": true }], diff --git a/ember-prismic-dom/package.json b/ember-prismic-dom/package.json index 052e8413..6c511c06 100644 --- a/ember-prismic-dom/package.json +++ b/ember-prismic-dom/package.json @@ -14,7 +14,9 @@ "dist" ], "scripts": { - "build": "rollup --config", + "build": "concurrently 'pnpm:build:*'", + "build:js": "rollup --config", + "build:types": "glint --declaration", "lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'", "lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'", "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern", @@ -40,6 +42,7 @@ "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-decorators": "^7.23.2", "@babel/plugin-syntax-decorators": "^7.22.10", + "@babel/preset-typescript": "^7.23.2", "@babel/runtime": "^7.23.2", "@embroider/addon-dev": "^3.0.0", "@glint/core": "^1.2.1", diff --git a/ember-prismic-dom/rollup.config.mjs b/ember-prismic-dom/rollup.config.mjs index 1134d54d..fe347f66 100644 --- a/ember-prismic-dom/rollup.config.mjs +++ b/ember-prismic-dom/rollup.config.mjs @@ -7,6 +7,9 @@ const addon = new Addon({ destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -15,7 +18,7 @@ export default { plugins: [ // These are the modules that users should be able to import from your // addon. Anything not listed here may get optimized away. - addon.publicEntrypoints(['index.js', '**/*.js']), + addon.publicEntrypoints(['components/**/*.js', 'helpers/**/*.js']), // These are the modules that should get reexported into the traditional // "app" tree. Things in here should also be in publicEntrypoints above, but @@ -34,6 +37,7 @@ export default { // By default, this will load the actual babel config from the file // babel.config.json. babel({ + extensions, babelHelpers: 'bundled', }), diff --git a/ember-prismic-dom/src/components/prismic/children.hbs b/ember-prismic-dom/src/components/prismic/children.hbs index 6b523f21..0d01d72c 100644 --- a/ember-prismic-dom/src/components/prismic/children.hbs +++ b/ember-prismic-dom/src/components/prismic/children.hbs @@ -1,3 +1,4 @@ +{{! @glint-nocheck: not typesafe yet }} {{~#each @node.children as |child|~}} {{~#if this.isString~}} {{@nodes}} diff --git a/ember-prismic-dom/src/components/prismic/element.hbs b/ember-prismic-dom/src/components/prismic/element.hbs index 0c09d210..9a7474cb 100644 --- a/ember-prismic-dom/src/components/prismic/element.hbs +++ b/ember-prismic-dom/src/components/prismic/element.hbs @@ -1,3 +1,4 @@ +{{! @glint-nocheck: not typesafe yet }} {{~#if this.isCustom~}} {{~#let (ensure-safe-component this.componentName) as |CustomComponent|~}} {{~#CustomComponent node=@node~}} diff --git a/ember-prismic-dom/src/components/prismic/image.hbs b/ember-prismic-dom/src/components/prismic/image.hbs index c5a91214..b8813d6d 100644 --- a/ember-prismic-dom/src/components/prismic/image.hbs +++ b/ember-prismic-dom/src/components/prismic/image.hbs @@ -1,3 +1,4 @@ +{{! @glint-nocheck: not typesafe yet }} {{~#if @node.element.linkUrl~}} =6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.23.2): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: @@ -800,6 +813,16 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.23.2): + resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-plugin-utils': 7.22.5 + dev: true + /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.23.2): resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} engines: {node: '>=6.9.0'} @@ -1049,6 +1072,18 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-simple-access': 7.22.5 + /@babel/plugin-transform-modules-commonjs@7.23.0(@babel/core@7.23.2): + resolution: {integrity: sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-module-transforms': 7.23.0(@babel/core@7.23.2) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 + dev: true + /@babel/plugin-transform-modules-systemjs@7.22.3(@babel/core@7.23.2): resolution: {integrity: sha512-V21W3bKLxO3ZjcBJZ8biSvo5gQ85uIXW2vJfh7JSWf/4SLUSr1tOoHX3ruN4+Oqa2m+BKfsxTR1I+PsvkIWvNw==} engines: {node: '>=6.9.0'} @@ -1275,6 +1310,19 @@ packages: '@babel/core': 7.23.2 '@babel/helper-plugin-utils': 7.22.5 + /@babel/plugin-transform-typescript@7.22.15(@babel/core@7.23.2): + resolution: {integrity: sha512-1uirS0TnijxvQLnlv5wQBwOX3E1wCFX7ITv+9pBV2wKEk4K+M5tqDaoNXnTH8tjEIYHLO98MwiTWO04Ggz4XuA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.22.15(@babel/core@7.23.2) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.23.2) + dev: true + /@babel/plugin-transform-typescript@7.22.3(@babel/core@7.23.2): resolution: {integrity: sha512-pyjnCIniO5PNaEuGxT28h0HbMru3qCVrMqVgVOz/krComdIrY9W6FCLBq9NWHY8HDGaUlan+UhmZElDENIfCcw==} engines: {node: '>=6.9.0'} @@ -1455,6 +1503,20 @@ packages: '@babel/types': 7.23.0 esutils: 2.0.3 + /@babel/preset-typescript@7.23.2(@babel/core@7.23.2): + resolution: {integrity: sha512-u4UJc1XsS1GhIGteM8rnGiIvf9rJpiVgMEeCnwlLA7WJPC+jcXWJAGxYmeqs5hOZD8BbAfnV5ezBOxQbb4OUxA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.23.2 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.22.15 + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.23.2) + '@babel/plugin-transform-modules-commonjs': 7.23.0(@babel/core@7.23.2) + '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.23.2) + dev: true + /@babel/regjsgen@0.8.0: resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} From ed6da2bec045b8d1028102ef4a384361ebae4742 Mon Sep 17 00:00:00 2001 From: Vincent Scavinner Date: Fri, 3 Nov 2023 16:39:57 +0100 Subject: [PATCH 7/8] feat: add TypeScript and its configuration to test-app --- pnpm-lock.yaml | 34 ++++++++++++++++++++++++++++ test-app/app/config/environment.d.ts | 13 +++++++++++ test-app/package.json | 4 ++++ test-app/tsconfig.json | 17 ++++++++++++++ test-app/types/test-app/index.d.ts | 2 ++ 5 files changed, 70 insertions(+) create mode 100644 test-app/app/config/environment.d.ts create mode 100644 test-app/tsconfig.json create mode 100644 test-app/types/test-app/index.d.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 02234761..2c713870 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -154,6 +154,12 @@ importers: '@qonto/eslint-config-typescript': specifier: 1.0.0-rc.0 version: 1.0.0-rc.0(eslint@8.52.0)(typescript@5.2.2) + '@tsconfig/ember': + specifier: ^3.0.1 + version: 3.0.1 + '@types/qunit': + specifier: ^2.19.7 + version: 2.19.7 '@typescript-eslint/parser': specifier: ^6.9.0 version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) @@ -190,6 +196,9 @@ importers: ember-cli-terser: specifier: ^4.0.2 version: 4.0.2 + ember-cli-typescript: + specifier: ^5.2.1 + version: 5.2.1 ember-disable-prototype-extensions: specifier: ^1.1.3 version: 1.1.3 @@ -277,6 +286,9 @@ importers: tracked-built-ins: specifier: ^3.3.0 version: 3.3.0 + typescript: + specifier: ^5.2.2 + version: 5.2.2 webpack: specifier: ^5.89.0 version: 5.89.0 @@ -2680,6 +2692,10 @@ packages: resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} dev: true + /@types/qunit@2.19.7: + resolution: {integrity: sha512-Vf1+zHCOhMyDqZqM6zlB++6n5mkMe1+pWH1l3fzbzakQ2VImMNeAKSQD++RAjpGTqPUio8Tre2a6kmq6O1tK/A==} + dev: true + /@types/range-parser@1.2.4: resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} dev: true @@ -5942,6 +5958,24 @@ packages: - supports-color dev: true + /ember-cli-typescript@5.2.1: + resolution: {integrity: sha512-qqp5TAIuPHxHiGXJKL+78Euyhy0zSKQMovPh8sJpN/ZBYx0H90pONufHR3anaMcp1snVfx4B+mb9+7ijOik8ZA==} + engines: {node: '>= 12.*'} + dependencies: + ansi-to-html: 0.6.15 + broccoli-stew: 3.0.0 + debug: 4.3.4 + execa: 4.1.0 + fs-extra: 9.1.0 + resolve: 1.22.3 + rsvp: 4.8.5 + semver: 7.5.4 + stagehand: 1.0.1 + walk-sync: 2.2.0 + transitivePeerDependencies: + - supports-color + dev: true + /ember-cli-version-checker@3.1.3: resolution: {integrity: sha512-PZNSvpzwWgv68hcXxyjREpj3WWb81A7rtYNQq1lLEgrWIchF8ApKJjWP3NBpHjaatwILkZAV8klair5WFlXAKg==} engines: {node: 6.* || 8.* || >= 10.*} diff --git a/test-app/app/config/environment.d.ts b/test-app/app/config/environment.d.ts new file mode 100644 index 00000000..fbda509a --- /dev/null +++ b/test-app/app/config/environment.d.ts @@ -0,0 +1,13 @@ +export default config; + +/** + * Type declarations for import config from 'my-app/config/environment' + */ +declare const config: { + environment: string; + modulePrefix: string; + podModulePrefix: string; + locationType: 'auto' | 'hash' | 'history' | 'none'; + rootURL: string; + APP: Record; +}; diff --git a/test-app/package.json b/test-app/package.json index 424c4013..a7e9f776 100644 --- a/test-app/package.json +++ b/test-app/package.json @@ -35,6 +35,8 @@ "@glimmer/tracking": "^1.1.2", "@prismicio/richtext": "^1.1.0", "@qonto/eslint-config-typescript": "1.0.0-rc.0", + "@tsconfig/ember": "^3.0.1", + "@types/qunit": "^2.19.7", "@typescript-eslint/parser": "^6.9.0", "broccoli-asset-rev": "^3.0.0", "concurrently": "^8.2.2", @@ -47,6 +49,7 @@ "ember-cli-inject-live-reload": "^2.1.0", "ember-cli-sri": "^2.1.1", "ember-cli-terser": "^4.0.2", + "ember-cli-typescript": "^5.2.1", "ember-disable-prototype-extensions": "^1.1.3", "ember-fetch": "^8.1.2", "ember-load-initializers": "^2.1.2", @@ -76,6 +79,7 @@ "stylelint-config-standard": "^34.0.0", "stylelint-prettier": "^4.0.2", "tracked-built-ins": "^3.3.0", + "typescript": "^5.2.2", "webpack": "^5.89.0" }, "engines": { diff --git a/test-app/tsconfig.json b/test-app/tsconfig.json new file mode 100644 index 00000000..b9404e69 --- /dev/null +++ b/test-app/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "@tsconfig/ember/tsconfig.json", + "compilerOptions": { + // The combination of `baseUrl` with `paths` allows Ember's classic package + // layout, which is not resolvable with the Node resolution algorithm, to + // work with TypeScript. + "baseUrl": ".", + // Type check only the code specifically refered to in the source code. + "skipLibCheck": true, + "paths": { + "test-app/tests/*": ["tests/*"], + "test-app/*": ["app/*"], + "*": ["types/*"] + } + }, + "include": ["app/**/*", "tests/**/*", "types/**/*"] +} diff --git a/test-app/types/test-app/index.d.ts b/test-app/types/test-app/index.d.ts new file mode 100644 index 00000000..2109bac6 --- /dev/null +++ b/test-app/types/test-app/index.d.ts @@ -0,0 +1,2 @@ +import 'ember-source/types'; +import 'ember-source/types/preview'; From b74407b3ecf0c0dac65c5f40af94a1623517c54b Mon Sep 17 00:00:00 2001 From: Vincent Scavinner Date: Fri, 3 Nov 2023 16:42:47 +0100 Subject: [PATCH 8/8] feat: add glint to test-app --- pnpm-lock.yaml | 77 ++++++++++++++++++++------------------- test-app/package.json | 3 ++ test-app/tsconfig.json | 8 +++- test-app/types/glint.d.ts | 5 +++ 4 files changed, 55 insertions(+), 38 deletions(-) create mode 100644 test-app/types/glint.d.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c713870..39005c43 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -68,13 +68,13 @@ importers: version: 1.2.1(typescript@5.2.2) '@glint/environment-ember-loose': specifier: ^1.2.1 - version: 1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1) + version: 1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1)(ember-cli-htmlbars@6.3.0)(ember-modifier@4.1.0) '@glint/template': specifier: ^1.2.1 version: 1.2.1 '@qonto/eslint-config-typescript': specifier: 1.0.0-rc.0 - version: 1.0.0-rc.0(eslint@8.52.0)(typescript@5.2.2) + version: 1.0.0-rc.0(eslint@8.53.0)(typescript@5.2.2) '@rollup/plugin-babel': specifier: ^6.0.4 version: 6.0.4(@babel/core@7.23.2)(rollup@3.22.0) @@ -83,7 +83,7 @@ importers: version: 3.0.1 '@typescript-eslint/parser': specifier: ^6.9.0 - version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) + version: 6.9.0(eslint@8.53.0)(typescript@5.2.2) concurrently: specifier: ^8.2.2 version: 8.2.2 @@ -138,7 +138,7 @@ importers: version: 3.1.1 '@ember/test-helpers': specifier: ^3.2.0 - version: 3.2.0(ember-source@4.12.0)(webpack@5.89.0) + version: 3.2.0(@glint/template@1.2.1)(ember-source@4.12.0)(webpack@5.89.0) '@embroider/test-setup': specifier: 3.0.2 version: 3.0.2 @@ -148,12 +148,21 @@ importers: '@glimmer/tracking': specifier: ^1.1.2 version: 1.1.2 + '@glint/core': + specifier: ^1.2.1 + version: 1.2.1(typescript@5.2.2) + '@glint/environment-ember-loose': + specifier: ^1.2.1 + version: 1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1)(ember-cli-htmlbars@6.3.0)(ember-modifier@4.1.0) + '@glint/template': + specifier: ^1.2.1 + version: 1.2.1 '@prismicio/richtext': specifier: ^1.1.0 version: 1.1.0 '@qonto/eslint-config-typescript': specifier: 1.0.0-rc.0 - version: 1.0.0-rc.0(eslint@8.52.0)(typescript@5.2.2) + version: 1.0.0-rc.0(eslint@8.53.0)(typescript@5.2.2) '@tsconfig/ember': specifier: ^3.0.1 version: 3.0.1 @@ -162,7 +171,7 @@ importers: version: 2.19.7 '@typescript-eslint/parser': specifier: ^6.9.0 - version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) + version: 6.9.0(eslint@8.53.0)(typescript@5.2.2) broccoli-asset-rev: specifier: ^3.0.0 version: 3.0.0 @@ -216,7 +225,7 @@ importers: version: 8.1.0(ember-source@4.12.0) ember-qunit: specifier: ^8.0.2 - version: 8.0.2(@ember/test-helpers@3.2.0)(ember-source@4.12.0)(qunit@2.20.0) + version: 8.0.2(@ember/test-helpers@3.2.0)(@glint/template@1.2.1)(ember-source@4.12.0)(qunit@2.20.0) ember-resolver: specifier: ^11.0.1 version: 11.0.1(ember-source@4.12.0) @@ -1655,7 +1664,7 @@ packages: - supports-color dev: true - /@ember/test-helpers@3.2.0(ember-source@4.12.0)(webpack@5.89.0): + /@ember/test-helpers@3.2.0(@glint/template@1.2.1)(ember-source@4.12.0)(webpack@5.89.0): resolution: {integrity: sha512-3yWpPsK5O77tUdCwW3HayrAcdlRitIRYMvLIG69Pkal1JMIGdNYVTvJ2R1lenhQh2syd/WFmGM07vQuDAtotQw==} engines: {node: 16.* || >= 18} peerDependencies: @@ -1916,7 +1925,7 @@ packages: optional: true dependencies: '@embroider/macros': 1.13.2(@glint/template@1.2.1) - '@glint/environment-ember-loose': 1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1) + '@glint/environment-ember-loose': 1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1)(ember-cli-htmlbars@6.3.0)(ember-modifier@4.1.0) '@glint/template': 1.2.1 broccoli-funnel: 3.0.8 ember-cli-babel: 7.26.11 @@ -2081,7 +2090,7 @@ packages: - supports-color dev: true - /@glint/environment-ember-loose@1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1): + /@glint/environment-ember-loose@1.2.1(@glimmer/component@1.1.2)(@glint/template@1.2.1)(ember-cli-htmlbars@6.3.0)(ember-modifier@4.1.0): resolution: {integrity: sha512-ZA0Ht7vwd1FosVLtMFrB2Er62P1v6yX/UuS6z9UVR6DMPfrL5qx6vef+EGJPLBrBKZMlm7zMB6Fyca201y4hDA==} peerDependencies: '@glimmer/component': ^1.1.2 @@ -2111,6 +2120,8 @@ packages: dependencies: '@glimmer/component': 1.1.2(@babel/core@7.23.2) '@glint/template': 1.2.1 + ember-cli-htmlbars: 6.3.0 + ember-modifier: 4.1.0(ember-source@4.12.0) /@glint/template@1.2.1: resolution: {integrity: sha512-rlYy/93fAhYjXmTchWcwCpPFMfrqBYEskzbDYawS2oz4DVwtf4fOITLKB0QddQMI7WUCjgXAiIGZqcNa/R4YeQ==} @@ -2397,16 +2408,16 @@ packages: /@prismicio/richtext@1.1.0: resolution: {integrity: sha512-925JuFiZiIkwu9jmlR9O/U8xCSZk/Y6BQDXKpavoVsKo+n90ml1hGdtWkglIupX+ITQO1ZINyDgUgiY1oG9dsA==} - /@qonto/eslint-config-typescript@1.0.0-rc.0(eslint@8.52.0)(typescript@5.2.2): + /@qonto/eslint-config-typescript@1.0.0-rc.0(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-laAtWhbOEaJH/Rq649bDM4gUW1OfVMNOgKe1Fg1R0/pCCmQgQ6AP0dz97Yj390HvHC4EDwiaPh8c7+agL/KY8A==} engines: {node: '>= 18.*'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 typescript: '*' dependencies: - '@typescript-eslint/eslint-plugin': 6.9.1(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) - eslint: 8.52.0 + '@typescript-eslint/eslint-plugin': 6.9.1(@typescript-eslint/parser@6.9.0)(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.9.0(eslint@8.53.0)(typescript@5.2.2) + eslint: 8.53.0 typescript: 5.2.2 transitivePeerDependencies: - supports-color @@ -2737,7 +2748,7 @@ packages: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} dev: true - /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2): + /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.0)(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2749,13 +2760,13 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.9.1 - '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/parser': 6.9.0(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/scope-manager': 6.9.1 - '@typescript-eslint/type-utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/type-utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 - eslint: 8.52.0 + eslint: 8.53.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare: 1.4.0 @@ -2766,7 +2777,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.9.0(eslint@8.52.0)(typescript@5.2.2): + /@typescript-eslint/parser@6.9.0(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2781,7 +2792,7 @@ packages: '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) '@typescript-eslint/visitor-keys': 6.9.0 debug: 4.3.4 - eslint: 8.52.0 + eslint: 8.53.0 typescript: 5.2.2 transitivePeerDependencies: - supports-color @@ -2803,7 +2814,7 @@ packages: '@typescript-eslint/visitor-keys': 6.9.1 dev: true - /@typescript-eslint/type-utils@6.9.1(eslint@8.52.0)(typescript@5.2.2): + /@typescript-eslint/type-utils@6.9.1(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2814,9 +2825,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.1(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) debug: 4.3.4 - eslint: 8.52.0 + eslint: 8.53.0 ts-api-utils: 1.0.3(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: @@ -2875,19 +2886,19 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.9.1(eslint@8.52.0)(typescript@5.2.2): + /@typescript-eslint/utils@6.9.1(eslint@8.53.0)(typescript@5.2.2): resolution: {integrity: sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.4 '@typescript-eslint/scope-manager': 6.9.1 '@typescript-eslint/types': 6.9.1 '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) - eslint: 8.52.0 + eslint: 8.53.0 semver: 7.5.4 transitivePeerDependencies: - supports-color @@ -3438,7 +3449,6 @@ packages: username-sync: 1.0.3 transitivePeerDependencies: - supports-color - dev: true /async-promise-queue@1.0.5: resolution: {integrity: sha512-xi0aQ1rrjPWYmqbwr18rrSKbSaXIeIwSd1J4KAgVfkq8utNbdZoht7GfvfY6swFUAMJ9obkc4WPJmtGwl+B8dw==} @@ -4169,7 +4179,6 @@ packages: sync-disk-cache: 2.1.0 transitivePeerDependencies: - supports-color - dev: true /broccoli-plugin@1.1.0: resolution: {integrity: sha512-dY1QsA20of9wWEto8yhN7JQjpfjySmgeIMsvnQ9aBAv1wEJJCe04B0ekdgq7Bduyx9yWXdoC5CngGy81swmp2w==} @@ -5619,7 +5628,6 @@ packages: dependencies: errlop: 2.2.0 semver: 6.3.1 - dev: true /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -5823,7 +5831,6 @@ packages: walk-sync: 2.2.0 transitivePeerDependencies: - supports-color - dev: true /ember-cli-inject-live-reload@2.1.0: resolution: {integrity: sha512-YV5wYRD5PJHmxaxaJt18u6LE6Y+wo455BnmcpN+hGNlChy2piM9/GMvYgTAz/8Vin8RJ5KekqP/w/NEaRndc/A==} @@ -6241,7 +6248,6 @@ packages: ember-source: 4.12.0(@babel/core@7.23.2)(@glimmer/component@1.1.2)(@glint/template@1.2.1)(webpack@5.89.0) transitivePeerDependencies: - supports-color - dev: true /ember-page-title@8.1.0(ember-source@4.12.0): resolution: {integrity: sha512-c5V4sWu+OSRhN6Fsa0M71PkdNpKkV7Lg9FwqogK3iE++R43G6ySLV/Ls0cE5K+IWS1om7XSPqcUvkfhrfZ3y0g==} @@ -6255,14 +6261,14 @@ packages: - supports-color dev: true - /ember-qunit@8.0.2(@ember/test-helpers@3.2.0)(ember-source@4.12.0)(qunit@2.20.0): + /ember-qunit@8.0.2(@ember/test-helpers@3.2.0)(@glint/template@1.2.1)(ember-source@4.12.0)(qunit@2.20.0): resolution: {integrity: sha512-Rf60jeUTWNsF3Imf/FLujW/B/DFmKVXKmXO1lirTXjpertKfwRhp/3MnN8a/U/WyodTIsERkInGT1IqTtphCdQ==} peerDependencies: '@ember/test-helpers': '>=3.0.3' ember-source: '>=4.0.0' qunit: ^2.13.0 dependencies: - '@ember/test-helpers': 3.2.0(ember-source@4.12.0)(webpack@5.89.0) + '@ember/test-helpers': 3.2.0(@glint/template@1.2.1)(ember-source@4.12.0)(webpack@5.89.0) '@embroider/addon-shim': 1.8.6 '@embroider/macros': 1.13.2(@glint/template@1.2.1) ember-cli-test-loader: 3.1.0 @@ -6541,7 +6547,6 @@ packages: /errlop@2.2.0: resolution: {integrity: sha512-e64Qj9+4aZzjzzFpZC7p5kmm/ccCrbLhAJplhsDXQFs87XTsXwOpH4s1Io2s90Tau/8r2j9f4l/thhDevRjzxw==} engines: {node: '>=0.8'} - dev: true /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} @@ -9020,7 +9025,6 @@ packages: binaryextensions: 2.3.0 editions: 2.3.1 textextensions: 2.6.0 - dev: true /iterate-iterator@1.0.2: resolution: {integrity: sha512-t91HubM4ZDQ70M9wqp+pcNpu8OyJ9UAtXntT/Bcsvp5tZMnz9vRa+IunKXeI8AnfZMTv0jNuVEmGeLSMjVvfPw==} @@ -12766,7 +12770,6 @@ packages: username-sync: 1.0.3 transitivePeerDependencies: - supports-color - dev: true /synckit@0.8.5: resolution: {integrity: sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==} diff --git a/test-app/package.json b/test-app/package.json index a7e9f776..2668e9ed 100644 --- a/test-app/package.json +++ b/test-app/package.json @@ -33,6 +33,9 @@ "@embroider/test-setup": "3.0.2", "@glimmer/component": "^1.1.2", "@glimmer/tracking": "^1.1.2", + "@glint/core": "^1.2.1", + "@glint/environment-ember-loose": "^1.2.1", + "@glint/template": "^1.2.1", "@prismicio/richtext": "^1.1.0", "@qonto/eslint-config-typescript": "1.0.0-rc.0", "@tsconfig/ember": "^3.0.1", diff --git a/test-app/tsconfig.json b/test-app/tsconfig.json index b9404e69..6d69f8a1 100644 --- a/test-app/tsconfig.json +++ b/test-app/tsconfig.json @@ -13,5 +13,11 @@ "*": ["types/*"] } }, - "include": ["app/**/*", "tests/**/*", "types/**/*"] + "include": ["app/**/*", "tests/**/*", "types/**/*"], + "glint": { + "environment": "ember-loose", + "transform": { + "include": ["app/**", "tests/**"] + } + } } diff --git a/test-app/types/glint.d.ts b/test-app/types/glint.d.ts new file mode 100644 index 00000000..2a6c3057 --- /dev/null +++ b/test-app/types/glint.d.ts @@ -0,0 +1,5 @@ +import '@glint/environment-ember-loose'; + +declare module '@glint/environment-ember-loose/registry' { + export default interface Registry {} +}