@rsbuild/plugin-toml 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,7 +62,7 @@ By default, `@rsbuild/plugin-toml` generates JS modules that use the ES modules
62
62
 
63
63
  ```js
64
64
  pluginToml({
65
- exModule: false,
65
+ esModule: false,
66
66
  });
67
67
  ```
68
68
 
package/dist/index.cjs CHANGED
@@ -1,54 +1,71 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
2
+ var __webpack_modules__ = {
3
+ toml: function(module) {
4
+ module.exports = import("toml").then(function(module) {
5
+ return module;
6
+ });
7
+ }
11
8
  };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
33
- PLUGIN_TOML_NAME: () => PLUGIN_TOML_NAME,
34
- pluginToml: () => pluginToml
35
- });
36
- module.exports = __toCommonJS(src_exports);
37
- var PLUGIN_TOML_NAME = "rsbuild:toml";
38
- var pluginToml = (options = {}) => ({
39
- name: PLUGIN_TOML_NAME,
40
- async setup(api) {
41
- const { parse } = await import("toml");
42
- const { esModule } = options;
43
- api.transform({ test: /\.toml$/ }, ({ code }) => {
44
- const parsed = parse(code);
45
- const exportType = esModule ? "export default" : "module.exports =";
46
- return `${exportType} ${JSON.stringify(parsed, void 0, " ")};`;
9
+ var __webpack_module_cache__ = {};
10
+ function __webpack_require__(moduleId) {
11
+ var cachedModule = __webpack_module_cache__[moduleId];
12
+ if (void 0 !== cachedModule) return cachedModule.exports;
13
+ var module = __webpack_module_cache__[moduleId] = {
14
+ exports: {}
15
+ };
16
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
17
+ return module.exports;
18
+ }
19
+ (()=>{
20
+ __webpack_require__.d = (exports1, definition)=>{
21
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
22
+ enumerable: true,
23
+ get: definition[key]
24
+ });
25
+ };
26
+ })();
27
+ (()=>{
28
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
29
+ })();
30
+ (()=>{
31
+ __webpack_require__.r = (exports1)=>{
32
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
33
+ value: 'Module'
34
+ });
35
+ Object.defineProperty(exports1, '__esModule', {
36
+ value: true
37
+ });
38
+ };
39
+ })();
40
+ var __webpack_exports__ = {};
41
+ (()=>{
42
+ __webpack_require__.r(__webpack_exports__);
43
+ __webpack_require__.d(__webpack_exports__, {
44
+ PLUGIN_TOML_NAME: ()=>PLUGIN_TOML_NAME,
45
+ pluginToml: ()=>pluginToml
47
46
  });
48
- }
49
- });
50
- // Annotate the CommonJS export names for ESM import in node:
51
- 0 && (module.exports = {
52
- PLUGIN_TOML_NAME,
53
- pluginToml
47
+ const PLUGIN_TOML_NAME = 'rsbuild:toml';
48
+ const pluginToml = (options = {})=>({
49
+ name: PLUGIN_TOML_NAME,
50
+ async setup (api) {
51
+ const { parse } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "toml"));
52
+ const { esModule = true } = options;
53
+ api.transform({
54
+ test: /\.toml$/
55
+ }, ({ code })=>{
56
+ const parsed = parse(code);
57
+ const exportType = esModule ? 'export default' : 'module.exports =';
58
+ return `${exportType} ${JSON.stringify(parsed, void 0, '\t')};`;
59
+ });
60
+ }
61
+ });
62
+ })();
63
+ exports.PLUGIN_TOML_NAME = __webpack_exports__.PLUGIN_TOML_NAME;
64
+ exports.pluginToml = __webpack_exports__.pluginToml;
65
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
66
+ "PLUGIN_TOML_NAME",
67
+ "pluginToml"
68
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
69
+ Object.defineProperty(exports, '__esModule', {
70
+ value: true
54
71
  });
package/dist/index.d.ts CHANGED
@@ -1,9 +1,6 @@
1
- import { RsbuildPlugin } from '@rsbuild/core';
2
-
3
- declare const PLUGIN_TOML_NAME = "rsbuild:toml";
4
- type PluginTomlOptions = {
1
+ import type { RsbuildPlugin } from '@rsbuild/core';
2
+ export declare const PLUGIN_TOML_NAME = "rsbuild:toml";
3
+ export type PluginTomlOptions = {
5
4
  esModule?: boolean;
6
5
  };
7
- declare const pluginToml: (options?: PluginTomlOptions) => RsbuildPlugin;
8
-
9
- export { PLUGIN_TOML_NAME, type PluginTomlOptions, pluginToml };
6
+ export declare const pluginToml: (options?: PluginTomlOptions) => RsbuildPlugin;
package/dist/index.js CHANGED
@@ -1,18 +1,16 @@
1
- // src/index.ts
2
- var PLUGIN_TOML_NAME = "rsbuild:toml";
3
- var pluginToml = (options = {}) => ({
4
- name: PLUGIN_TOML_NAME,
5
- async setup(api) {
6
- const { parse } = await import("toml");
7
- const { esModule } = options;
8
- api.transform({ test: /\.toml$/ }, ({ code }) => {
9
- const parsed = parse(code);
10
- const exportType = esModule ? "export default" : "module.exports =";
11
- return `${exportType} ${JSON.stringify(parsed, void 0, " ")};`;
1
+ const PLUGIN_TOML_NAME = 'rsbuild:toml';
2
+ const pluginToml = (options = {})=>({
3
+ name: PLUGIN_TOML_NAME,
4
+ async setup (api) {
5
+ const { parse } = await import("toml");
6
+ const { esModule = true } = options;
7
+ api.transform({
8
+ test: /\.toml$/
9
+ }, ({ code })=>{
10
+ const parsed = parse(code);
11
+ const exportType = esModule ? 'export default' : 'module.exports =';
12
+ return `${exportType} ${JSON.stringify(parsed, void 0, '\t')};`;
13
+ });
14
+ }
12
15
  });
13
- }
14
- });
15
- export {
16
- PLUGIN_TOML_NAME,
17
- pluginToml
18
- };
16
+ export { PLUGIN_TOML_NAME, pluginToml };
package/package.json CHANGED
@@ -1,61 +1,64 @@
1
1
  {
2
- "name": "@rsbuild/plugin-toml",
3
- "version": "1.0.1",
4
- "repository": "https://github.com/rspack-contrib/rsbuild-plugin-toml",
5
- "license": "MIT",
6
- "type": "module",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.js",
11
- "require": "./dist/index.cjs"
12
- }
13
- },
14
- "main": "./dist/index.js",
15
- "module": "./dist/index.mjs",
16
- "types": "./dist/index.d.ts",
17
- "files": [
18
- "dist"
19
- ],
20
- "simple-git-hooks": {
21
- "pre-commit": "npx nano-staged"
22
- },
23
- "nano-staged": {
24
- "*.{js,jsx,ts,tsx,mjs,cjs}": [
25
- "biome check --write --no-errors-on-unmatched"
26
- ]
27
- },
28
- "dependencies": {
29
- "toml": "^3.0.0"
30
- },
31
- "devDependencies": {
32
- "@biomejs/biome": "^1.8.3",
33
- "@playwright/test": "^1.44.1",
34
- "@rsbuild/core": "1.0.1-beta.10",
35
- "@types/node": "^20.14.1",
36
- "nano-staged": "^0.8.0",
37
- "playwright": "^1.44.1",
38
- "simple-git-hooks": "^2.11.1",
39
- "tsup": "^8.0.2",
40
- "typescript": "^5.5.2"
41
- },
42
- "peerDependencies": {
43
- "@rsbuild/core": "0.x || 1.x || ^1.0.1-beta.0"
44
- },
45
- "peerDependenciesMeta": {
46
- "@rsbuild/core": {
47
- "optional": true
48
- }
49
- },
50
- "publishConfig": {
51
- "access": "public",
52
- "registry": "https://registry.npmjs.org/"
53
- },
54
- "scripts": {
55
- "build": "tsup",
56
- "dev": "tsup --watch",
57
- "lint": "biome check .",
58
- "lint:write": "biome check . --write",
59
- "test": "playwright test"
60
- }
61
- }
2
+ "name": "@rsbuild/plugin-toml",
3
+ "version": "1.1.1",
4
+ "repository": "https://github.com/rspack-contrib/rsbuild-plugin-toml",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.cjs"
12
+ }
13
+ },
14
+ "main": "./dist/index.js",
15
+ "module": "./dist/index.mjs",
16
+ "types": "./dist/index.d.ts",
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "build": "rslib build",
22
+ "dev": "rslib build --watch",
23
+ "lint": "biome check .",
24
+ "lint:write": "biome check . --write",
25
+ "prepare": "simple-git-hooks && npm run build",
26
+ "test": "playwright test",
27
+ "bump": "npx bumpp"
28
+ },
29
+ "simple-git-hooks": {
30
+ "pre-commit": "npx nano-staged"
31
+ },
32
+ "nano-staged": {
33
+ "*.{js,jsx,ts,tsx,mjs,cjs}": [
34
+ "biome check --write --no-errors-on-unmatched"
35
+ ]
36
+ },
37
+ "dependencies": {
38
+ "toml": "^3.0.0"
39
+ },
40
+ "devDependencies": {
41
+ "@biomejs/biome": "^1.9.4",
42
+ "@playwright/test": "^1.54.1",
43
+ "@rsbuild/core": "1.4.12",
44
+ "@rslib/core": "^0.11.0",
45
+ "@types/node": "^22.17.0",
46
+ "nano-staged": "^0.8.0",
47
+ "playwright": "^1.54.1",
48
+ "simple-git-hooks": "^2.13.1",
49
+ "typescript": "^5.9.2"
50
+ },
51
+ "peerDependencies": {
52
+ "@rsbuild/core": "1.x"
53
+ },
54
+ "peerDependenciesMeta": {
55
+ "@rsbuild/core": {
56
+ "optional": true
57
+ }
58
+ },
59
+ "packageManager": "pnpm@10.14.0",
60
+ "publishConfig": {
61
+ "access": "public",
62
+ "registry": "https://registry.npmjs.org/"
63
+ }
64
+ }
package/dist/index.d.cts DELETED
@@ -1,9 +0,0 @@
1
- import { RsbuildPlugin } from '@rsbuild/core';
2
-
3
- declare const PLUGIN_TOML_NAME = "rsbuild:toml";
4
- type PluginTomlOptions = {
5
- esModule?: boolean;
6
- };
7
- declare const pluginToml: (options?: PluginTomlOptions) => RsbuildPlugin;
8
-
9
- export { PLUGIN_TOML_NAME, type PluginTomlOptions, pluginToml };