Skip to content

Commit

Permalink
Add missing tsconfigs
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinVdBroeck committed May 4, 2024
1 parent 0ccad69 commit 5eda634
Show file tree
Hide file tree
Showing 228 changed files with 1,545 additions and 666 deletions.
62 changes: 7 additions & 55 deletions .monorepolint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ const TS_PACKAGES = [] as string[]; // projects that use typescript to build
const JS_PACKAGES = [] as string[]; // projects that use javascript/rollup to build
const MAIN_PACKAGE = "@turf/turf";

const TAPE_PACKAGES = [] as string[]; // projects that have tape tests
const TYPES_PACKAGES = [] as string[]; // projects that have types tests
const BENCH_PACKAGES = [] as string[]; // projects that have benchmarks

// iterate all the packages and figure out what buckets everything falls into
glob.sync(path.join(__dirname, "packages", "turf-*")).forEach((pk) => {
glob.sync(path.join(__dirname, "packages", "turf-*")).forEach((pk: string) => {
const name = JSON.parse(
fs.readFileSync(path.join(pk, "package.json"), "utf8")
).name;
Expand All @@ -22,27 +20,11 @@ glob.sync(path.join(__dirname, "packages", "turf-*")).forEach((pk) => {
JS_PACKAGES.push(name);
}

if (fs.existsSync(path.join(pk, "test.js"))) {
TAPE_PACKAGES.push(name);
}

if (fs.existsSync(path.join(pk, "types.ts"))) {
TYPES_PACKAGES.push(name);
}
});

const TS_BENCH_PACKAGES = BENCH_PACKAGES.filter(
(pkg) => -1 !== TS_PACKAGES.indexOf(pkg)
);
const JS_BENCH_PACKAGES = BENCH_PACKAGES.filter(
(pkg) => -1 !== JS_PACKAGES.indexOf(pkg)
);
const TS_TAPE_PACKAGES = TAPE_PACKAGES.filter(
(pkg) => -1 !== TS_PACKAGES.indexOf(pkg)
);
const JS_TAPE_PACKAGES = TAPE_PACKAGES.filter(
(pkg) => -1 !== JS_PACKAGES.indexOf(pkg)
);
const ALL_PACKAGES = [...JS_PACKAGES, ...TS_PACKAGES];

module.exports = {
rules: {
Expand Down Expand Up @@ -193,34 +175,11 @@ module.exports = {
{
options: {
scripts: {
"test:tape": "node -r esm test.js",
},
},
includePackages: JS_TAPE_PACKAGES,
},
{
options: {
scripts: {
"test:tape": "ts-node -r esm test.js",
},
},
includePackages: TS_TAPE_PACKAGES,
},
{
options: {
scripts: {
bench: "node -r esm bench.js",
bench: "tsx bench.js",
"test:tape": "tsx test.js",
},
},
includePackages: JS_TAPE_PACKAGES,
},
{
options: {
scripts: {
bench: "ts-node bench.js",
},
},
includePackages: TS_TAPE_PACKAGES,
includePackages: ALL_PACKAGES,
},
{
options: {
Expand All @@ -241,18 +200,11 @@ module.exports = {
options: {
devDependencies: {
"npm-run-all": "*",
},
},
includePackages: [...TS_PACKAGES, ...JS_PACKAGES],
},
{
options: {
devDependencies: {
"ts-node": "^10.9.2",
tsx: "^4.9.1",
typescript: "~4.7.3",
},
},
includePackages: TS_PACKAGES,
includePackages: ALL_PACKAGES,
},
{
options: {
Expand Down
5 changes: 3 additions & 2 deletions packages/turf-along/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
Expand All @@ -54,6 +54,7 @@
"tape": "*",
"ts-node": "^10.9.2",
"tslint": "*",
"tsx": "^4.9.1",
"typescript": "~4.7.3"
},
"dependencies": {
Expand Down
10 changes: 7 additions & 3 deletions packages/turf-along/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.shared.json",
"compilerOptions": {
"outDir": "dist/js"
"allowJs": true
},
"files": ["index.ts"],
}
"files": [
"index.js",
"index.ts",
"lib/"
]
}
5 changes: 3 additions & 2 deletions packages/turf-angle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@turf/distance": "^6.5.0",
Expand All @@ -58,6 +58,7 @@
"tape": "*",
"ts-node": "^10.9.2",
"tslint": "*",
"tsx": "^4.9.1",
"typescript": "~4.7.3",
"write-json-file": "*"
},
Expand Down
10 changes: 7 additions & 3 deletions packages/turf-angle/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.shared.json",
"compilerOptions": {
"outDir": "dist/js"
"allowJs": true
},
"files": ["index.ts"]
}
"files": [
"index.js",
"index.ts",
"lib/"
]
}
5 changes: 3 additions & 2 deletions packages/turf-area/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
Expand All @@ -53,6 +53,7 @@
"tape": "*",
"ts-node": "^10.9.2",
"tslint": "*",
"tsx": "^4.9.1",
"typescript": "~4.7.3",
"write-json-file": "*"
},
Expand Down
10 changes: 7 additions & 3 deletions packages/turf-area/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.shared.json",
"compilerOptions": {
"outDir": "dist/js"
"allowJs": true
},
"files": ["index.ts"]
}
"files": [
"index.js",
"index.ts",
"lib/"
]
}
5 changes: 3 additions & 2 deletions packages/turf-bbox-clip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@turf/bbox": "^6.5.0",
Expand All @@ -60,6 +60,7 @@
"tape": "*",
"ts-node": "^10.9.2",
"tslint": "*",
"tsx": "^4.9.1",
"typescript": "~4.7.3",
"write-json-file": "*"
},
Expand Down
10 changes: 7 additions & 3 deletions packages/turf-bbox-clip/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.shared.json",
"compilerOptions": {
"outDir": "dist/js"
"allowJs": true
},
"files": ["index.ts", "lib/lineclip.ts"]
}
"files": [
"index.js",
"index.ts",
"lib/"
]
}
5 changes: 3 additions & 2 deletions packages/turf-bbox-polygon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
Expand All @@ -53,6 +53,7 @@
"tape": "*",
"ts-node": "^10.9.2",
"tslint": "*",
"tsx": "^4.9.1",
"typescript": "~4.7.3"
},
"dependencies": {
Expand Down
10 changes: 7 additions & 3 deletions packages/turf-bbox-polygon/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.shared.json",
"compilerOptions": {
"outDir": "dist/js"
"allowJs": true
},
"files": ["index.ts"]
}
"files": [
"index.js",
"index.ts",
"lib/"
]
}
5 changes: 3 additions & 2 deletions packages/turf-bbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@types/tape": "*",
Expand All @@ -54,6 +54,7 @@
"tape": "*",
"ts-node": "^10.9.2",
"tslint": "*",
"tsx": "^4.9.1",
"typescript": "~4.7.3"
},
"dependencies": {
Expand Down
10 changes: 7 additions & 3 deletions packages/turf-bbox/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.shared.json",
"compilerOptions": {
"outDir": "dist/js"
"allowJs": true
},
"files": ["index.ts"]
}
"files": [
"index.js",
"index.ts",
"lib/"
]
}
5 changes: 3 additions & 2 deletions packages/turf-bearing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"bench": "tsx bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
"test:tape": "tsx test.js"
},
"devDependencies": {
"@turf/destination": "^6.5.0",
Expand All @@ -51,6 +51,7 @@
"tape": "*",
"ts-node": "^10.9.2",
"tslint": "*",
"tsx": "^4.9.1",
"typescript": "~4.7.3",
"write-json-file": "*"
},
Expand Down
10 changes: 7 additions & 3 deletions packages/turf-bearing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"extends": "../../tsconfig.shared.json",
"compilerOptions": {
"outDir": "dist/js"
"allowJs": true
},
"files": ["index.ts"]
}
"files": [
"index.js",
"index.ts",
"lib/"
]
}
Loading

0 comments on commit 5eda634

Please sign in to comment.