chore: unify migrated packages (#32819)

* add readme note in root

* use declarations instead of src root and ship it with package. also use tsconfig.json instead of tsconfig.base as it has better IDE support. Also add a watcher

* use declarations instead of src root and ship it with package. also use tsconfig.json instead of tsconfig.base as it has better IDE support. Also add a watcher

* use declarations instead of src root and ship it with package. also use tsconfig.json instead of tsconfig.base as it has better IDE support. Also add a watcher

* use declarations instead of src root and ship it with package. also use tsconfig.json instead of tsconfig.base as it has better IDE support. Also add a watcher

* use declarations instead of src root and ship it with package. also use tsconfig.json instead of tsconfig.base as it has better IDE support. Also add a watcher

* use declarations instead of src root and ship it with package. also use tsconfig.json instead of tsconfig.base as it has better IDE support. Also add a watcher

* use declarations instead of src root and ship it with package. also use tsconfig.json instead of tsconfig.base as it has better IDE support. Also add a watcher

* use declarations instead of src root and ship it with package. also use tsconfig.json instead of tsconfig.base as it has better IDE support. Also add a watcher

* use declarations instead of src root and ship it with package. also use tsconfig.json instead of tsconfig.base as it has better IDE support. Also add a watcher
This commit is contained in:
Bill Glesias
2025-10-27 20:07:46 -04:00
committed by GitHub
parent 4ea36d4d8d
commit d5cc26de3d
37 changed files with 48 additions and 39 deletions

View File

@@ -18,7 +18,8 @@
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
"test-unit": "vitest run",
"test:clean": "find ./test/__fixtures__ -depth -name 'output.*' -type f -exec rm {} \\;",
"tslint": "tslint --config ../ts/tslint.json --project ."
"tslint": "tslint --config ../ts/tslint.json --project .",
"watch": "yarn build:cjs --watch & yarn build:esm --watch"
},
"dependencies": {
"@babel/core": "^7.28.0",
@@ -53,7 +54,7 @@
"cjs/*",
"esm/*"
],
"types": "src/index.ts",
"types": "cjs/index.d.ts",
"module": "esm/index.js",
"nx": {}
}

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./cjs",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./esm",

View File

@@ -14,6 +14,7 @@
"resolveJsonModule": true,
"types": [
"node"
]
],
"declaration": true
}
}

View File

@@ -9,7 +9,7 @@
"cjs/*",
"esm/*"
],
"types": "src/index.ts",
"types": "cjs/index.d.ts",
"scripts": {
"build": "yarn build:esm && yarn build:cjs",
"build-prod": "yarn build",
@@ -21,7 +21,9 @@
"test": "yarn test-unit",
"test-unit": "vitest run",
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
"tslint": "tslint --config ../ts/tslint.json --project ."
"tslint": "tslint --config ../ts/tslint.json --project .",
"watch": "yarn build:cjs --watch & yarn build:esm --watch"
},
"dependencies": {
"ansi_up": "5.0.0",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./cjs",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./esm",

View File

@@ -9,6 +9,7 @@
"noUncheckedIndexedAccess": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"esModuleInterop": true
"esModuleInterop": true,
"declaration": true
}
}

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"include": [
"index.ts"
],

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"include": [
"index.mts"
],

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./lib",
"outDir": "./cjs",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./lib",
"outDir": "./esm",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./lib",
"outDir": "./cjs",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./lib",
"outDir": "./esm",

View File

@@ -1,6 +1,5 @@
import path from 'path'
let fs: typeof import('fs-extra')
import fs from 'fs-extra'
export type RunnerPkg = 'app' | 'runner'
@@ -11,8 +10,6 @@ export const resolveFromPackages = (...args: string[]) => {
}
const getRunnerContents = (filename: string) => {
fs ??= require('fs-extra') as typeof import('fs-extra')
return fs.readFile(getPathToDist('runner', filename))
}

View File

@@ -23,7 +23,7 @@
"cjs/*",
"esm/*"
],
"types": "./lib/index.ts",
"types": "./cjs/index.d.ts",
"module": "esm/index.js",
"nx": {}
}

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./lib",
"outDir": "./cjs",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./lib",
"outDir": "./esm",

View File

@@ -5,6 +5,7 @@
"compilerOptions": {
"allowJs": false,
"esModuleInterop": true,
"skipLibCheck": true
"skipLibCheck": true,
"declaration": true
}
}

View File

@@ -2,4 +2,6 @@
Bundles the monorepo root `package.json` as an installable package, allowing `@packages/root` to be installed in any context without having an absolute reference to the root `package.json`
In order to accomplish this, `rollup` is used to bundle the `package.json`, as packages may be interpreted in place or be installed inside the `node_modules` directory. This package builds an `index.mjs` file for packages using `vite`/ ES Modules and an `index.js` file for any CommonJS entry points.
In order to accomplish this, `rollup` is used to bundle the `package.json`, as packages may be interpreted in place or be installed inside the `node_modules` directory. This package builds an `index.mjs` file for packages using `vite`/ ES Modules and an `index.js` file for any CommonJS entry points.
We currently don't use a watcher for this package because it is so small, so if any changes happen to the `package.json` in the root you will need to manually retrigger the build of this package.

View File

@@ -15,7 +15,8 @@
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
"test": "vitest run",
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
"tslint": "tslint --config ../ts/tslint.json --project ."
"tslint": "tslint --config ../ts/tslint.json --project .",
"watch": "yarn build:cjs --watch & yarn build:esm --watch"
},
"dependencies": {
"compare-versions": "4.1.3",
@@ -38,7 +39,7 @@
"cjs/*",
"esm/*"
],
"types": "src/index.ts",
"types": "cjs/index.d.ts",
"module": "esm/index.js",
"nx": {}
}

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"include": [
"src/dependencies.ts"
],

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./cjs",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./esm",

View File

@@ -15,6 +15,7 @@
"noUncheckedIndexedAccess": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true
"skipLibCheck": true,
"declaration": true
}
}

View File

@@ -17,7 +17,7 @@
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
"test-unit": "vitest run",
"tslint": "tslint --config ../ts/tslint.json --project .",
"watch": "tsc --watch"
"watch": "yarn build:cjs --watch & yarn build:esm --watch & yarn build:browser -w"
},
"dependencies": {
"@opentelemetry/api": "1.4.1",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"include": [
"src/client.ts"
],

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"include": [
"src/**/*.ts"
],

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"include": [
"src/**/*.ts"
],

View File

@@ -12,7 +12,8 @@
"check-ts": "tsc -p tsconfig.cjs.json --noEmit",
"clean": "rimraf cjs esm",
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
"test": "vitest run"
"test": "vitest run",
"watch": "yarn build:cjs --watch & yarn build:esm --watch"
},
"dependencies": {
"semver": "^7.7.1"
@@ -33,7 +34,7 @@
"cjs/*",
"esm/*"
],
"types": "src/index.ts",
"types": "cjs/index.d.ts",
"module": "esm/index.js",
"workspaces": {
"nohoist": [

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./cjs",

View File

@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.base.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./esm",

View File

@@ -14,6 +14,7 @@
"ignoreDeprecations": "5.0",
"importsNotUsedAsValues": "error",
"skipLibCheck": true,
"declaration": true,
"resolveJsonModule": true,
"types": [
"mocha",