Skip to content

Commit 4da611c

Browse files
authored
Merge branch 'master' into 204-parser-has-issues-with-blanks-and-quotes-in-unique-attributes
2 parents 4f80572 + e943184 commit 4da611c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+11872
-13492
lines changed

.changeset/gentle-guests-doubt.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
"@bbob/cli": patch
3+
"@bbob/core": patch
4+
"@bbob/html": patch
5+
"@bbob/parser": patch
6+
"@bbob/plugin-helper": patch
7+
"@bbob/preset-html5": patch
8+
"@bbob/preset-react": patch
9+
"@bbob/preset-vue": patch
10+
"@bbob/preset": patch
11+
"@bbob/react": patch
12+
"@bbob/types": patch
13+
"@bbob/vue2": patch
14+
"@bbob/vue3": patch
15+
---
16+
17+
fix: proper module resolution in all cases (Node CJS, Node ESM, bundler)
18+
19+
Allow usages of this library in ESM scenarios (Vite SSR, pure Node using ESM) by fixing incorrect exports of the ESM output (use correct .mjs extension, separate types files for CJS and ESM output, package.json fixes)
20+
21+
Fixes #232, #214, #135

.changeset/slimy-colts-drive.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
"@bbob/plugin-helper": patch
3+
"@bbob/preset-html5": patch
4+
"@bbob/preset-react": patch
5+
"@bbob/preset-vue": patch
6+
"@bbob/parser": patch
7+
"@bbob/preset": patch
8+
"@bbob/react": patch
9+
"@bbob/types": patch
10+
"@bbob/core": patch
11+
"@bbob/html": patch
12+
"@bbob/vue2": patch
13+
"@bbob/vue3": patch
14+
"@bbob/cli": patch
15+
---
16+
17+
fixes problem with context free tags
18+
19+
now code like `[code][codeButton]text[/codeButton][/code]`
20+
will be parsed correctly to `<code>[codeButton]text[/codeButton]</code>`

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ jobs:
4040
- name: Run the coverage
4141
run: pnpm run cover
4242

43-
- name: Coveralls
44-
uses: coverallsapp/github-action@v2
43+
# - name: Coveralls
44+
# uses: coverallsapp/github-action@v2

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
setupFilesAfterEnv: [`${__dirname}/jest.setup.js`],
88
coverageDirectory: './coverage/',
99
collectCoverage: true,
10+
resolver: "ts-jest-resolver",
1011
transform: {
1112
'\\.[jt]sx?$': ['@swc/jest', { ...config }],
1213
},

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
"rollup-plugin-gzip": "3.1.0",
6767
"rollup-plugin-swc3": "0.11.0",
6868
"size-limit": "11.0.1",
69+
"ts-jest-resolver": "^2.0.1",
70+
"ts2mjs": "^4.0.0",
6971
"typescript": "5.1.6"
7072
},
7173
"publishConfig": {
@@ -80,13 +82,13 @@
8082
},
8183
"pkgTasks": {
8284
"build:commonjs": "@/cross-env BABEL_ENV=commonjs NODE_ENV=production @/swc ./src/ --config-file ../../.swcrc-commonjs.json --out-dir lib --strip-leading-paths",
83-
"build:es": "@/cross-env BABEL_ENV=es NODE_ENV=production @/swc ./src/ --config-file ../../.swcrc.json --out-dir es --strip-leading-paths",
85+
"build:es": "@/cross-env BABEL_ENV=es NODE_ENV=production @/swc ./src/ --config-file ../../.swcrc.json --out-dir es --strip-leading-paths && @/ts2mjs es --remove-source",
8486
"build:umd": "@/cross-env BABEL_ENV=rollup NODE_ENV=production @/rollup --config ../../rollup.config.mjs",
8587
"build": "npm run build:es && npm run build:commonjs && npm run build:umd",
8688
"test": "@/jest",
8789
"cover": "@/jest --coverage .",
8890
"lint": "@/eslint .",
89-
"types": "@/tsc",
91+
"types": "@/tsc && @/ts2mjs types",
9092
"bundlesize": "npm run build && @/cross-env NODE_ENV=production @/bundlesize .",
9193
"size": "npm run build && @/cross-env NODE_ENV=production @/size-limit ."
9294
},

packages/bbob-cli/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@
66
"bbob": "lib/cli.js"
77
},
88
"main": "lib/index.js",
9-
"module": "es/index.js",
10-
"jsnext:main": "es/index.js",
9+
"module": "es/index.mjs",
10+
"jsnext:main": "es/index.mjs",
1111
"browser": "dist/index.js",
1212
"browserName": "BbobCli",
1313
"types": "types/index.d.ts",
1414
"exports": {
1515
".": {
16-
"types": "./types/index.d.ts",
17-
"import": "./es/index.js",
18-
"require": "./lib/index.js",
16+
"import": {
17+
"types": "./types/index.d.mts",
18+
"default": "./es/index.mjs"
19+
},
20+
"require": {
21+
"types": "./types/index.d.ts",
22+
"default": "./lib/index.js"
23+
},
1924
"browser": "./dist/index.min.js",
2025
"umd": "./dist/index.min.js"
2126
}

packages/bbob-cli/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env node
2-
import { run } from './index';
2+
import { run } from './index.js';
33

44
run(process.stdin, process.stdout);

packages/bbob-core/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,21 @@
2525
"@bbob/types": "*"
2626
},
2727
"main": "lib/index.js",
28-
"module": "es/index.js",
29-
"jsnext:main": "es/index.js",
28+
"module": "es/index.mjs",
29+
"jsnext:main": "es/index.mjs",
3030
"browser": "dist/index.js",
3131
"browserName": "BbobCore",
3232
"types": "types/index.d.ts",
3333
"exports": {
3434
".": {
35-
"types": "./types/index.d.ts",
36-
"import": "./es/index.js",
37-
"require": "./lib/index.js",
35+
"import": {
36+
"types": "./types/index.d.mts",
37+
"default": "./es/index.mjs"
38+
},
39+
"require": {
40+
"types": "./types/index.d.ts",
41+
"default": "./lib/index.js"
42+
},
3843
"browser": "./dist/index.min.js",
3944
"umd": "./dist/index.min.js"
4045
}

packages/bbob-core/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import type {
99
} from "@bbob/types";
1010

1111
import { parse } from '@bbob/parser';
12-
import { iterate, match } from './utils';
13-
import { C1, C2 } from './errors'
12+
import { iterate, match } from './utils.js';
13+
import { C1, C2 } from './errors.js'
1414

1515
export function createTree<Options extends BBobCoreOptions = BBobCoreOptions>(tree: NodeContent[], options: Options) {
1616
const extendedTree = tree as BBobCoreTagNodeTree

packages/bbob-html/package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,21 @@
1414
"@bbob/types": "*"
1515
},
1616
"main": "lib/index.js",
17-
"module": "es/index.js",
18-
"jsnext:main": "es/index.js",
17+
"module": "es/index.mjs",
18+
"jsnext:main": "es/index.mjs",
1919
"browser": "dist/index.js",
2020
"browserName": "BbobHtml",
2121
"types": "types/index.d.ts",
2222
"exports": {
2323
".": {
24-
"types": "./types/index.d.ts",
25-
"import": "./es/index.js",
26-
"require": "./lib/index.js",
24+
"import": {
25+
"types": "./types/index.d.mts",
26+
"default": "./es/index.mjs"
27+
},
28+
"require": {
29+
"types": "./types/index.d.ts",
30+
"default": "./lib/index.js"
31+
},
2732
"browser": "./dist/index.min.js",
2833
"umd": "./dist/index.min.js"
2934
}

0 commit comments

Comments
 (0)