Skip to content

Commit

Permalink
enchanced build (via #978)
Browse files Browse the repository at this point in the history
  • Loading branch information
epszaw authored May 31, 2024
1 parent c9b91db commit 171940c
Show file tree
Hide file tree
Showing 543 changed files with 9,867 additions and 8,811 deletions.
6 changes: 4 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
"eslint-plugin-prefer-arrow",
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"@typescript-eslint"
"@typescript-eslint",
],
rules: {
"@typescript-eslint/ban-ts-comment": "off",
Expand Down Expand Up @@ -64,6 +64,8 @@ module.exports = {
],
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/explicit-member-accessibility": [
"off",
Expand Down Expand Up @@ -245,6 +247,6 @@ module.exports = {
},
],
"use-isnan": "error",
"valid-typeof": "off"
"valid-typeof": "off",
},
};
5,836 changes: 3,472 additions & 2,364 deletions .pnp.cjs

Large diffs are not rendered by default.

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/argv-npm-0.0.2-48b22895d8-5670f77bb2.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.
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.
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.
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.
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.
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.
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ws-npm-8.16.0-46943f6199-7c511c59e9.zip
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"eslint-plugin-prefer-arrow": "^1.2.3",
"husky": "^9.0.0",
"lint-staged": "^15.0.0",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"prettier-plugin-packagejson": "^2.4.9",
"rimraf": "^5.0.1",
"typescript": "^5.2.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/allure-codeceptjs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
test-results
test/fixtures
test/temp
23 changes: 23 additions & 0 deletions packages/allure-codeceptjs/babel.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"presets": [
[
"@babel/preset-typescript",
{
"rewriteImportExtensions": true
}
],
[
"@babel/preset-env",
{
"modules": "commonjs",
}
]
],
"plugins": [
"babel-plugin-add-module-exports",
],
"targets": {
"esmodules": false,
"node": 18
}
}
15 changes: 15 additions & 0 deletions packages/allure-codeceptjs/babel.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
[
"@babel/preset-typescript",
{
"rewriteImportExtensions": true
}
],
["@babel/preset-env", { "modules": false }]
],
"targets": {
"esmodules": true,
"node": 18
}
}
38 changes: 22 additions & 16 deletions packages/allure-codeceptjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,47 @@
"license": "Apache-2.0",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts",
"files": [
"dist"
],
"scripts": {
"clean": "rimraf ./dist ./out ./test-results",
"compile": "run-p 'compile:*'",
"compile:lib": "rollup -c",
"compile:types": "tsc --project ./tsconfig.dts.json",
"compile": "run-s 'compile:*'",
"compile:esm": "babel --config-file ./babel.esm.json ./src --out-dir ./dist/esm --extensions '.ts' --source-maps",
"compile:cjs": "babel --config-file ./babel.cjs.json ./src --out-dir ./dist/cjs --extensions '.ts' --source-maps",
"compile:types": "tsc --declaration --emitDeclarationOnly",
"compile:fixup": "node ./scripts/fixup.mjs",
"lint": "eslint ./src ./test --ext .ts",
"lint:fix": "eslint ./src ./test --ext .ts --fix",
"test": "vitest run test/spec"
"test": "vitest run"
},
"dependencies": {
"allure-js-commons": "workspace:*",
"strip-ansi": "^5.2.0"
"allure-js-commons": "workspace:*"
},
"devDependencies": {
"@babel/cli": "^7.24.6",
"@babel/core": "^7.24.6",
"@babel/plugin-transform-modules-commonjs": "^7.24.6",
"@babel/preset-env": "^7.24.6",
"@babel/preset-typescript": "^7.24.6",
"@codeceptjs/configure": "^1.0.0",
"@codeceptjs/helper": "^2.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/babel__core": "^7",
"@types/babel__preset-env": "^7",
"@types/eslint": "^8",
"@types/jasmine": "^5.1.4",
"@types/node": "^20.6.3",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"babel-plugin-add-module-exports": "^1.0.4",
"codeceptjs": "^3.5.4",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -56,12 +65,9 @@
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-prefer-arrow": "^1.2.3",
"expect": "^29.7.0",
"glob": "^10.3.12",
"npm-run-all2": "^6.1.2",
"rimraf": "^5.0.1",
"rollup": "^4.16.3",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vitest": "^1.5.0"
}
Expand Down
55 changes: 0 additions & 55 deletions packages/allure-codeceptjs/rollup.config.mjs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { mkdirSync, writeFileSync } from "node:fs";
import { join, resolve } from "node:path";
import { fileURLToPath } from "node:url";

const esmBuildPath = resolve(__dirname, "../dist/esm");
const cjsBuildPath = resolve(__dirname, "../dist/cjs");
const dirname = fileURLToPath(new URL(".", import.meta.url));
const esmBuildPath = resolve(dirname, "../dist/esm");
const cjsBuildPath = resolve(dirname, "../dist/cjs");

try {
mkdirSync(esmBuildPath, { recursive: true });
Expand Down
8 changes: 6 additions & 2 deletions packages/allure-codeceptjs/src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Label, LabelName, allureIdRegexp, allureLabelRegexp } from "allure-js-commons";
import { CodeceptTest } from "./model";
import type { Label } from "allure-js-commons";
import { LabelName } from "allure-js-commons";
import type { CodeceptTest } from "./model.js";

const allureIdRegexp = /@?allure.id[:=](?<id>[^\s]+)/;
const allureLabelRegexp = /@?allure.label.(?<name>[^\s]+?)[:=](?<value>[^\s]+)/;

export const extractMeta = (test: CodeceptTest & { tags: string[] }) => {
const labels: Label[] = test.tags.map((tag) => {
Expand Down
8 changes: 5 additions & 3 deletions packages/allure-codeceptjs/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { setGlobalTestRuntime } from "allure-js-commons/sdk/node";
import { AllureCodeceptJsConfig } from "./model.js";
import { setGlobalTestRuntime } from "allure-js-commons/sdk/runtime";
import { allureCodeceptJsLegacyApi } from "./legacy.js";
import type { AllureCodeceptJsConfig } from "./model.js";
import { AllureCodeceptJsReporter } from "./reporter.js";
import { AllureCodeceptJsTestRuntime } from "./runtime.js";

const allurePlugin = (config: AllureCodeceptJsConfig) => {
const reporter = new AllureCodeceptJsReporter(config);
const testRuntime = new AllureCodeceptJsTestRuntime(reporter);

// @ts-ignore
setGlobalTestRuntime(testRuntime);

return testRuntime;
return allureCodeceptJsLegacyApi;
};

export default allurePlugin;
132 changes: 132 additions & 0 deletions packages/allure-codeceptjs/src/legacy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import * as allure from "allure-js-commons";

/**
* @deprecated please use api exported by "allure-js-commons" instead.
*/
export interface AllureCodeceptJsLegacyApi {
label: (name: string, value: string) => Promise<void>;
link: (type: string, url: string, name?: string) => Promise<void>;
parameter: (
name: string,
value: string,
options?: { excluded?: boolean; mode?: "hidden" | "masked" | "default" },
) => Promise<void>;
description: (markdown: string) => Promise<void>;
descriptionHtml: (html: string) => Promise<void>;
testCaseId: (id: string) => Promise<void>;
historyId: (id: string) => Promise<void>;
allureId: (id: string) => Promise<void>;
displayName: (name: string) => Promise<void>;
attachment: (name: string, content: Buffer | string, type: string) => Promise<void>;
issue: (name: string, url: string) => Promise<void>;
tms: (name: string, url: string) => Promise<void>;
epic: (name: string) => Promise<void>;
feature: (name: string) => Promise<void>;
story: (name: string) => Promise<void>;
suite: (name: string) => Promise<void>;
parentSuite: (name: string) => Promise<void>;
subSuite: (name: string) => Promise<void>;
owner: (name: string) => Promise<void>;
severity: (name: string) => Promise<void>;
layer: (name: string) => Promise<void>;
tag: (name: string) => Promise<void>;
step: (name: string, body: () => Promise<void>) => Promise<void>;
}

/**
* @deprecated please use api exported by "allure-js-commons" instead.
*/
export const allureCodeceptJsLegacyApi: AllureCodeceptJsLegacyApi = {
/**
* @deprecated please use import { label } from "allure-js-commons" instead.
*/
label: (...args) => Promise.resolve(allure.label(...args)),
/**
* @deprecated please use import { link } from "allure-js-commons" instead.
*/
link: (type, url, name) => Promise.resolve(allure.link(url, type, name)),
/**
* @deprecated please use import { parameter } from "allure-js-commons" instead.
*/
parameter: (name, value, options) => Promise.resolve(allure.parameter(name, value, options)),
/**
* @deprecated please use import { description } from "allure-js-commons" instead.
*/
description: (...args) => Promise.resolve(allure.description(...args)),
/**
* @deprecated please use import { descriptionHtml } from "allure-js-commons" instead.
*/
descriptionHtml: (html) => Promise.resolve(allure.descriptionHtml(html)),
/**
* @deprecated please use import { testCaseId } from "allure-js-commons" instead.
*/
testCaseId: (id) => Promise.resolve(allure.testCaseId(id)),
/**
* @deprecated please use import { historyId } from "allure-js-commons" instead.
*/
historyId: (id) => Promise.resolve(allure.historyId(id)),
/**
* @deprecated please use import { allureId } from "allure-js-commons" instead.
*/
allureId: (id) => Promise.resolve(allure.allureId(id)),
/**
* @deprecated please use import { displayName } from "allure-js-commons" instead.
*/
displayName: (name) => Promise.resolve(allure.displayName(name)),
/**
* @deprecated please use import { attachment } from "allure-js-commons" instead.
*/
attachment: (name, content, type) => Promise.resolve(allure.attachment(name, content, type)),
/**
* @deprecated please use import { issue } from "allure-js-commons" instead.
*/
issue: (name, url) => Promise.resolve(allure.issue(url, name)),
/**
* @deprecated please use import { tms } from "allure-js-commons" instead.
*/
tms: (name, url) => Promise.resolve(allure.tms(url, name)),
/**
* @deprecated please use import { epic } from "allure-js-commons" instead.
*/
epic: (name) => Promise.resolve(allure.epic(name)),
/**
* @deprecated please use import { feature } from "allure-js-commons" instead.
*/
feature: (name) => Promise.resolve(allure.feature(name)),
/**
* @deprecated please use import { story } from "allure-js-commons" instead.
*/
story: (name) => Promise.resolve(allure.story(name)),
/**
* @deprecated please use import { suite } from "allure-js-commons" instead.
*/
suite: (name) => Promise.resolve(allure.suite(name)),
/**
* @deprecated please use import { parentSuite } from "allure-js-commons" instead.
*/
parentSuite: (name) => Promise.resolve(allure.parentSuite(name)),
/**
* @deprecated please use import { subSuite } from "allure-js-commons" instead.
*/
subSuite: (name) => Promise.resolve(allure.subSuite(name)),
/**
* @deprecated please use import { owner } from "allure-js-commons" instead.
*/
owner: (name) => Promise.resolve(allure.owner(name)),
/**
* @deprecated please use import { severity } from "allure-js-commons" instead.
*/
severity: (name) => Promise.resolve(allure.severity(name)),
/**
* @deprecated please use import { layer } from "allure-js-commons" instead.
*/
layer: (name) => Promise.resolve(allure.layer(name)),
/**
* @deprecated please use import { tag } from "allure-js-commons" instead.
*/
tag: (name) => Promise.resolve(allure.tag(name)),
/**
* @deprecated please use import { step } from "allure-js-commons" instead.
*/
step: (name, body) => Promise.resolve(allure.step(name, body)),
};
2 changes: 1 addition & 1 deletion packages/allure-codeceptjs/src/model.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Config } from "allure-js-commons/sdk/browser";
import type { Config } from "allure-js-commons/sdk/reporter";

export interface CodeceptError {
params: any;
Expand Down
Loading

0 comments on commit 171940c

Please sign in to comment.