mirror of
https://github.com/cypress-io/cypress.git
synced 2025-12-20 13:51:29 -06:00
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:
@@ -18,7 +18,8 @@
|
|||||||
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
|
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
|
||||||
"test-unit": "vitest run",
|
"test-unit": "vitest run",
|
||||||
"test:clean": "find ./test/__fixtures__ -depth -name 'output.*' -type f -exec rm {} \\;",
|
"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": {
|
"dependencies": {
|
||||||
"@babel/core": "^7.28.0",
|
"@babel/core": "^7.28.0",
|
||||||
@@ -53,7 +54,7 @@
|
|||||||
"cjs/*",
|
"cjs/*",
|
||||||
"esm/*"
|
"esm/*"
|
||||||
],
|
],
|
||||||
"types": "src/index.ts",
|
"types": "cjs/index.d.ts",
|
||||||
"module": "esm/index.js",
|
"module": "esm/index.js",
|
||||||
"nx": {}
|
"nx": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./cjs",
|
"outDir": "./cjs",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./esm",
|
"outDir": "./esm",
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"types": [
|
"types": [
|
||||||
"node"
|
"node"
|
||||||
]
|
],
|
||||||
|
"declaration": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
"cjs/*",
|
"cjs/*",
|
||||||
"esm/*"
|
"esm/*"
|
||||||
],
|
],
|
||||||
"types": "src/index.ts",
|
"types": "cjs/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "yarn build:esm && yarn build:cjs",
|
"build": "yarn build:esm && yarn build:cjs",
|
||||||
"build-prod": "yarn build",
|
"build-prod": "yarn build",
|
||||||
@@ -21,7 +21,9 @@
|
|||||||
"test": "yarn test-unit",
|
"test": "yarn test-unit",
|
||||||
"test-unit": "vitest run",
|
"test-unit": "vitest run",
|
||||||
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
|
"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": {
|
"dependencies": {
|
||||||
"ansi_up": "5.0.0",
|
"ansi_up": "5.0.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./cjs",
|
"outDir": "./cjs",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./esm",
|
"outDir": "./esm",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": true
|
"esModuleInterop": true,
|
||||||
|
"declaration": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": [
|
"include": [
|
||||||
"index.ts"
|
"index.ts"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": [
|
"include": [
|
||||||
"index.mts"
|
"index.mts"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./lib",
|
"rootDir": "./lib",
|
||||||
"outDir": "./cjs",
|
"outDir": "./cjs",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./lib",
|
"rootDir": "./lib",
|
||||||
"outDir": "./esm",
|
"outDir": "./esm",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./lib",
|
"rootDir": "./lib",
|
||||||
"outDir": "./cjs",
|
"outDir": "./cjs",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./lib",
|
"rootDir": "./lib",
|
||||||
"outDir": "./esm",
|
"outDir": "./esm",
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
import fs from 'fs-extra'
|
||||||
let fs: typeof import('fs-extra')
|
|
||||||
|
|
||||||
export type RunnerPkg = 'app' | 'runner'
|
export type RunnerPkg = 'app' | 'runner'
|
||||||
|
|
||||||
@@ -11,8 +10,6 @@ export const resolveFromPackages = (...args: string[]) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getRunnerContents = (filename: string) => {
|
const getRunnerContents = (filename: string) => {
|
||||||
fs ??= require('fs-extra') as typeof import('fs-extra')
|
|
||||||
|
|
||||||
return fs.readFile(getPathToDist('runner', filename))
|
return fs.readFile(getPathToDist('runner', filename))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
"cjs/*",
|
"cjs/*",
|
||||||
"esm/*"
|
"esm/*"
|
||||||
],
|
],
|
||||||
"types": "./lib/index.ts",
|
"types": "./cjs/index.d.ts",
|
||||||
"module": "esm/index.js",
|
"module": "esm/index.js",
|
||||||
"nx": {}
|
"nx": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./lib",
|
"rootDir": "./lib",
|
||||||
"outDir": "./cjs",
|
"outDir": "./cjs",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./lib",
|
"rootDir": "./lib",
|
||||||
"outDir": "./esm",
|
"outDir": "./esm",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"allowJs": false,
|
"allowJs": false,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true
|
"skipLibCheck": true,
|
||||||
|
"declaration": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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`
|
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.
|
||||||
@@ -15,7 +15,8 @@
|
|||||||
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
|
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
|
"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": {
|
"dependencies": {
|
||||||
"compare-versions": "4.1.3",
|
"compare-versions": "4.1.3",
|
||||||
@@ -38,7 +39,7 @@
|
|||||||
"cjs/*",
|
"cjs/*",
|
||||||
"esm/*"
|
"esm/*"
|
||||||
],
|
],
|
||||||
"types": "src/index.ts",
|
"types": "cjs/index.d.ts",
|
||||||
"module": "esm/index.js",
|
"module": "esm/index.js",
|
||||||
"nx": {}
|
"nx": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": [
|
"include": [
|
||||||
"src/dependencies.ts"
|
"src/dependencies.ts"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./cjs",
|
"outDir": "./cjs",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./esm",
|
"outDir": "./esm",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"skipLibCheck": true
|
"skipLibCheck": true,
|
||||||
|
"declaration": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
|
"test-debug": "vitest --inspect-brk --no-file-parallelism --test-timeout=0",
|
||||||
"test-unit": "vitest run",
|
"test-unit": "vitest run",
|
||||||
"tslint": "tslint --config ../ts/tslint.json --project .",
|
"tslint": "tslint --config ../ts/tslint.json --project .",
|
||||||
"watch": "tsc --watch"
|
"watch": "yarn build:cjs --watch & yarn build:esm --watch & yarn build:browser -w"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@opentelemetry/api": "1.4.1",
|
"@opentelemetry/api": "1.4.1",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": [
|
"include": [
|
||||||
"src/client.ts"
|
"src/client.ts"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts"
|
"src/**/*.ts"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts"
|
"src/**/*.ts"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
"check-ts": "tsc -p tsconfig.cjs.json --noEmit",
|
"check-ts": "tsc -p tsconfig.cjs.json --noEmit",
|
||||||
"clean": "rimraf cjs esm",
|
"clean": "rimraf cjs esm",
|
||||||
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
|
"lint": "eslint --ext .js,.jsx,.ts,.tsx,.json, .",
|
||||||
"test": "vitest run"
|
"test": "vitest run",
|
||||||
|
"watch": "yarn build:cjs --watch & yarn build:esm --watch"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": "^7.7.1"
|
"semver": "^7.7.1"
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
"cjs/*",
|
"cjs/*",
|
||||||
"esm/*"
|
"esm/*"
|
||||||
],
|
],
|
||||||
"types": "src/index.ts",
|
"types": "cjs/index.d.ts",
|
||||||
"module": "esm/index.js",
|
"module": "esm/index.js",
|
||||||
"workspaces": {
|
"workspaces": {
|
||||||
"nohoist": [
|
"nohoist": [
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./cjs",
|
"outDir": "./cjs",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.base.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./esm",
|
"outDir": "./esm",
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"ignoreDeprecations": "5.0",
|
"ignoreDeprecations": "5.0",
|
||||||
"importsNotUsedAsValues": "error",
|
"importsNotUsedAsValues": "error",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
"declaration": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"types": [
|
"types": [
|
||||||
"mocha",
|
"mocha",
|
||||||
Reference in New Issue
Block a user