diff --git a/.prettierignore b/.prettierignore index 683a4ac..db9a348 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,4 +2,3 @@ api-extractor/**/* dist/**/* docs/**/* temp/**/* -types/**/* diff --git a/.vscode/settings.json b/.vscode/settings.json index 03449b7..bcb49d4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,7 @@ "cSpell.words": [ "destructure", "heaslip", + "nodenext", "Perso", "rushstack", "tsdoc", @@ -42,8 +43,8 @@ "api-extractor/**/*": true, "CHANGELOG": true, "docs/**/*": true, - "LICENSE": true, - "types/**/*": true + "package-lock.json": true, + "LICENSE": true }, "typescript.tsdk": "node_modules/typescript/lib" } diff --git a/README.markdown b/README.markdown index 1002cda..97f2740 100644 --- a/README.markdown +++ b/README.markdown @@ -24,7 +24,7 @@ npm run dev If you add a new function or making a change to the arguments of an existing function (without this TypeScript won’t be aware of the changes, and the `build-lint-test` script will fail): ```sh -# Update api-extractor/* (metadata about code generated by api-extractor), docs/* (Markdown documentation generated by api-documenter using api-extractor metadata) and types/js-utils.d.ts (types generated by api-extractor) +# Update api-extractor/* (metadata about code generated by api-extractor) and docs/* (Markdown documentation generated by api-documenter using api-extractor metadata) npm run api-extractor-update ``` diff --git a/api-extractor.json b/api-extractor.json index 7c64bb0..d2c0797 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -9,7 +9,7 @@ "reportFolder": "/api-extractor" }, "compiler": { - "tsconfigFilePath": "tsconfig.json" + "tsconfigFilePath": "tsconfig-dist.json" }, "docModel": { "enabled": true, @@ -18,23 +18,6 @@ "dtsRollup": { "enabled": false }, - "messages": { - "compilerMessageReporting": { - "default": { - "logLevel": "warning" - } - }, - "extractorMessageReporting": { - "default": { - "logLevel": "warning" - } - }, - "tsdocMessageReporting": { - "default": { - "logLevel": "warning" - } - } - }, "tsdocMetadata": { "enabled": false } diff --git a/api-extractor/js-utils.api.json b/api-extractor/js-utils.api.json index c1b227a..7c2c558 100644 --- a/api-extractor/js-utils.api.json +++ b/api-extractor/js-utils.api.json @@ -194,7 +194,7 @@ "text": "T" } ], - "fileUrlPath": "src/asType.ts", + "fileUrlPath": "dist/asType.d.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 @@ -248,7 +248,7 @@ "text": "string" } ], - "fileUrlPath": "src/cleanUrlQueryString.ts", + "fileUrlPath": "dist/cleanUrlQueryString.d.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 @@ -316,7 +316,7 @@ "text": "`/${string}`" } ], - "fileUrlPath": "src/constructUrl.ts", + "fileUrlPath": "dist/constructUrl.d.ts", "returnTypeTokenRange": { "startIndex": 9, "endIndex": 10 @@ -357,7 +357,7 @@ "text": "string" } ], - "fileUrlPath": "src/getAbsoluteUrl.ts", + "fileUrlPath": "dist/getAbsoluteUrl.d.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 @@ -403,7 +403,7 @@ "text": "string | undefined" } ], - "fileUrlPath": "src/getFirstStringOrString.ts", + "fileUrlPath": "dist/getFirstStringOrString.d.ts", "returnTypeTokenRange": { "startIndex": 4, "endIndex": 5 @@ -498,7 +498,7 @@ "text": "NormalizedQueryType" } ], - "fileUrlPath": "src/getNormalizedQuery.ts", + "fileUrlPath": "dist/getNormalizedQuery.d.ts", "returnTypeTokenRange": { "startIndex": 15, "endIndex": 16 @@ -566,7 +566,7 @@ "text": "" } ], - "fileUrlPath": "src/getObjectValueByDotSeparatedKey.ts", + "fileUrlPath": "dist/getObjectValueByDotSeparatedKey.d.ts", "returnTypeTokenRange": { "startIndex": 5, "endIndex": 7 @@ -620,7 +620,7 @@ "text": "string" } ], - "fileUrlPath": "src/getRootRelativeUrl.ts", + "fileUrlPath": "dist/getRootRelativeUrl.d.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 @@ -661,7 +661,7 @@ "text": "boolean" } ], - "fileUrlPath": "src/isNullOrWhitespace.ts", + "fileUrlPath": "dist/isNullOrWhitespace.d.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 @@ -702,7 +702,7 @@ "text": "string" } ], - "fileUrlPath": "src/replaceArabicNumeralsWithPersianNumerals.ts", + "fileUrlPath": "dist/replaceArabicNumeralsWithPersianNumerals.d.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 @@ -743,7 +743,7 @@ "text": "void" } ], - "fileUrlPath": "src/serverLog.ts", + "fileUrlPath": "dist/serverLog.d.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 @@ -784,7 +784,7 @@ "text": "string" } ], - "fileUrlPath": "src/underscoreCaseToCamelCase.ts", + "fileUrlPath": "dist/underscoreCaseToCamelCase.d.ts", "returnTypeTokenRange": { "startIndex": 3, "endIndex": 4 diff --git a/eslint.config.js b/eslint.config.js index 169a20a..2079472 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,17 +1,16 @@ // We should be able to remove the @ts-expect-error and eslint-disable-next-line // once we fix the typing of @asl-19/eslint-config -// @ts-expect-error (TODO: why is this happening?) import asl19 from "@asl-19/eslint-config"; import { defineConfig } from "eslint/config"; -// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -const typedAsl19 = - /** @type {import("@asl-19/eslint-config/types/index")["default"]} */ (asl19); +const typedAsl19 = /** @type {import("@asl-19/eslint-config")["default"]} */ ( + asl19 +); const eslintConfig = defineConfig([ { - ignores: ["dist/", "types/", ".yalc/"], + ignores: ["dist/", ".yalc/"], }, { extends: [ diff --git a/package-lock.json b/package-lock.json index ee03ba0..d510085 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,6 @@ }, "devDependencies": { "@asl-19/eslint-config": "^0.9.0", - "@asl-19/shared-package-configs": "^0.3.0", "@microsoft/api-documenter": "^7.26.29", "@microsoft/api-extractor": "^7.52.8", "@types/node": "^22.16.4", @@ -68,13 +67,6 @@ "eslint": "^9.22.0" } }, - "node_modules/@asl-19/shared-package-configs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@asl-19/shared-package-configs/-/shared-package-configs-0.3.0.tgz", - "integrity": "sha512-yNU5cHCTIWSfgyBAKRQlRL8rwwmNGnVLjLDKDSnAnmTH31BeSio+3NcBbVx403ND+9vNxZX64FmIjmn+YVRr+g==", - "dev": true, - "license": "GPL-3.0-or-later" - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", diff --git a/package.json b/package.json index ab54a1b..ffa51a1 100644 --- a/package.json +++ b/package.json @@ -41,27 +41,27 @@ "api-extractor-check": "api-extractor run --verbose", "api-extractor-update": "api-extractor run --local --verbose && api-documenter markdown --input-folder ./api-extractor --output-folder ./docs", "build-lint-test": "npm-run-all -l -p tsc -s lint-test", - "rm-dist": "rm -rf dist", + "rm-dist": "rm -rf dist/*", "dev": "npm-run-all -l -s package-changed -p tsc-watch", + "dev-build-update": "npm-run-all -l -p package-changed rm-dist -s tsc api-extractor-update", "dev-lint-test": "run-s package-changed lint-test", "eslint-check": "eslint . --ext='js,ts,tsx'", "eslint-fix": "eslint . --ext='js,ts,tsx' --fix", "lint-test": "run-p -l api-extractor-check eslint-check prettier-check tsc-check", "package-changed": "package-changed", "prepublishOnly": "run-s rm-dist build-lint-test", - "prettier-check": "prettier --config prettier.config.js --check .", - "prettier-fix": "prettier --config prettier.config.js --write .", + "prettier-check": "prettier --check .", + "prettier-fix": "prettier --write .", "npm-check-updates": "npm-check-updates", - "tsc": "tsc --project tsconfig-esm.json", - "tsc-watch": "tsc --project tsconfig-esm.json --watch", - "tsc-check": "tsc --noEmit" + "tsc": "tsc --project tsconfig-dist.json", + "tsc-watch": "tsc --project tsconfig-dist.json --watch", + "tsc-check": "tsc --project tsconfig-dist.json --noEmit" }, "dependencies": { "ts-pattern": "^5.7.1" }, "devDependencies": { "@asl-19/eslint-config": "^0.9.0", - "@asl-19/shared-package-configs": "^0.3.0", "@microsoft/api-documenter": "^7.26.29", "@microsoft/api-extractor": "^7.52.8", "@types/node": "^22.16.4", diff --git a/prettier.config.js b/prettier.config.js index f93b56a..6e26202 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -1,3 +1,4 @@ +/** @type {import("prettier").Config} */ const prettierConfig = { overrides: [ { diff --git a/tsconfig-dist.json b/tsconfig-dist.json new file mode 100644 index 0000000..dd4b3c2 --- /dev/null +++ b/tsconfig-dist.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "include": [ + "src/**/*.ts*" + ] +} diff --git a/tsconfig-esm.json b/tsconfig-esm.json deleted file mode 100644 index 5d6100a..0000000 --- a/tsconfig-esm.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@asl-19/shared-package-configs/tsconfig-esm.json", - "compilerOptions": { - "outDir": "dist" - }, - "include": [ - "src/**/*.ts*" - ] -} diff --git a/tsconfig.json b/tsconfig.json index 5c59cd3..bb20822 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,13 @@ { - "extends": "@asl-19/shared-package-configs/tsconfig-base.json", "compilerOptions": { - "outDir": "dist" + "allowJs": true, + "checkJs": true, + "declaration": true, + "incremental": true, + "module": "preserve", + "outDir": "dist", + "strict": true, + "target": "es2021" }, "include": [ "*.mjs",