Skip to content

Commit

Permalink
refactor: switch from CJS to ESM to support playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
boan-anbo committed Nov 27, 2023
1 parent c029153 commit d0b68ba
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2,758 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
# Logs
logs
*.log
Expand Down
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"name": "better-tests",
"version": "0.0.1",
"description": "A set of awesome, lightweight, and framework-agonistic tools to help you write better tests",
"description": "A set of awesome, lightweight, and framework-agnostic tools to help you write better tests",
"private": true,
"workspaces": [
"packages/*"
"packages/cantos",
"packages/mermaid-whisper"
],
"scripts": {
"test": "vitest",
"build": "echo \"build is not configured for package \\\"×\\\", skipping\"",
"publish": "cd packages/cantos && npm publish --access public && cd ../.."
"publish:cantos": "cd packages/cantos && yarn prepublish && npm publish && cd ../.."
},
"author": "Bo An",
"license": "ISC",
"devDependencies": {
"vitest": "^1.0.0-beta.4"
}
},
"packageManager": "[email protected]"
}
8 changes: 4 additions & 4 deletions packages/cantos/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cantos",
"author": "Bo An",
"version": "0.0.6",
"version": "0.0.14",
"keywords": [
"User Story",
"TDD",
Expand All @@ -26,8 +26,8 @@
"Svelte"
],
"type": "module",
"main": "./dist/cantos.umd.cjs",
"module": "./dist/cantos.js",
"exports": "./dist/cantos.es.js",
"main": "./dist/cantos.esm.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
Expand All @@ -41,7 +41,7 @@
"test": "vitest",
"test:ui": "vitest --ui",
"mermaid": "^10.6.1",
"publish": "yarn build && npm publish"
"prepublish": "yarn build"
},
"devDependencies": {
"@types/node": "^20.9.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/cantos/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export const viteConfig: UserConfig = {
lib: {
entry: path.resolve(__dirname, './src/index.ts'),
name: 'Cantos',
fileName: 'cantos',
fileName: format => `cantos.${format}.js`,
formats: ['es']
},
rollupOptions: {
external: ['./tests']
Expand Down
Loading

0 comments on commit d0b68ba

Please sign in to comment.