@litsx/babel-preset-litsx 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,37 @@
1
+ # `@litsx/babel-preset-litsx`
2
+
3
+ [![npm](https://img.shields.io/badge/npm-@litsx%2Fbabel--preset--litsx-CB3837)](https://www.npmjs.com/package/@litsx/babel-preset-litsx)
4
+ [![Release](https://img.shields.io/badge/release-public-2ea44f)](../../RELEASING.md)
5
+ [![Module](https://img.shields.io/badge/module-ESM%20%2B%20CJS-0366d6)](./package.json)
6
+ [![Provenance](https://img.shields.io/badge/npm_provenance-enabled-2ea44f)](../../RELEASING.md)
7
+
8
+ Canonical native Babel preset for LitSX-authored source.
9
+
10
+ Use this preset when you want the supported LitSX Babel pipeline directly, without going through `@litsx/compiler`.
11
+
12
+ It wires the native lowering stages in the supported order, then optionally runs the JSX-to-Lit-template pass.
13
+
14
+ ## Usage
15
+
16
+ ```json
17
+ {
18
+ "presets": ["@litsx/babel-preset-litsx"]
19
+ }
20
+ ```
21
+
22
+ ## Options
23
+
24
+ - `jsxTemplate?: boolean`
25
+ - `jsxTemplateOptions?: object`
26
+ - `defaultDomMode?: "shadow" | "light"`
27
+ - `typeResolutionMode?: "auto" | "in-memory"`
28
+ - `inMemoryFiles?: Record<string, string>`
29
+ - `transformLitsx?: object`
30
+
31
+ `transformLitsx` is merged on top of the native transform options when you need to override the underlying component-lowering stage directly.
32
+
33
+ ## Notes
34
+
35
+ - This is the canonical raw-Babel entrypoint for native LitSX.
36
+ - For programmatic compilation with parser setup and sourcemap chaining, prefer [`@litsx/compiler`](../compiler/README.md).
37
+ - This preset owns the supported native plugin order.
package/dist/index.cjs ADDED
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var pipeline = require('./pipeline.cjs');
6
+ var internal_transformLitsxComponents = require('./internal/transform-litsx-components.cjs');
7
+ var internal_transformLitsxProperties = require('./internal/transform-litsx-properties.cjs');
8
+ require('@litsx/babel-plugin-transform-jsx-html-template');
9
+ require('@litsx/babel-plugin-transform-litsx-scoped-elements');
10
+ require('./internal/transform-litsx-dom-refs.cjs');
11
+ require('@litsx/babel-plugin-shared-hooks');
12
+ require('./internal/transform-litsx-hooks.cjs');
13
+ require('@babel/plugin-syntax-jsx');
14
+ require('module');
15
+ require('@litsx/typescript-session');
16
+
17
+ function litsxPreset(api, options = {}) {
18
+ api.assertVersion?.(7);
19
+
20
+ return {
21
+ plugins: pipeline.createLitsxPresetPlugins(options),
22
+ };
23
+ }
24
+
25
+ exports.createLitsxPresetPlugins = pipeline.createLitsxPresetPlugins;
26
+ exports.detectLitsxSourceFeatures = pipeline.detectLitsxSourceFeatures;
27
+ exports.createTransformLitsxComponentsPlugin = internal_transformLitsxComponents.createTransformFunctionToClassPlugin;
28
+ exports.setTypescriptModule = internal_transformLitsxProperties.setTypescriptModule;
29
+ exports.default = litsxPreset;
30
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.js"],"sourcesContent":["import { createLitsxPresetPlugins } from \"./pipeline.js\";\n\nexport { createLitsxPresetPlugins, detectLitsxSourceFeatures } from \"./pipeline.js\";\nexport {\n createTransformLitsxComponentsPlugin,\n setTypescriptModule,\n} from \"./pipeline.js\";\n\nexport default function litsxPreset(api, options = {}) {\n api.assertVersion?.(7);\n\n return {\n plugins: createLitsxPresetPlugins(options),\n };\n}\n"],"names":["createLitsxPresetPlugins"],"mappings":";;;;;;;;;;;;;;;;AAQe,SAAS,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE;AACvD,EAAE,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC;;AAExB,EAAE,OAAO;AACT,IAAI,OAAO,EAAEA,iCAAwB,CAAC,OAAO,CAAC;AAC9C,GAAG;AACH;;;;;;;;"}