Skip to content

Commit

Permalink
Merge pull request #141 from palantir/ea/improve-tsconfigs
Browse files Browse the repository at this point in the history
Improves tsconfig
  • Loading branch information
ericanderson authored Mar 22, 2024
2 parents 56ce464 + 51eaa03 commit fb1a46f
Show file tree
Hide file tree
Showing 51 changed files with 193 additions and 124 deletions.
30 changes: 5 additions & 25 deletions .monorepolint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,38 +72,18 @@ function getTsconfigOptions(baseTsconfigPath, opts) {
extends: baseTsconfigPath,

compilerOptions: {
rootDir: "src",
rootDir: ".",
outDir: "build/types",
composite: true,
},
include: ["./src/**/*", ".eslintrc.cjs"],
include: ["./src/**/*", ".eslintrc.cjs", "package.json"],
...(opts.customTsconfigExcludes
? { exclude: opts.customTsconfigExcludes ?? [] }
: {}),
},
};
}

function getTsconfigOptionsE2E(baseTsconfigPath) {
return {
file: "tsconfig.json",
template: {
extends: baseTsconfigPath,

compilerOptions: {
rootDir: "src",
outDir: "build/types",
composite: true,
},
include: ["./src/**/*", ".eslintrc.cjs"],
exclude: [
"./src/__e2e_tests__/**/**.test.ts",
"./src/generatedNoCheck/**/*",
],
},
};
}

/**
* @param {Omit<import("@monorepolint/config").RuleEntry<>,"options" | "id">} shared
* @param {{
Expand Down Expand Up @@ -157,12 +137,12 @@ function standardPackageRules(shared, options) {
entries: {
exports: {
".": {
types: "./build/types/index.d.ts",
types: "./build/types/src/index.d.ts",
import: "./build/js/index.mjs",
require: `./build/js/index.${options.legacy ? "" : "c"}js`,
},
"./*": {
types: "./build/types/public/*.d.ts",
types: "./build/types/src/public/*.d.ts",
import: "./build/js/public/*.mjs",
require: `./build/js/public/*.${options.legacy ? "" : "c"}js`,
},
Expand All @@ -184,7 +164,7 @@ function standardPackageRules(shared, options) {

main: `./build/js/index.${options.legacy ? "" : "c"}js`,
module: "./build/js/index.mjs",
types: "./build/types/index.d.ts",
types: "./build/types/src/index.d.ts",
},
},
}),
Expand Down
6 changes: 3 additions & 3 deletions examples-extra/basic/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"import": "./build/js/index.mjs",
"require": "./build/js/index.cjs"
},
"./*": {
"types": "./build/types/public/*.d.ts",
"types": "./build/types/src/public/*.d.ts",
"import": "./build/js/public/*.mjs",
"require": "./build/js/public/*.cjs"
}
Expand Down Expand Up @@ -53,6 +53,6 @@
],
"main": "./build/js/index.cjs",
"module": "./build/js/index.mjs",
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"type": "module"
}
5 changes: 3 additions & 2 deletions examples-extra/basic/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"extends": "../../../monorepo/tsconfig/tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"rootDir": ".",
"outDir": "build/types",
"composite": true
},
"include": [
"./src/**/*",
".eslintrc.cjs"
".eslintrc.cjs",
"package.json"
],
"references": [
{
Expand Down
8 changes: 4 additions & 4 deletions examples-extra/basic/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"import": "./build/js/index.mjs",
"require": "./build/js/index.cjs"
},
"./*": {
"types": "./build/types/public/*.d.ts",
"types": "./build/types/src/public/*.d.ts",
"import": "./build/js/public/*.mjs",
"require": "./build/js/public/*.cjs"
}
Expand All @@ -41,7 +41,7 @@
"publishConfig": {
"access": "public"
},
"keywords": [ ],
"keywords": [],
"files": [
"build/types",
"build/js",
Expand All @@ -53,6 +53,6 @@
],
"main": "./build/js/index.cjs",
"module": "./build/js/index.mjs",
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"type": "module"
}
5 changes: 3 additions & 2 deletions examples-extra/basic/sdk/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"extends": "../../../monorepo/tsconfig/tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"rootDir": ".",
"outDir": "build/types",
"composite": true
},
"include": [
"./src/**/*",
".eslintrc.cjs"
".eslintrc.cjs",
"package.json"
],
"references": [
{
Expand Down
8 changes: 4 additions & 4 deletions examples-extra/one_dot_one/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"import": "./build/js/index.mjs",
"require": "./build/js/index.cjs"
},
"./*": {
"types": "./build/types/public/*.d.ts",
"types": "./build/types/src/public/*.d.ts",
"import": "./build/js/public/*.mjs",
"require": "./build/js/public/*.cjs"
}
Expand Down Expand Up @@ -44,7 +44,7 @@
"publishConfig": {
"access": "public"
},
"keywords": [ ],
"keywords": [],
"files": [
"build/types",
"build/js",
Expand All @@ -56,5 +56,5 @@
],
"main": "./build/js/index.cjs",
"module": "./build/js/index.mjs",
"types": "./build/types/index.d.ts"
"types": "./build/types/src/index.d.ts"
}
5 changes: 3 additions & 2 deletions examples-extra/one_dot_one/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"extends": "../../monorepo/tsconfig/tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"rootDir": ".",
"outDir": "build/types",
"composite": true
},
"include": [
"./src/**/*",
".eslintrc.cjs"
".eslintrc.cjs",
"package.json"
],
"references": []
}
5 changes: 5 additions & 0 deletions packages/api/changelog/@unreleased/pr-141.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Improves tsconfig
links:
- https://github.com/palantir/osdk-ts/pull/141
8 changes: 4 additions & 4 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"import": "./build/js/index.mjs",
"require": "./build/js/index.js"
},
"./*": {
"types": "./build/types/public/*.d.ts",
"types": "./build/types/src/public/*.d.ts",
"import": "./build/js/public/*.mjs",
"require": "./build/js/public/*.js"
}
Expand Down Expand Up @@ -45,7 +45,7 @@
"publishConfig": {
"access": "public"
},
"keywords": [ ],
"keywords": [],
"files": [
"build/types",
"build/js",
Expand All @@ -57,5 +57,5 @@
],
"main": "./build/js/index.js",
"module": "./build/js/index.mjs",
"types": "./build/types/index.d.ts"
"types": "./build/types/src/index.d.ts"
}
5 changes: 3 additions & 2 deletions packages/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"extends": "../../monorepo/tsconfig/tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"rootDir": ".",
"outDir": "build/types",
"composite": true
},
"include": [
"./src/**/*",
".eslintrc.cjs"
".eslintrc.cjs",
"package.json"
],
"references": [
{
Expand Down
5 changes: 5 additions & 0 deletions packages/cli/changelog/@unreleased/pr-141.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Improves tsconfig
links:
- https://github.com/palantir/osdk-ts/pull/141
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"import": "./build/js/index.mjs",
"require": "./build/js/index.cjs"
},
"./*": {
"types": "./build/types/public/*.d.ts",
"types": "./build/types/src/public/*.d.ts",
"import": "./build/js/public/*.mjs",
"require": "./build/js/public/*.cjs"
}
Expand Down Expand Up @@ -60,7 +60,7 @@
"imports": {
"#net": "./src/net/index.mts"
},
"keywords": [ ],
"keywords": [],
"bin": {
"osdk": "./bin/osdk.mjs"
},
Expand All @@ -75,6 +75,6 @@
],
"main": "./build/js/index.cjs",
"module": "./build/js/index.mjs",
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"type": "module"
}
5 changes: 3 additions & 2 deletions packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"extends": "../../monorepo/tsconfig/tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"rootDir": ".",
"outDir": "build/types",
"composite": true
},
"include": [
"./src/**/*",
".eslintrc.cjs"
".eslintrc.cjs",
"package.json"
],
"references": [
{
Expand Down
5 changes: 5 additions & 0 deletions packages/client/changelog/@unreleased/pr-141.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Improves tsconfig
links:
- https://github.com/palantir/osdk-ts/pull/141
8 changes: 4 additions & 4 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"import": "./build/js/index.mjs",
"require": "./build/js/index.cjs"
},
"./*": {
"types": "./build/types/public/*.d.ts",
"types": "./build/types/src/public/*.d.ts",
"import": "./build/js/public/*.mjs",
"require": "./build/js/public/*.cjs"
}
Expand Down Expand Up @@ -58,7 +58,7 @@
"publishConfig": {
"access": "public"
},
"keywords": [ ],
"keywords": [],
"files": [
"build/types",
"build/js",
Expand All @@ -70,6 +70,6 @@
],
"main": "./build/js/index.cjs",
"module": "./build/js/index.mjs",
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"type": "module"
}
5 changes: 3 additions & 2 deletions packages/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"extends": "../../monorepo/tsconfig/tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"rootDir": ".",
"outDir": "build/types",
"composite": true
},
"include": [
"./src/**/*",
".eslintrc.cjs"
".eslintrc.cjs",
"package.json"
],
"references": [
{
Expand Down
5 changes: 5 additions & 0 deletions packages/create-app/changelog/@unreleased/pr-141.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Improves tsconfig
links:
- https://github.com/palantir/osdk-ts/pull/141
6 changes: 3 additions & 3 deletions packages/create-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
"exports": {
".": {
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"import": "./build/js/index.mjs",
"require": "./build/js/index.cjs"
},
"./*": {
"types": "./build/types/public/*.d.ts",
"types": "./build/types/src/public/*.d.ts",
"import": "./build/js/public/*.mjs",
"require": "./build/js/public/*.cjs"
}
Expand Down Expand Up @@ -61,6 +61,6 @@
],
"main": "./build/js/index.cjs",
"module": "./build/js/index.mjs",
"types": "./build/types/index.d.ts",
"types": "./build/types/src/index.d.ts",
"type": "module"
}
Loading

0 comments on commit fb1a46f

Please sign in to comment.