rollup-plugin-exodra 0.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 ADDED
@@ -0,0 +1,29 @@
1
+ # rollup-plugin-exodra
2
+
3
+ Rollup plugin that compiles Exodra JSX/TSX, delegating to
4
+ [`babel-preset-exodra`](../babel-preset-exodra)'s shared runner — the same
5
+ pipeline Vite, esbuild, and Jest use.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install --save-dev rollup-plugin-exodra
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```javascript
16
+ // rollup.config.js
17
+ import { exodra } from 'rollup-plugin-exodra';
18
+
19
+ export default {
20
+ input: 'src/main.tsx',
21
+ output: { dir: 'dist', format: 'esm' },
22
+ plugins: [exodra()],
23
+ };
24
+ ```
25
+
26
+ ### Options
27
+
28
+ - `include` — `RegExp` of files to compile. Default `/\.[jt]sx$/`.
29
+ - `importSource` — where the auto-imported `h`/`text` come from. Default `@exodra/core`.
package/dist/index.cjs ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ // Rollup plugin that compiles Exodra JSX/TSX via `babel-preset-exodra`'s shared
3
+ // runner — the same pipeline Vite/esbuild/Jest use, so there is nothing to drift.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.exodra = exodra;
6
+ const babel_preset_exodra_1 = require("babel-preset-exodra");
7
+ function exodra(options = {}) {
8
+ const include = options.include ?? /\.[jt]sx$/;
9
+ return {
10
+ name: 'exodra',
11
+ async transform(code, id) {
12
+ if (!include.test(id))
13
+ return null;
14
+ const result = await (0, babel_preset_exodra_1.transformExodraJsx)(code, id, {
15
+ importSource: options.importSource,
16
+ });
17
+ if (!result)
18
+ return null;
19
+ return {
20
+ code: result.code,
21
+ map: result.map ?? null,
22
+ };
23
+ },
24
+ };
25
+ }
26
+ exports.default = exodra;
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,10 @@
1
+ import type { Plugin } from 'rollup';
2
+ export interface ExodraRollupOptions {
3
+ /** Which files to compile. Default: `.jsx` and `.tsx`. */
4
+ include?: RegExp;
5
+ /** Module the auto-imported `h`/`text` come from. Default `@exodra/core`. */
6
+ importSource?: string;
7
+ }
8
+ export declare function exodra(options?: ExodraRollupOptions): Plugin;
9
+ export default exodra;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAGrD,MAAM,WAAW,mBAAmB;IAChC,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,MAAM,CAAC,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAgBhE;AAED,eAAe,MAAM,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,kFAAkF;;AAYlF,wBAgBC;AAzBD,6DAAyD;AASzD,SAAgB,MAAM,CAAC,UAA+B,EAAE;IACpD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,WAAW,CAAC;IAC/C,OAAO;QACH,IAAI,EAAE,QAAQ;QACd,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE;YACpB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBAAE,OAAO,IAAI,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,IAAA,wCAAkB,EAAC,IAAI,EAAE,EAAE,EAAE;gBAC9C,YAAY,EAAE,OAAO,CAAC,YAAY;aACrC,CAAC,CAAC;YACH,IAAI,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC;YACzB,OAAO;gBACH,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,GAAG,EAAG,MAAM,CAAC,GAA6B,IAAI,IAAI;aACrD,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC;AAED,kBAAe,MAAM,CAAC"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "rollup-plugin-exodra",
3
+ "version": "0.1.0",
4
+ "description": "Rollup plugin that compiles Exodra JSX (delegates to the canonical Babel pipeline)",
5
+ "keywords": [
6
+ "exodra",
7
+ "rollup",
8
+ "rollup-plugin",
9
+ "jsx"
10
+ ],
11
+ "main": "dist/index.cjs",
12
+ "types": "dist/index.d.ts",
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "scripts": {
20
+ "build": "tsc && mv dist/index.js dist/index.cjs",
21
+ "prepublishOnly": "npm run build",
22
+ "test": "vitest run"
23
+ },
24
+ "author": "Andrei Baikov",
25
+ "license": "MIT",
26
+ "homepage": "https://exodra.org",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/abaikov/exodra.git",
30
+ "directory": "packages/rollup-plugin-exodra"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/abaikov/exodra/issues"
34
+ },
35
+ "dependencies": {
36
+ "babel-preset-exodra": "^0.1.0"
37
+ },
38
+ "peerDependencies": {
39
+ "rollup": "^3.0.0 || ^4.0.0"
40
+ },
41
+ "devDependencies": {
42
+ "rollup": "^4.0.0"
43
+ }
44
+ }