Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add d.ts file compilation to testkit #2585

Merged
merged 7 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/testkit/__TESTS__/dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ test.describe("dropdown Class with Storybook", () => {
});

test("set dropdown value", async ({ page }) => {
await page.waitForTimeout(3000);
// extended wait for interaction test to finish
await page.waitForTimeout(10000);
await DropDown.inputField.setText("");
YossiSaadi marked this conversation as resolved.
Show resolved Hide resolved
await DropDown.selectItem("2");
await page.waitForTimeout(500);
expect(await DropDown.getText()).toContain("2");
Expand Down
6 changes: 6 additions & 0 deletions packages/testkit/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint.config.js
export default [
{
ignores: ["node_modules/", "dist/", "*.config.js", "*.spec.js"],
}
];
16 changes: 14 additions & 2 deletions packages/testkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
"TESTING",
"E2E"
],
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/esm/index.js",
"types": "./dist/index.d.ts"
}
},
"author": "monday.com",
"homepage": "https://github.com/mondaycom/vibe#readme",
"license": "ISC",
Expand All @@ -17,13 +26,16 @@
},
"scripts": {
"test:e2e": "npx playwright test",
"build": "tsc",
"start-server": "yarn lerna run storybook --scope=monday-ui-react-core"
"build": "tsc && tsc --project tsconfig.esm.json",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this for a different esm and cjs? why we need cjs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have clients that use commonjs. i.e the monolith. So we need it for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the monolith can use esm as far as I know
@talkor, does it did any trouble to you with @vibe/core when you used esm only?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, all good

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you separate the cases? @uziab
have a release with esm only and add cjs if the need arises?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry no, The monolith e2e project can't handle esm, so we would need cjs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got ya, ok let's leave it for now and try to tackle it later on

"start-server": "yarn lerna run storybook --scope=monday-ui-react-core",
"lint": "eslint \"./**/*.{js,jsx,ts,tsx}\"",
"lint:fix": "yarn lint -- --fix"
},
"bugs": {
"url": "https://github.com/mondaycom/vibe/issues"
},
"devDependencies": {
"eslint": "^8.23.0",
"@playwright/test": "1.45.3"
}
}
8 changes: 8 additions & 0 deletions packages/testkit/tsconfig.esm.json
uziab marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "dist/esm",
"module": "esnext"
},
"include": ["./**/*.ts"]
}
45 changes: 18 additions & 27 deletions packages/testkit/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "dist",
"strict": true,
"sourceMap": true,
"strictNullChecks": true,
"moduleResolution": "node",
"importHelpers": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"rootDir": ".",
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
},
"include": [ "buttons", "inputs", "navigation", "pickers", "popover", "text", "utils", "BaseElement.ts", "index.ts"]
}
"compilerOptions": {
"lib": ["ESNext"],
YossiSaadi marked this conversation as resolved.
Show resolved Hide resolved
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"strict": true,
"skipLibCheck": true,
"noImplicitAny": true,
"outDir": "dist",
"baseUrl": ".",
"allowSyntheticDefaultImports": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["./**/*.ts"],
"exclude": ["__TESTS__", "./playwright.config.ts", "node_modules", "dist"]
}
Binary file added packages/testkit/vibe-testkit-1.0.2.tgz
YossiSaadi marked this conversation as resolved.
Show resolved Hide resolved
Binary file not shown.
5,198 changes: 2,608 additions & 2,590 deletions yarn.lock
YossiSaadi marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.