mirror of
https://github.com/tenrok/BBob.git
synced 2026-05-15 11:59:37 +03:00
fix: proper module resolution in all cases (Node CJS, Node ESM, bundler)
* Add extensions to all imports * Set module resolution to `bundler` to avoid Node specific behavior * Use `ts2mjs` to rename files to `mjs` * Add extensions to `@bbob/types` imports * Fix `package.json` for proper ESM extension and type separation * More module resolution stuff change (`node16` for everything, `node` for Vue 2 plugin) * Use `ts-jest-resolver` for `js` -> `ts` resolving in Jest * Add changeset * Add import extensions to frontend libs
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
---
|
||||
"@bbob/cli": patch
|
||||
"@bbob/core": patch
|
||||
"@bbob/html": patch
|
||||
"@bbob/parser": patch
|
||||
"@bbob/plugin-helper": patch
|
||||
"@bbob/preset-html5": patch
|
||||
"@bbob/preset-react": patch
|
||||
"@bbob/preset-vue": patch
|
||||
"@bbob/preset": patch
|
||||
"@bbob/react": patch
|
||||
"@bbob/types": patch
|
||||
"@bbob/vue2": patch
|
||||
"@bbob/vue3": patch
|
||||
---
|
||||
|
||||
fix: proper module resolution in all cases (Node CJS, Node ESM, bundler)
|
||||
|
||||
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)
|
||||
|
||||
Fixes #232, #214, #135
|
||||
@@ -7,6 +7,7 @@ module.exports = {
|
||||
setupFilesAfterEnv: [`${__dirname}/jest.setup.js`],
|
||||
coverageDirectory: './coverage/',
|
||||
collectCoverage: true,
|
||||
resolver: "ts-jest-resolver",
|
||||
transform: {
|
||||
'\\.[jt]sx?$': ['@swc/jest', { ...config }],
|
||||
},
|
||||
|
||||
+4
-2
@@ -66,6 +66,8 @@
|
||||
"rollup-plugin-gzip": "3.1.0",
|
||||
"rollup-plugin-swc3": "0.11.0",
|
||||
"size-limit": "11.0.1",
|
||||
"ts-jest-resolver": "^2.0.1",
|
||||
"ts2mjs": "^4.0.0",
|
||||
"typescript": "5.1.6"
|
||||
},
|
||||
"publishConfig": {
|
||||
@@ -80,13 +82,13 @@
|
||||
},
|
||||
"pkgTasks": {
|
||||
"build:commonjs": "@/cross-env BABEL_ENV=commonjs NODE_ENV=production @/swc ./src/ --config-file ../../.swcrc-commonjs.json --out-dir lib --strip-leading-paths",
|
||||
"build:es": "@/cross-env BABEL_ENV=es NODE_ENV=production @/swc ./src/ --config-file ../../.swcrc.json --out-dir es --strip-leading-paths",
|
||||
"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",
|
||||
"build:umd": "@/cross-env BABEL_ENV=rollup NODE_ENV=production @/rollup --config ../../rollup.config.mjs",
|
||||
"build": "npm run build:es && npm run build:commonjs && npm run build:umd",
|
||||
"test": "@/jest",
|
||||
"cover": "@/jest --coverage .",
|
||||
"lint": "@/eslint .",
|
||||
"types": "@/tsc",
|
||||
"types": "@/tsc && @/ts2mjs types",
|
||||
"bundlesize": "npm run build && @/cross-env NODE_ENV=production @/bundlesize .",
|
||||
"size": "npm run build && @/cross-env NODE_ENV=production @/size-limit ."
|
||||
},
|
||||
|
||||
@@ -6,16 +6,21 @@
|
||||
"bbob": "lib/cli.js"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobCli",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
import { run } from './index';
|
||||
import { run } from './index.js';
|
||||
|
||||
run(process.stdin, process.stdout);
|
||||
|
||||
@@ -25,16 +25,21 @@
|
||||
"@bbob/types": "*"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobCore",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ import type {
|
||||
} from "@bbob/types";
|
||||
|
||||
import { parse } from '@bbob/parser';
|
||||
import { iterate, match } from './utils';
|
||||
import { C1, C2 } from './errors'
|
||||
import { iterate, match } from './utils.js';
|
||||
import { C1, C2 } from './errors.js'
|
||||
|
||||
export function createTree<Options extends BBobCoreOptions = BBobCoreOptions>(tree: NodeContent[], options: Options) {
|
||||
const extendedTree = tree as BBobCoreTagNodeTree
|
||||
|
||||
@@ -14,16 +14,21 @@
|
||||
"@bbob/types": "*"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobHtml",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -24,44 +24,69 @@
|
||||
"@bbob/types": "*"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobParser",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
},
|
||||
"./lexer": {
|
||||
"types": "./types/lexer.d.ts",
|
||||
"import": "./es/lexer.js",
|
||||
"require": "./lib/lexer.js",
|
||||
"import": {
|
||||
"types": "./types/lexer.d.mts",
|
||||
"default": "./es/lexer.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/lexer.d.ts",
|
||||
"default": "./lib/lexer.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
},
|
||||
"./parse": {
|
||||
"types": "./types/parse.d.ts",
|
||||
"import": "./es/parse.js",
|
||||
"require": "./lib/parse.js",
|
||||
"import": {
|
||||
"types": "./types/parse.d.mts",
|
||||
"default": "./es/parse.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/parse.d.ts",
|
||||
"default": "./lib/parse.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
},
|
||||
"./Token": {
|
||||
"types": "./types/Token.d.ts",
|
||||
"import": "./es/Token.js",
|
||||
"require": "./lib/Token.js",
|
||||
"import": {
|
||||
"types": "./types/Token.d.mts",
|
||||
"default": "./es/Token.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/Token.d.ts",
|
||||
"default": "./lib/Token.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
},
|
||||
"./utils": {
|
||||
"types": "./types/utils.d.ts",
|
||||
"import": "./es/utils.js",
|
||||
"require": "./lib/utils.js",
|
||||
"import": {
|
||||
"types": "./types/utils.d.mts",
|
||||
"default": "./es/utils.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/utils.d.ts",
|
||||
"default": "./lib/utils.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export { TagNode } from '@bbob/plugin-helper';
|
||||
export { default } from './parse';
|
||||
export * from './parse';
|
||||
export * from './lexer'
|
||||
export { default } from './parse.js';
|
||||
export * from './parse.js';
|
||||
export * from './lexer.js'
|
||||
|
||||
@@ -14,8 +14,8 @@ import type { LexerOptions, LexerTokenizer } from "@bbob/types";
|
||||
|
||||
import {
|
||||
Token, TYPE_ATTR_NAME, TYPE_ATTR_VALUE, TYPE_NEW_LINE, TYPE_SPACE, TYPE_TAG, TYPE_WORD,
|
||||
} from './Token';
|
||||
import { CharGrabber, createCharGrabber, trimChar, unquote } from './utils';
|
||||
} from './Token.js';
|
||||
import { CharGrabber, createCharGrabber, trimChar, unquote } from './utils.js';
|
||||
|
||||
// for cases <!-- -->
|
||||
const EM = '!';
|
||||
|
||||
@@ -7,9 +7,9 @@ import {
|
||||
isTagNode,
|
||||
} from "@bbob/plugin-helper";
|
||||
|
||||
import { createLexer } from "./lexer";
|
||||
import { createLexer } from "./lexer.js";
|
||||
|
||||
import type { Token } from "./Token";
|
||||
import type { Token } from "./Token.js";
|
||||
|
||||
class NodeList<Value> {
|
||||
private n: Value[];
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
"types"
|
||||
],
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobPluginHelper",
|
||||
"types": "types/index.d.ts",
|
||||
@@ -25,30 +25,50 @@
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
},
|
||||
"./char": {
|
||||
"types": "./types/char.d.ts",
|
||||
"import": "./es/char.js",
|
||||
"require": "./lib/char.js",
|
||||
"import": {
|
||||
"types": "./types/char.d.mts",
|
||||
"default": "./es/char.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/char.d.ts",
|
||||
"default": "./lib/char.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
},
|
||||
"./helpers": {
|
||||
"types": "./types/helpers.d.ts",
|
||||
"import": "./es/helpers.js",
|
||||
"require": "./lib/helpers.js",
|
||||
"import": {
|
||||
"types": "./types/helpers.d.mts",
|
||||
"default": "./es/helpers.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/helpers.d.ts",
|
||||
"default": "./lib/helpers.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
},
|
||||
"./TagNode": {
|
||||
"types": "./types/TagNode.d.ts",
|
||||
"import": "./es/TagNode.js",
|
||||
"require": "./lib/TagNode.js",
|
||||
"import": {
|
||||
"types": "./types/TagNode.d.mts",
|
||||
"default": "./es/TagNode.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/TagNode.d.ts",
|
||||
"default": "./lib/TagNode.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { NodeContent, TagNodeObject, TagNodeTree, TagPosition } from "@bbob/types";
|
||||
|
||||
import { OPEN_BRAKET, CLOSE_BRAKET, SLASH } from './char';
|
||||
import { OPEN_BRAKET, CLOSE_BRAKET, SLASH } from './char.js';
|
||||
import {
|
||||
getUniqAttr,
|
||||
getNodeLength,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
attrsToString,
|
||||
attrValue,
|
||||
isTagNode,
|
||||
} from './helpers';
|
||||
} from './helpers.js';
|
||||
|
||||
const getTagAttrs = <AttrValue>(tag: string, params: Record<string, AttrValue>) => {
|
||||
const uniqAttr = getUniqAttr(params);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { NodeContent, StringNode } from "@bbob/types";
|
||||
|
||||
import { N } from './char';
|
||||
import type { TagNode } from "./TagNode";
|
||||
import { N } from './char.js';
|
||||
import type { TagNode } from "./TagNode.js";
|
||||
|
||||
function isTagNode(el: unknown): el is TagNode {
|
||||
return typeof el === 'object' && el !== null && 'tag' in el;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from "./helpers";
|
||||
export * from "./char";
|
||||
export * from "./TagNode";
|
||||
export * from "./helpers.js";
|
||||
export * from "./char.js";
|
||||
export * from "./TagNode.js";
|
||||
|
||||
@@ -17,16 +17,21 @@
|
||||
"@bbob/html": "*"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobPresetHTML5",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable indent */
|
||||
import { createPreset } from "@bbob/preset";
|
||||
import defaultTags from "./defaultTags";
|
||||
import defaultTags from "./defaultTags.js";
|
||||
export type * from "@bbob/preset";
|
||||
|
||||
export default createPreset(defaultTags);
|
||||
|
||||
@@ -20,16 +20,21 @@
|
||||
"@types/react": "18.x"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobPresetReact",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -12,16 +12,21 @@
|
||||
"@bbob/types": "*"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobPresetVue",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -22,16 +22,21 @@
|
||||
"@bbob/core": "*"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobPreset",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { default } from "./preset";
|
||||
export * from "./preset";
|
||||
export { default } from "./preset.js";
|
||||
export * from "./preset.js";
|
||||
|
||||
@@ -26,16 +26,21 @@
|
||||
"@types/react": "18.x"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobReact",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import type { BBobPlugins, BBobCoreOptions } from '@bbob/types';
|
||||
|
||||
import { render } from './render';
|
||||
import { render } from './render.js';
|
||||
|
||||
const content = (children: ReactNode, plugins?: BBobPlugins, options?: BBobCoreOptions) =>
|
||||
React.Children.map(children,
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { default } from './Component';
|
||||
export { render } from './render';
|
||||
export { default } from './Component.js';
|
||||
export { render } from './render.js';
|
||||
|
||||
@@ -14,7 +14,17 @@
|
||||
"types"
|
||||
],
|
||||
"types": "types/index.d.ts",
|
||||
"module": "types/index.d.ts",
|
||||
"module": "types/index.d.mts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./types/index.d.mts"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
"homepage": "https://github.com/JiLiZART/bbob",
|
||||
"author": "Nikolay Kostyurin <jilizart@gmail.com>",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ParseOptions } from "./parser";
|
||||
import { NodeContent, PartialNodeContent, TagNodeObject, TagNodeTree } from "./common";
|
||||
import { ParseOptions } from "./parser.js";
|
||||
import { NodeContent, PartialNodeContent, TagNodeObject, TagNodeTree } from "./common.js";
|
||||
|
||||
export interface BBobCoreOptions<
|
||||
Data = unknown | null,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export * from './common'
|
||||
export * from './parser'
|
||||
export * from './core'
|
||||
export * from './preset'
|
||||
export * from './common.js'
|
||||
export * from './parser.js'
|
||||
export * from './core.js'
|
||||
export * from './preset.js'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { TagNodeTree, TagPosition } from "./common";
|
||||
import { TagNodeTree, TagPosition } from "./common.js";
|
||||
|
||||
export interface ParseError {
|
||||
tagName: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import { BBobCoreTagNodeTree, BBobPluginFunction, BBobPluginOptions } from "./core";
|
||||
import { TagNodeObject } from "./common";
|
||||
import { BBobCoreTagNodeTree, BBobPluginFunction, BBobPluginOptions } from "./core.js";
|
||||
import { TagNodeObject } from "./common.js";
|
||||
|
||||
export type PartialRecord<K extends keyof any, T> = Partial<Record<K, T>>
|
||||
|
||||
|
||||
@@ -25,16 +25,21 @@
|
||||
"vue-template-compiler": "2.7.16"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobVue",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import type { BBobCoreOptions, BBobPlugins } from '@bbob/types';
|
||||
|
||||
import { render } from './render';
|
||||
import { render } from './render.js';
|
||||
|
||||
export type BBobVueComponentProps = {
|
||||
container: string
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { VueConstructor } from 'vue';
|
||||
import Component from './Component';
|
||||
import Component from './Component.js';
|
||||
|
||||
function install(vue: VueConstructor) {
|
||||
vue.component("bbob-bbcode", Component);
|
||||
@@ -7,6 +7,6 @@ function install(vue: VueConstructor) {
|
||||
vue.component("BBCode", Component);
|
||||
}
|
||||
|
||||
export { render } from './render';
|
||||
export { render } from './render.js';
|
||||
export { Component };
|
||||
export default install;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"outDir": "./types"
|
||||
"outDir": "./types",
|
||||
"moduleResolution": "node"
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*"
|
||||
|
||||
@@ -29,16 +29,21 @@
|
||||
"vue": "*"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"jsnext:main": "es/index.js",
|
||||
"module": "es/index.mjs",
|
||||
"jsnext:main": "es/index.mjs",
|
||||
"browser": "dist/index.js",
|
||||
"browserName": "BbobVue3",
|
||||
"types": "types/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./types/index.d.ts",
|
||||
"import": "./es/index.js",
|
||||
"require": "./lib/index.js",
|
||||
"import": {
|
||||
"types": "./types/index.d.mts",
|
||||
"default": "./es/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./types/index.d.ts",
|
||||
"default": "./lib/index.js"
|
||||
},
|
||||
"browser": "./dist/index.min.js",
|
||||
"umd": "./dist/index.min.js"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineComponent, h, VNode } from "vue";
|
||||
import { render } from "./render";
|
||||
import { render } from "./render.js";
|
||||
|
||||
import type { BBobPlugins, BBobCoreOptions } from "@bbob/types";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Plugin } from "@vue/runtime-core";
|
||||
import Component from "./Component";
|
||||
import Component from "./Component.js";
|
||||
|
||||
const plugin = {
|
||||
install(app) {
|
||||
|
||||
Generated
+33
@@ -149,6 +149,12 @@ importers:
|
||||
size-limit:
|
||||
specifier: 11.0.1
|
||||
version: 11.0.1
|
||||
ts-jest-resolver:
|
||||
specifier: ^2.0.1
|
||||
version: 2.0.1
|
||||
ts2mjs:
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0
|
||||
typescript:
|
||||
specifier: 5.1.6
|
||||
version: 5.1.6
|
||||
@@ -7517,6 +7523,11 @@ packages:
|
||||
supports-color: 7.2.0
|
||||
dev: true
|
||||
|
||||
/chalk@5.5.0:
|
||||
resolution: {integrity: sha512-1tm8DTaJhPBG3bIkVeZt1iZM9GfSX2lzOeDVZH9R9ffRHpmHvxZ/QhgQH/aDTkswQVt+YHdXAdS/In/30OjCbg==}
|
||||
engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
|
||||
dev: true
|
||||
|
||||
/char-regex@1.0.2:
|
||||
resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -7769,6 +7780,11 @@ packages:
|
||||
engines: {node: '>=14'}
|
||||
dev: true
|
||||
|
||||
/commander@14.0.0:
|
||||
resolution: {integrity: sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==}
|
||||
engines: {node: '>=20'}
|
||||
dev: true
|
||||
|
||||
/commander@2.20.3:
|
||||
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
|
||||
dev: true
|
||||
@@ -16730,6 +16746,12 @@ packages:
|
||||
typescript: 5.8.2
|
||||
dev: true
|
||||
|
||||
/ts-jest-resolver@2.0.1:
|
||||
resolution: {integrity: sha512-FolE73BqVZCs8/RbLKxC67iaAtKpBWx7PeLKFW2zJQlOf9j851I7JRxSDenri2NFvVH3QP7v3S8q1AmL24Zb9Q==}
|
||||
dependencies:
|
||||
jest-resolve: 29.7.0
|
||||
dev: true
|
||||
|
||||
/ts-node@10.9.1(@swc/core@1.3.107)(@types/node@20.4.5)(typescript@5.1.6):
|
||||
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
|
||||
hasBin: true
|
||||
@@ -16810,6 +16832,17 @@ packages:
|
||||
yn: 3.1.1
|
||||
dev: true
|
||||
|
||||
/ts2mjs@4.0.0:
|
||||
resolution: {integrity: sha512-k+mn9y/2kYNqV7dV9dP2NKw0VY6HfESPqEBwjop0M2AyE6rKd2N/y3DKLtWb0bRjJgFr8uoK8H1Tlr2CKe0oyw==}
|
||||
engines: {node: '>=20.18.0'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
chalk: 5.5.0
|
||||
commander: 14.0.0
|
||||
globby: 14.1.0
|
||||
magic-string: 0.30.17
|
||||
dev: true
|
||||
|
||||
/tsconfig-paths@3.15.0:
|
||||
resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==}
|
||||
dependencies:
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"resolveJsonModule": true,
|
||||
"downlevelIteration": true,
|
||||
"jsx": "preserve",
|
||||
|
||||
Reference in New Issue
Block a user