Skip to content

Commit

Permalink
feat(angular-query): rollup type declarations (#7380)
Browse files Browse the repository at this point in the history
This has several benefits:

Fix internal resolution error
Clear API surface
IDEs will not suggest deep imports from unexpected files
  • Loading branch information
arnoud-dv committed May 5, 2024
1 parent 3d3a503 commit 1b59482
Show file tree
Hide file tree
Showing 10 changed files with 863 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ stats.html
.svelte-kit
.tsup
.vinxi
temp

vite.config.js.timestamp-*
vite.config.ts.timestamp-*
11 changes: 10 additions & 1 deletion packages/angular-query-devtools-experimental/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
// @ts-check

/** @type {import('eslint').Linter.Config} */
const config = {}
const config = {
plugins: ['jsdoc'],
extends: ['plugin:jsdoc/recommended-typescript'],
rules: {
'jsdoc/require-hyphen-before-param-description': 1,
'jsdoc/sort-tags': 1,
'jsdoc/require-throws': 1,
'jsdoc/check-tag-names': ['warn'],
},
}

module.exports = config
4 changes: 2 additions & 2 deletions packages/angular-query-devtools-experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"type": "module",
"sideEffects": false,
"files": [
"build",
"src"
"build"
],
"scripts": {
"clean": "rimraf ./build && rimraf ./coverage",
Expand All @@ -37,6 +36,7 @@
"@angular/core": "^17.3.3",
"@angular/common": "^17.3.3",
"@tanstack/angular-query-experimental": "workspace:*",
"eslint-plugin-jsdoc": "^48.2.2",
"ng-packagr": "^17.3.0",
"typescript": "5.2.2",
"zone.js": "^0.14.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-query-experimental/.attw.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ignoreRules": ["cjs-resolves-to-esm", "internal-resolution-error"]
"ignoreRules": ["cjs-resolves-to-esm"]
}
17 changes: 16 additions & 1 deletion packages/angular-query-experimental/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
// @ts-check

/** @type {import('eslint').Linter.Config} */
const config = {}
const config = {
plugins: ['jsdoc'],
extends: ['plugin:jsdoc/recommended-typescript'],
rules: {
'jsdoc/require-hyphen-before-param-description': 1,
'jsdoc/sort-tags': 1,
'jsdoc/require-throws': 1,
'jsdoc/check-tag-names': [
'warn',
{
// Not compatible with Api Extractor @public
typed: false,
},
],
},
}

module.exports = config
2 changes: 2 additions & 0 deletions packages/angular-query-experimental/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# API extractor
*.api.md
24 changes: 24 additions & 0 deletions packages/angular-query-experimental/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",

"mainEntryPointFilePath": "<projectFolder>/build/index.d.ts",

"newlineKind": "lf",

"apiReport": {
"enabled": true
},

"docModel": {
"enabled": false
},

"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "<projectFolder>/build/rollup.d.ts"
},

"tsdocMetadata": {
"enabled": false
}
}

0 comments on commit 1b59482

Please sign in to comment.