@orgajs/rollup 1.2.1 → 1.3.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/{dist/index.d.ts → index.d.ts} +4 -3
- package/index.d.ts.map +1 -0
- package/index.js +25 -20
- package/package.json +9 -12
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @return {Plugin}
|
|
7
7
|
* Rollup plugin.
|
|
8
8
|
*/
|
|
9
|
-
export default function
|
|
9
|
+
export default function rollup(options?: Options | null | undefined): Plugin;
|
|
10
10
|
export type FilterPattern = import("@rollup/pluginutils").FilterPattern;
|
|
11
11
|
export type Plugin = import("rollup").Plugin;
|
|
12
12
|
export type SourceDescription = import("rollup").SourceDescription;
|
|
@@ -21,13 +21,14 @@ export type RollupPluginOptions = {
|
|
|
21
21
|
/**
|
|
22
22
|
* List of picomatch patterns to include
|
|
23
23
|
*/
|
|
24
|
-
include?:
|
|
24
|
+
include?: FilterPattern;
|
|
25
25
|
/**
|
|
26
26
|
* List of picomatch patterns to exclude
|
|
27
27
|
*/
|
|
28
|
-
exclude?:
|
|
28
|
+
exclude?: FilterPattern;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Configuration.
|
|
32
32
|
*/
|
|
33
33
|
export type Options = CompileOptions & RollupPluginOptions;
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA0BA;;;;;;;GAOG;AACH,yCALW,OAAO,GAAG,IAAI,GAAG,SAAS,GAEzB,MAAM,CA8BjB;4BA5DY,OAAO,qBAAqB,EAAE,aAAa;qBAC3C,OAAO,QAAQ,EAAE,MAAM;gCACvB,OAAO,QAAQ,EAAE,iBAAiB;;;;6BAIlC,IAAI,CAAC,OAAO,cAAc,EAAE,cAAc,EAAE,oBAAoB,CAAC;;;;;;;;cAKhE,aAAa;;;;cAEb,aAAa;;;;;sBAGd,cAAc,GAAG,mBAAmB"}
|
package/index.js
CHANGED
|
@@ -32,26 +32,31 @@ import { SourceMapGenerator } from 'source-map'
|
|
|
32
32
|
* @return {Plugin}
|
|
33
33
|
* Rollup plugin.
|
|
34
34
|
*/
|
|
35
|
-
export default function (options) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
export default function rollup(options) {
|
|
36
|
+
const { include, exclude, ...rest } = options || {}
|
|
37
|
+
const processor = createProcessor({
|
|
38
|
+
SourceMapGenerator,
|
|
39
|
+
...rest
|
|
40
|
+
})
|
|
41
|
+
const filter = createFilter(include, exclude)
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
return {
|
|
44
|
+
name: '@orgajs/rollup',
|
|
45
|
+
async transform(value, path) {
|
|
46
|
+
const file = new VFile({ value, path })
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
if (file.extname === '.org' && filter(file.path)) {
|
|
49
|
+
const compiled = await processor.process(file)
|
|
50
|
+
const code = String(compiled.value)
|
|
51
|
+
/** @type {SourceDescription} */
|
|
52
|
+
const result = {
|
|
53
|
+
code,
|
|
54
|
+
// @ts-expect-error: `rollup` is not compiled with `exactOptionalPropertyTypes`,
|
|
55
|
+
// so it does not allow `sourceRoot` in `file.map` to be `undefined` here.
|
|
56
|
+
map: compiled.map
|
|
57
|
+
}
|
|
58
|
+
return result
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
57
62
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orgajs/rollup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Rollup plugin for Orga",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
|
-
"
|
|
8
|
-
"index.
|
|
7
|
+
"index.js",
|
|
8
|
+
"index.d.ts",
|
|
9
|
+
"index.d.ts.map"
|
|
9
10
|
],
|
|
10
|
-
"main": "index.js",
|
|
11
|
-
"types": "dist/index.d.ts",
|
|
12
11
|
"type": "module",
|
|
13
12
|
"author": "Xiaoxing Hu <hi@xiaoxing.dev>",
|
|
14
13
|
"homepage": "https://orga.js.org",
|
|
@@ -19,10 +18,10 @@
|
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
20
|
"@types/node": "^20.5.7",
|
|
22
|
-
"@types/react": "^
|
|
23
|
-
"@types/react-dom": "^
|
|
24
|
-
"react": "^
|
|
25
|
-
"react-dom": "^
|
|
21
|
+
"@types/react": "^19.0.8",
|
|
22
|
+
"@types/react-dom": "^19.0.3",
|
|
23
|
+
"react": "^19.0.0",
|
|
24
|
+
"react-dom": "^19.0.0",
|
|
26
25
|
"rollup": "^3.28.1"
|
|
27
26
|
},
|
|
28
27
|
"peerDependencies": {
|
|
@@ -32,11 +31,9 @@
|
|
|
32
31
|
"@rollup/pluginutils": "^5.0.4",
|
|
33
32
|
"source-map": "^0.7.4",
|
|
34
33
|
"vfile": "^6.0.3",
|
|
35
|
-
"@orgajs/orgx": "^2.
|
|
34
|
+
"@orgajs/orgx": "^2.5.0"
|
|
36
35
|
},
|
|
37
36
|
"scripts": {
|
|
38
|
-
"clean": "tsc --build --clean",
|
|
39
|
-
"build": "tsc --build",
|
|
40
37
|
"test": "node --test test.js"
|
|
41
38
|
}
|
|
42
39
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["../index.js"],"version":"5.7.3"}
|