@rsbuild/plugin-toml 1.0.0 → 1.1.0
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 +1 -1
- package/dist/index.cjs +63 -50
- package/dist/index.d.ts +4 -7
- package/dist/index.js +15 -17
- package/package.json +15 -15
- package/dist/index.d.cts +0 -9
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,54 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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");
|
|
5
|
+
}
|
|
11
6
|
};
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
16
|
+
}
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
19
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: definition[key]
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
(()=>{
|
|
26
|
+
__webpack_require__.o = function(obj, prop) {
|
|
27
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
(()=>{
|
|
31
|
+
__webpack_require__.r = function(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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
+
var __webpack_export_target__ = exports;
|
|
64
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
65
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
66
|
+
value: true
|
|
54
67
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-toml",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"repository": "https://github.com/rspack-contrib/rsbuild-plugin-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"repository": "https://github.com/rspack-contrib/rsbuild-plugin-toml",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"dist"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "
|
|
22
|
-
"dev": "
|
|
21
|
+
"build": "rslib build",
|
|
22
|
+
"dev": "rslib build --watch",
|
|
23
23
|
"lint": "biome check .",
|
|
24
24
|
"lint:write": "biome check . --write",
|
|
25
25
|
"prepare": "simple-git-hooks && npm run build",
|
|
26
|
-
"
|
|
27
|
-
|
|
26
|
+
"test": "playwright test",
|
|
27
|
+
"bump": "npx bumpp"
|
|
28
28
|
},
|
|
29
29
|
"simple-git-hooks": {
|
|
30
30
|
"pre-commit": "npx nano-staged"
|
|
@@ -38,25 +38,25 @@
|
|
|
38
38
|
"toml": "^3.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@biomejs/biome": "^1.
|
|
42
|
-
"@playwright/test": "^1.
|
|
43
|
-
"@rsbuild/core": "
|
|
44
|
-
"@
|
|
41
|
+
"@biomejs/biome": "^1.9.4",
|
|
42
|
+
"@playwright/test": "^1.50.1",
|
|
43
|
+
"@rsbuild/core": "1.2.14",
|
|
44
|
+
"@rslib/core": "^0.5.2",
|
|
45
|
+
"@types/node": "^22.13.8",
|
|
45
46
|
"nano-staged": "^0.8.0",
|
|
46
|
-
"playwright": "^1.
|
|
47
|
+
"playwright": "^1.50.1",
|
|
47
48
|
"simple-git-hooks": "^2.11.1",
|
|
48
|
-
"
|
|
49
|
-
"typescript": "^5.5.2"
|
|
49
|
+
"typescript": "^5.8.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@rsbuild/core": "
|
|
52
|
+
"@rsbuild/core": "1.x"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@rsbuild/core": {
|
|
56
56
|
"optional": true
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
-
"packageManager": "pnpm@
|
|
59
|
+
"packageManager": "pnpm@10.5.2",
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public",
|
|
62
62
|
"registry": "https://registry.npmjs.org/"
|
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 };
|