-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use rollup to build cypress integraiton
make cypress integration compatible with both cjs and esm modules move some common utilities from node to framework directory change commons build workflow use absolute imports instead of relative ones in cypress tests use new commons for cypress integration
- Loading branch information
Showing
69 changed files
with
865 additions
and
612 deletions.
There are no files selected for viewing
Binary file added
BIN
+48.3 KB
.yarn/cache/@rollup-plugin-commonjs-npm-25.0.7-f5b19139ea-052e11839a.zip
Binary file not shown.
Binary file added
BIN
+31 KB
.yarn/cache/@rollup-plugin-node-resolve-npm-15.2.3-f49fe9c656-730f32c2f8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-1010 KB
.yarn/cache/@rollup-rollup-linux-arm64-gnu-npm-4.12.1-e7008bf7a0-8.zip
Binary file not shown.
Binary file added
BIN
+1010 KB
.yarn/cache/@rollup-rollup-linux-arm64-gnu-npm-4.13.0-3f49f23698-8.zip
Binary file not shown.
Binary file removed
BIN
-956 KB
.yarn/cache/@rollup-rollup-linux-arm64-musl-npm-4.12.1-f258e99204-8.zip
Binary file not shown.
Binary file added
BIN
+946 KB
.yarn/cache/@rollup-rollup-linux-arm64-musl-npm-4.13.0-8b79e93ea4-8.zip
Binary file not shown.
Binary file removed
BIN
-1.02 MB
.yarn/cache/@rollup-rollup-linux-x64-gnu-npm-4.12.1-36af329d25-8.zip
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-1.02 MB
.yarn/cache/@rollup-rollup-linux-x64-musl-npm-4.12.1-4fa4fd82ac-8.zip
Binary file not shown.
Binary file added
BIN
+1.03 MB
.yarn/cache/@rollup-rollup-linux-x64-musl-npm-4.13.0-725a5f475a-8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,19 +20,23 @@ | |
"author": "Qameta Software <[email protected]> (https://qameta.io/)", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./commands": { | ||
"require": "./dist/commands.js", | ||
"import": "./dist/commands.mjs", | ||
"require": "./dist/commands.cjs", | ||
"types": "./dist/commands.d.ts" | ||
}, | ||
"./reporter": { | ||
"require": "./dist/reporter.js", | ||
"import": "./dist/reporter.mjs", | ||
"require": "./dist/reporter.cjs", | ||
"types": "./dist/reporter.d.ts" | ||
} | ||
}, | ||
"main": "./dist/index.js", | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"directories": { | ||
"test": "test" | ||
|
@@ -42,7 +46,9 @@ | |
], | ||
"scripts": { | ||
"clean": "rimraf ./dist ./out", | ||
"compile": "ts-node ./esbuild.ts && tsc --emitDeclarationOnly", | ||
"compile": "run-p 'compile:*'", | ||
"compile:lib": "rollup -c", | ||
"compile:types": "tsc --project ./tsconfig.json", | ||
"coverage": "codecov", | ||
"lint": "eslint ./src --ext .ts", | ||
"lint:fix": "eslint ./src --ext .ts --fix", | ||
|
@@ -53,6 +59,9 @@ | |
}, | ||
"devDependencies": { | ||
"@jest/globals": "^29.7.0", | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-typescript": "^11.1.6", | ||
"@types/eslint": "^8", | ||
"@types/glob": "^8.1.0", | ||
"@types/jest": "^29.5.12", | ||
|
@@ -63,7 +72,6 @@ | |
"allure-jest": "workspace:*", | ||
"cypress": "^13.6.0", | ||
"enquirer": "^2.3.6", | ||
"esbuild": "^0.20.0", | ||
"eslint": "^8.49.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-cypress": "^2.15.1", | ||
|
@@ -73,9 +81,12 @@ | |
"eslint-plugin-prefer-arrow": "^1.2.3", | ||
"glob": "^10.3.5", | ||
"jest": "^29.7.0", | ||
"npm-run-all": "^4.1.5", | ||
"rimraf": "^5.0.1", | ||
"rollup": "^4.13.0", | ||
"ts-jest": "^29.1.2", | ||
"ts-node": "^10.9.2", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.2.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import typescriptPlugin from "@rollup/plugin-typescript"; | ||
import commonjsPlugin from "@rollup/plugin-commonjs"; | ||
import resolvePlugin from "@rollup/plugin-node-resolve"; | ||
import { glob } from "glob"; | ||
import { join, relative } from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import { defineConfig } from "rollup"; | ||
|
||
const dirname = fileURLToPath(new URL(".", import.meta.url)); | ||
|
||
const createNodeEntry = (inputFile) => { | ||
const outputFileBase = inputFile.replace(/^src/, "dist"); | ||
const external = ["node:fs", "allure-js-commons/new", "allure-js-commons/new/node"]; | ||
|
||
return [ | ||
defineConfig({ | ||
input: inputFile, | ||
output: { | ||
file: join(dirname, outputFileBase.replace(/\.ts$/, ".mjs")), | ||
format: "esm", | ||
exports: "named", | ||
sourcemap: true, | ||
}, | ||
plugins: [ | ||
typescriptPlugin({ | ||
tsconfig: "./tsconfig.rollup.json", | ||
}), | ||
], | ||
external, | ||
}), | ||
defineConfig({ | ||
input: inputFile, | ||
output: { | ||
file: join(dirname, outputFileBase.replace(/\.ts$/, ".cjs")), | ||
format: "cjs", | ||
exports: "named", | ||
sourcemap: true, | ||
}, | ||
plugins: [ | ||
typescriptPlugin({ | ||
tsconfig: "./tsconfig.rollup.json", | ||
}), | ||
], | ||
external, | ||
}), | ||
]; | ||
}; | ||
const createBrowserEntry = (inputFile) => { | ||
const outputFileBase = inputFile.replace(/^src/, "dist"); | ||
|
||
return [ | ||
defineConfig({ | ||
input: inputFile, | ||
output: { | ||
file: join(dirname, outputFileBase.replace(/\.ts$/, ".mjs")), | ||
format: "esm", | ||
exports: "named", | ||
sourcemap: true, | ||
}, | ||
plugins: [ | ||
typescriptPlugin({ | ||
tsconfig: "./tsconfig.rollup.json", | ||
}), | ||
resolvePlugin(), | ||
commonjsPlugin(), | ||
], | ||
// external, | ||
}), | ||
defineConfig({ | ||
input: inputFile, | ||
output: { | ||
file: join(dirname, outputFileBase.replace(/\.ts$/, ".cjs")), | ||
format: "cjs", | ||
exports: "named", | ||
sourcemap: true, | ||
}, | ||
plugins: [ | ||
typescriptPlugin({ | ||
tsconfig: "./tsconfig.rollup.json", | ||
}), | ||
resolvePlugin(), | ||
commonjsPlugin(), | ||
], | ||
// external, | ||
}), | ||
]; | ||
}; | ||
|
||
export default () => { | ||
return [ | ||
createBrowserEntry("src/index.ts"), | ||
createBrowserEntry("src/commands.ts"), | ||
createNodeEntry("src/reporter.ts"), | ||
].flat(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.