@orgajs/rollup 1.3.3 → 1.3.5
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/index.d.ts +8 -1
- package/index.d.ts.map +1 -1
- package/index.js +11 -8
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -29,7 +29,14 @@ export type Plugin = {
|
|
|
29
29
|
/**
|
|
30
30
|
* Callback called by Rollup and Vite to transform.
|
|
31
31
|
*/
|
|
32
|
-
export type Transform = (value: string, path: string) => Promise<
|
|
32
|
+
export type Transform = (value: string, path: string) => Promise<TransformResult | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* Transform result; `moduleType` tells Rolldown (Vite 8+) that the compiled
|
|
35
|
+
* output is JavaScript, since it can't infer that from the `.org` extension.
|
|
36
|
+
*/
|
|
37
|
+
export type TransformResult = SourceDescription & {
|
|
38
|
+
moduleType?: string;
|
|
39
|
+
};
|
|
33
40
|
/**
|
|
34
41
|
* Callback called by Vite to set additional configuration options.
|
|
35
42
|
*/
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA4DA;;;;;;;GAOG;AACH,yCALW,OAAO,GAAG,IAAI,GAAG,SAAS,GAEzB,MAAM,CAuCjB;4BAvGY,OAAO,qBAAqB,EAAE,aAAa;gCAC3C,OAAO,QAAQ,EAAE,iBAAiB;;;;;;;;UAGjC,MAAM;;;;YAEN,UAAU;;;;eAEV,SAAS;;;;;gCAKZ,MAAM,QAEN,MAAM,KAEJ,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;;;;;8BAGpC,iBAAiB,GAAG;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAC;;;;kCAM3C,OAAO,OAEP,OAAO,KAEL,SAAS;;;;;;;;UAKR,MAAM;;;;;6BAKP,IAAI,CAAC,OAAO,cAAc,EAAE,cAAc,EAAE,oBAAoB,CAAC;;;;;;;;cAKhE,aAAa;;;;cAEb,aAAa;;;;;sBAGd,cAAc,GAAG,mBAAmB"}
|
package/index.js
CHANGED
|
@@ -16,9 +16,13 @@
|
|
|
16
16
|
* File contents.
|
|
17
17
|
* @param {string} path
|
|
18
18
|
* File path.
|
|
19
|
-
* @returns {Promise<
|
|
19
|
+
* @returns {Promise<TransformResult | undefined>}
|
|
20
20
|
* Result.
|
|
21
21
|
*
|
|
22
|
+
* @typedef {SourceDescription & {moduleType?: string}} TransformResult
|
|
23
|
+
* Transform result; `moduleType` tells Rolldown (Vite 8+) that the compiled
|
|
24
|
+
* output is JavaScript, since it can't infer that from the `.org` extension.
|
|
25
|
+
*
|
|
22
26
|
* @callback ViteConfig
|
|
23
27
|
* Callback called by Vite to set additional configuration options.
|
|
24
28
|
* @param {unknown} config
|
|
@@ -49,10 +53,10 @@
|
|
|
49
53
|
* Configuration.
|
|
50
54
|
*/
|
|
51
55
|
|
|
52
|
-
import { VFile } from 'vfile'
|
|
53
|
-
import { createFilter } from '@rollup/pluginutils'
|
|
54
56
|
import { createProcessor } from '@orgajs/orgx'
|
|
57
|
+
import { createFilter } from '@rollup/pluginutils'
|
|
55
58
|
import { SourceMapGenerator } from 'source-map'
|
|
59
|
+
import { VFile } from 'vfile'
|
|
56
60
|
|
|
57
61
|
/**
|
|
58
62
|
* Compile org-mode w/ rollup.
|
|
@@ -70,7 +74,7 @@ export default function rollup(options) {
|
|
|
70
74
|
|
|
71
75
|
return {
|
|
72
76
|
name: '@orgajs/rollup',
|
|
73
|
-
config(
|
|
77
|
+
config(_config, env) {
|
|
74
78
|
processor = createProcessor({
|
|
75
79
|
SourceMapGenerator,
|
|
76
80
|
development: env.mode === 'development',
|
|
@@ -88,12 +92,11 @@ export default function rollup(options) {
|
|
|
88
92
|
if (file.extname === '.org' && filter(file.path)) {
|
|
89
93
|
const compiled = await processor.process(file)
|
|
90
94
|
const code = String(compiled.value)
|
|
91
|
-
/** @type {
|
|
95
|
+
/** @type {TransformResult} */
|
|
92
96
|
const result = {
|
|
93
97
|
code,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
map: compiled.map
|
|
98
|
+
map: compiled.map,
|
|
99
|
+
moduleType: 'js'
|
|
97
100
|
}
|
|
98
101
|
return result
|
|
99
102
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orgajs/rollup",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"description": "Rollup plugin for Orga",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"directory": "packages/rollup"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/node": "^
|
|
26
|
+
"@types/node": "^25.3.2",
|
|
27
27
|
"@types/react": "^19.0.8",
|
|
28
28
|
"@types/react-dom": "^19.0.3",
|
|
29
29
|
"react": "^19.0.0",
|
|
30
30
|
"react-dom": "^19.0.0",
|
|
31
|
-
"rollup": "^4.
|
|
31
|
+
"rollup": "^4.59.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"rollup": ">=2"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@rollup/pluginutils": "^5.1.4",
|
|
38
38
|
"source-map": "^0.7.4",
|
|
39
39
|
"vfile": "^6.0.3",
|
|
40
|
-
"@orgajs/orgx": "^2.6.
|
|
40
|
+
"@orgajs/orgx": "^2.6.2"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"test": "node --test test.js"
|