@litsx/babel-preset-litsx 0.8.0 → 0.8.2
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.cjs +1 -1
- package/dist/internal/transform-litsx-components.cjs +65 -3
- package/dist/internal/transform-litsx-components.cjs.map +1 -1
- package/dist/internal/transform-litsx-hooks.cjs +35 -0
- package/dist/internal/transform-litsx-hooks.cjs.map +1 -1
- package/dist/internal/transform-litsx-renderer-props.cjs +1 -1
- package/dist/pipeline.cjs +2 -2
- package/dist/pipeline.cjs.map +1 -1
- package/dist/shared/{transform-litsx-element-candidates-JMFlPFXK.cjs → transform-litsx-element-candidates-D0uvqG4Y.cjs} +86 -2
- package/dist/shared/transform-litsx-element-candidates-D0uvqG4Y.cjs.map +1 -0
- package/package.json +5 -5
- package/src/internal/transform-litsx-element-candidates.js +85 -1
- package/src/internal/transform-litsx-hooks.js +35 -0
- package/src/internal/transform-litsx-param-rewrites.js +55 -1
- package/src/internal/transform-litsx-render-body.js +9 -1
- package/src/pipeline.js +1 -1
- package/dist/shared/transform-litsx-element-candidates-JMFlPFXK.cjs.map +0 -1
|
@@ -32,13 +32,48 @@ const RUNTIME_HELPERS = [
|
|
|
32
32
|
"useStyle",
|
|
33
33
|
"useRef",
|
|
34
34
|
"useCallbackRef",
|
|
35
|
+
"useStableId",
|
|
35
36
|
];
|
|
36
37
|
|
|
38
|
+
function normalizePath(value) {
|
|
39
|
+
return String(value || "").replace(/\\/g, "/");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function hashStableId(value) {
|
|
43
|
+
let hash = 2166136261;
|
|
44
|
+
const text = String(value);
|
|
45
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
46
|
+
hash ^= text.charCodeAt(index);
|
|
47
|
+
hash = Math.imul(hash, 16777619);
|
|
48
|
+
}
|
|
49
|
+
return (hash >>> 0).toString(36);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function createStableIdCallsiteMetadata(callPath, state, t) {
|
|
53
|
+
const filename =
|
|
54
|
+
state.file?.opts?.sourceFileName ||
|
|
55
|
+
state.file?.opts?.filename ||
|
|
56
|
+
state.filename ||
|
|
57
|
+
"";
|
|
58
|
+
const normalizedFilename = normalizePath(filename);
|
|
59
|
+
const loc = callPath.node.loc?.start ?? null;
|
|
60
|
+
const start = typeof callPath.node.start === "number"
|
|
61
|
+
? callPath.node.start
|
|
62
|
+
: 0;
|
|
63
|
+
const line = loc?.line ?? 0;
|
|
64
|
+
const column = loc?.column ?? 0;
|
|
65
|
+
const seed = `${normalizedFilename}:${line}:${column}:${start}`;
|
|
66
|
+
return t.stringLiteral(`litsx-stable-${hashStableId(seed)}`);
|
|
67
|
+
}
|
|
68
|
+
|
|
37
69
|
var transformLitsxHooks = babelPluginSharedHooks.createRuntimeHooksTransform({
|
|
38
70
|
pluginName: "transform-litsx-hooks",
|
|
39
71
|
runtimeModule: RUNTIME_MODULE,
|
|
40
72
|
importSources: IMPORT_SOURCES,
|
|
41
73
|
helperNames: RUNTIME_HELPERS,
|
|
74
|
+
callMetadataByHelper: {
|
|
75
|
+
useStableId: createStableIdCallsiteMetadata,
|
|
76
|
+
},
|
|
42
77
|
});
|
|
43
78
|
|
|
44
79
|
exports.default = transformLitsxHooks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-litsx-hooks.cjs","sources":["../../src/internal/transform-litsx-hooks.js"],"sourcesContent":["import { createRuntimeHooksTransform } from \"@litsx/babel-plugin-shared-hooks\";\n\nconst RUNTIME_MODULE = \"@litsx/core\";\nconst IMPORT_SOURCES = [RUNTIME_MODULE];\n\nconst RUNTIME_HELPERS = [\n \"useOnConnect\",\n \"useAfterUpdate\",\n \"useOnCommit\",\n \"useMemoValue\",\n \"useStableCallback\",\n \"useEvent\",\n \"useEmit\",\n \"usePrevious\",\n \"useReducedState\",\n \"useState\",\n \"useControlledState\",\n \"useAsyncState\",\n \"useOptimistic\",\n \"useExpose\",\n \"useExternalStore\",\n \"useHost\",\n \"useHostContent\",\n \"useSlot\",\n \"useTextContent\",\n \"useTransition\",\n \"useDeferredValue\",\n \"useStyle\",\n \"useRef\",\n \"useCallbackRef\",\n];\n\nexport default createRuntimeHooksTransform({\n pluginName: \"transform-litsx-hooks\",\n runtimeModule: RUNTIME_MODULE,\n importSources: IMPORT_SOURCES,\n helperNames: RUNTIME_HELPERS,\n});\n"],"names":["createRuntimeHooksTransform"],"mappings":";;;;;;AAEA,MAAM,cAAc,GAAG,aAAa;AACpC,MAAM,cAAc,GAAG,CAAC,cAAc,CAAC;;AAEvC,MAAM,eAAe,GAAG;AACxB,EAAE,cAAc;AAChB,EAAE,gBAAgB;AAClB,EAAE,aAAa;AACf,EAAE,cAAc;AAChB,EAAE,mBAAmB;AACrB,EAAE,UAAU;AACZ,EAAE,SAAS;AACX,EAAE,aAAa;AACf,EAAE,iBAAiB;AACnB,EAAE,UAAU;AACZ,EAAE,oBAAoB;AACtB,EAAE,eAAe;AACjB,EAAE,eAAe;AACjB,EAAE,WAAW;AACb,EAAE,kBAAkB;AACpB,EAAE,SAAS;AACX,EAAE,gBAAgB;AAClB,EAAE,SAAS;AACX,EAAE,gBAAgB;AAClB,EAAE,eAAe;AACjB,EAAE,kBAAkB;AACpB,EAAE,UAAU;AACZ,EAAE,QAAQ;AACV,EAAE,gBAAgB;AAClB,CAAC;;AAED,0BAAeA,kDAA2B,CAAC;AAC3C,EAAE,UAAU,EAAE,uBAAuB;AACrC,EAAE,aAAa,EAAE,cAAc;AAC/B,EAAE,aAAa,EAAE,cAAc;AAC/B,EAAE,WAAW,EAAE,eAAe;AAC9B,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"transform-litsx-hooks.cjs","sources":["../../src/internal/transform-litsx-hooks.js"],"sourcesContent":["import { createRuntimeHooksTransform } from \"@litsx/babel-plugin-shared-hooks\";\n\nconst RUNTIME_MODULE = \"@litsx/core\";\nconst IMPORT_SOURCES = [RUNTIME_MODULE];\n\nconst RUNTIME_HELPERS = [\n \"useOnConnect\",\n \"useAfterUpdate\",\n \"useOnCommit\",\n \"useMemoValue\",\n \"useStableCallback\",\n \"useEvent\",\n \"useEmit\",\n \"usePrevious\",\n \"useReducedState\",\n \"useState\",\n \"useControlledState\",\n \"useAsyncState\",\n \"useOptimistic\",\n \"useExpose\",\n \"useExternalStore\",\n \"useHost\",\n \"useHostContent\",\n \"useSlot\",\n \"useTextContent\",\n \"useTransition\",\n \"useDeferredValue\",\n \"useStyle\",\n \"useRef\",\n \"useCallbackRef\",\n \"useStableId\",\n];\n\nfunction normalizePath(value) {\n return String(value || \"\").replace(/\\\\/g, \"/\");\n}\n\nfunction hashStableId(value) {\n let hash = 2166136261;\n const text = String(value);\n for (let index = 0; index < text.length; index += 1) {\n hash ^= text.charCodeAt(index);\n hash = Math.imul(hash, 16777619);\n }\n return (hash >>> 0).toString(36);\n}\n\nfunction createStableIdCallsiteMetadata(callPath, state, t) {\n const filename =\n state.file?.opts?.sourceFileName ||\n state.file?.opts?.filename ||\n state.filename ||\n \"\";\n const normalizedFilename = normalizePath(filename);\n const loc = callPath.node.loc?.start ?? null;\n const start = typeof callPath.node.start === \"number\"\n ? callPath.node.start\n : 0;\n const line = loc?.line ?? 0;\n const column = loc?.column ?? 0;\n const seed = `${normalizedFilename}:${line}:${column}:${start}`;\n return t.stringLiteral(`litsx-stable-${hashStableId(seed)}`);\n}\n\nexport default createRuntimeHooksTransform({\n pluginName: \"transform-litsx-hooks\",\n runtimeModule: RUNTIME_MODULE,\n importSources: IMPORT_SOURCES,\n helperNames: RUNTIME_HELPERS,\n callMetadataByHelper: {\n useStableId: createStableIdCallsiteMetadata,\n },\n});\n"],"names":["createRuntimeHooksTransform"],"mappings":";;;;;;AAEA,MAAM,cAAc,GAAG,aAAa;AACpC,MAAM,cAAc,GAAG,CAAC,cAAc,CAAC;;AAEvC,MAAM,eAAe,GAAG;AACxB,EAAE,cAAc;AAChB,EAAE,gBAAgB;AAClB,EAAE,aA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,IAAI,KAAK,CAAC,QAAQ;AAClB,IAAI,EAAE;AACN,EAAE,MAAM,kBAAkB,GAAG,aAAa,CAAC,QAAQ,CAAC;AACpD,EAAE,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI;AAC9C,EAAE,MAAM,KAAK,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK;AAC/C,MAAM,QAAQ,CAAC,IAAI,CAAC;AACpB,MAAM,CAAC;AACP,EAAE,MAAM,IAAI,GAAG,GAAG,EAAE,IAAI,IAAI,CAAC;AAC7B,EAAE,MAAM,MAAM,GAAG,GAAG,EAAE,MAAM,IAAI,CAAC;AACjC,EAAE,MAAM,IAAI,GAAG,CAAC,EAAE,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACjE,EAAE,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,aAAa,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9D;;AAEA,0BAAeA,kDAA2B,CAAC;AAC3C,EAAE,UAAU,EAAE,uBAAuB;AACrC,EAAE,aAAa,EAAE,cAAc;AAC/B,EAAE,aAAa,EAAE,cAAc;AAC/B,EAAE,WAAW,EAAE,eAAe;AAC9B,EAAE,oBAAoB,EAAE;AACxB,IAAI,WAAW,EAAE,8BAA8B;AAC/C,GAAG;AACH,CAAC,CAAC;;;;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxSyntaxPlugin = require('@babel/plugin-syntax-jsx');
|
|
6
6
|
var authoring = require('@litsx/authoring');
|
|
7
|
-
var transformLitsxElementCandidates = require('../shared/transform-litsx-element-candidates-
|
|
7
|
+
var transformLitsxElementCandidates = require('../shared/transform-litsx-element-candidates-D0uvqG4Y.cjs');
|
|
8
8
|
require('@babel/helper-plugin-utils');
|
|
9
9
|
require('@babel/traverse');
|
|
10
10
|
require('@litsx/babel-parser');
|
package/dist/pipeline.cjs
CHANGED
|
@@ -9,7 +9,7 @@ var internal_transformLitsxRendererProps = require('./internal/transform-litsx-r
|
|
|
9
9
|
var internal_transformLitsxProperties = require('./internal/transform-litsx-properties.cjs');
|
|
10
10
|
require('@litsx/babel-plugin-shared-hooks');
|
|
11
11
|
require('@babel/plugin-syntax-jsx');
|
|
12
|
-
require('./shared/transform-litsx-element-candidates-
|
|
12
|
+
require('./shared/transform-litsx-element-candidates-D0uvqG4Y.cjs');
|
|
13
13
|
require('@babel/helper-plugin-utils');
|
|
14
14
|
require('@babel/traverse');
|
|
15
15
|
require('@litsx/babel-parser');
|
|
@@ -28,7 +28,7 @@ const NATIVE_TRANSFORM_OPTION_KEYS = [
|
|
|
28
28
|
"__litsxCompilationSession",
|
|
29
29
|
];
|
|
30
30
|
|
|
31
|
-
const HOOK_FEATURE_PATTERN = /\b(?:useOnConnect|useAfterUpdate|useOnCommit|useMemoValue|useStableCallback|useEvent|useEmit|usePrevious|useReducedState|useState|useControlledState|useAsyncState|useOptimistic|useExpose|useExternalStore|useHost|useHostContent|useSlot|useTextContent|useTransition|useDeferredValue|useStyle|useRef|useCallbackRef)\b/;
|
|
31
|
+
const HOOK_FEATURE_PATTERN = /\b(?:useOnConnect|useAfterUpdate|useOnCommit|useMemoValue|useStableCallback|useEvent|useEmit|usePrevious|useReducedState|useState|useControlledState|useAsyncState|useOptimistic|useExpose|useExternalStore|useHost|useHostContent|useSlot|useTextContent|useTransition|useDeferredValue|useStyle|useRef|useCallbackRef|useStableId)\b/;
|
|
32
32
|
const REF_FEATURE_PATTERN = /\buseRef\b|\bref\s*=/;
|
|
33
33
|
const SCOPED_ELEMENTS_PATTERN = /<\s*(?:[A-Z][\w.]*(?=[\s/>])|[a-z][\w]*-[\w-]*(?=[\s/>]))/;
|
|
34
34
|
const LIGHT_DOM_PATTERN = /\^lightDom\b|static\s+lightDom\s*=\s*true\b/;
|
package/dist/pipeline.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.cjs","sources":["../src/pipeline.js"],"sourcesContent":["import transformJsxHtmlTemplate from \"@litsx/babel-plugin-transform-jsx-html-template\";\nimport transformLitsxScopedElements from \"@litsx/babel-plugin-transform-litsx-scoped-elements\";\nimport transformLitsxDomRefs from \"./internal/transform-litsx-dom-refs.js\";\nimport transformLitsxHooks from \"./internal/transform-litsx-hooks.js\";\nimport transformLitsxComponents from \"./internal/transform-litsx-components.js\";\nimport transformLitsxRendererProps from \"./internal/transform-litsx-renderer-props.js\";\n\nconst NATIVE_TRANSFORM_OPTION_KEYS = [\n \"defaultDomMode\",\n \"typeResolutionMode\",\n \"inMemoryFiles\",\n \"typescriptSession\",\n \"suppressNativeClassNameWarning\",\n \"__litsxCompilationSession\",\n];\n\nconst HOOK_FEATURE_PATTERN = /\\b(?:useOnConnect|useAfterUpdate|useOnCommit|useMemoValue|useStableCallback|useEvent|useEmit|usePrevious|useReducedState|useState|useControlledState|useAsyncState|useOptimistic|useExpose|useExternalStore|useHost|useHostContent|useSlot|useTextContent|useTransition|useDeferredValue|useStyle|useRef|useCallbackRef)\\b/;\nconst REF_FEATURE_PATTERN = /\\buseRef\\b|\\bref\\s*=/;\nconst SCOPED_ELEMENTS_PATTERN = /<\\s*(?:[A-Z][\\w.]*(?=[\\s/>])|[a-z][\\w]*-[\\w-]*(?=[\\s/>]))/;\nconst LIGHT_DOM_PATTERN = /\\^lightDom\\b|static\\s+lightDom\\s*=\\s*true\\b/;\n\nexport function normalizeTransformLitsxOptions(options = {}) {\n const transformLitsxOptions = {\n ...(options.transformLitsx || {}),\n };\n\n for (const key of NATIVE_TRANSFORM_OPTION_KEYS) {\n if (Object.prototype.hasOwnProperty.call(options, key)) {\n transformLitsxOptions[key] = options[key];\n }\n }\n\n return transformLitsxOptions;\n}\n\nexport function detectLitsxSourceFeatures(source, options = {}) {\n const text = typeof source === \"string\" ? source : \"\";\n const transformOptions = normalizeTransformLitsxOptions(options);\n\n return {\n hooks: HOOK_FEATURE_PATTERN.test(text),\n domRefs: REF_FEATURE_PATTERN.test(text),\n scopedElements:\n transformOptions.defaultDomMode === \"light\" ||\n LIGHT_DOM_PATTERN.test(text) ||\n SCOPED_ELEMENTS_PATTERN.test(text),\n };\n}\n\nfunction shouldIncludeFeaturePlugin(sourceFeatures, key) {\n if (!sourceFeatures) {\n return true;\n }\n\n return sourceFeatures[key] === true;\n}\n\nexport function createLitsxPresetPlugins(options = {}, sourceFeatures = null) {\n const plugins = [\n [transformLitsxRendererProps, options.transformLitsxRendererProps || {}],\n [transformLitsxComponents, normalizeTransformLitsxOptions(options)],\n ];\n\n if (shouldIncludeFeaturePlugin(sourceFeatures, \"hooks\")) {\n plugins.push([transformLitsxHooks, options.transformLitsxHooks || {}]);\n }\n\n if (shouldIncludeFeaturePlugin(sourceFeatures, \"domRefs\")) {\n plugins.push([transformLitsxDomRefs, options.transformLitsxDomRefs || {}]);\n }\n\n if (shouldIncludeFeaturePlugin(sourceFeatures, \"scopedElements\")) {\n plugins.push([transformLitsxScopedElements, options.transformLitsxScopedElements || {}]);\n }\n\n if (options.jsxTemplate !== false) {\n if (options.jsxTemplateOptions && Object.keys(options.jsxTemplateOptions).length > 0) {\n plugins.push([transformJsxHtmlTemplate, options.jsxTemplateOptions]);\n } else {\n plugins.push(transformJsxHtmlTemplate);\n }\n }\n\n return plugins;\n}\n\nexport {\n default as transformLitsxComponents,\n createTransformFunctionToClassPlugin as createTransformLitsxComponentsPlugin,\n} from \"./internal/transform-litsx-components.js\";\nexport {\n setTypescriptModule,\n} from \"./internal/transform-litsx-properties.js\";\n"],"names":["transformLitsxRendererProps","transformLitsxComponents","transformLitsxHooks","transformLitsxDomRefs"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,4BAA4B,GAAG;AACrC,EAAE,gBAAgB;AAClB,EAAE,oBAAoB;AACtB,EAAE,eAAe;AACjB,EAAE,mBAAmB;AACrB,EAAE,gCAAgC;AAClC,EAAE,2BAA2B;AAC7B,CAAC;;AAED,MAAM,oBAAoB,GAAG,
|
|
1
|
+
{"version":3,"file":"pipeline.cjs","sources":["../src/pipeline.js"],"sourcesContent":["import transformJsxHtmlTemplate from \"@litsx/babel-plugin-transform-jsx-html-template\";\nimport transformLitsxScopedElements from \"@litsx/babel-plugin-transform-litsx-scoped-elements\";\nimport transformLitsxDomRefs from \"./internal/transform-litsx-dom-refs.js\";\nimport transformLitsxHooks from \"./internal/transform-litsx-hooks.js\";\nimport transformLitsxComponents from \"./internal/transform-litsx-components.js\";\nimport transformLitsxRendererProps from \"./internal/transform-litsx-renderer-props.js\";\n\nconst NATIVE_TRANSFORM_OPTION_KEYS = [\n \"defaultDomMode\",\n \"typeResolutionMode\",\n \"inMemoryFiles\",\n \"typescriptSession\",\n \"suppressNativeClassNameWarning\",\n \"__litsxCompilationSession\",\n];\n\nconst HOOK_FEATURE_PATTERN = /\\b(?:useOnConnect|useAfterUpdate|useOnCommit|useMemoValue|useStableCallback|useEvent|useEmit|usePrevious|useReducedState|useState|useControlledState|useAsyncState|useOptimistic|useExpose|useExternalStore|useHost|useHostContent|useSlot|useTextContent|useTransition|useDeferredValue|useStyle|useRef|useCallbackRef|useStableId)\\b/;\nconst REF_FEATURE_PATTERN = /\\buseRef\\b|\\bref\\s*=/;\nconst SCOPED_ELEMENTS_PATTERN = /<\\s*(?:[A-Z][\\w.]*(?=[\\s/>])|[a-z][\\w]*-[\\w-]*(?=[\\s/>]))/;\nconst LIGHT_DOM_PATTERN = /\\^lightDom\\b|static\\s+lightDom\\s*=\\s*true\\b/;\n\nexport function normalizeTransformLitsxOptions(options = {}) {\n const transformLitsxOptions = {\n ...(options.transformLitsx || {}),\n };\n\n for (const key of NATIVE_TRANSFORM_OPTION_KEYS) {\n if (Object.prototype.hasOwnProperty.call(options, key)) {\n transformLitsxOptions[key] = options[key];\n }\n }\n\n return transformLitsxOptions;\n}\n\nexport function detectLitsxSourceFeatures(source, options = {}) {\n const text = typeof source === \"string\" ? source : \"\";\n const transformOptions = normalizeTransformLitsxOptions(options);\n\n return {\n hooks: HOOK_FEATURE_PATTERN.test(text),\n domRefs: REF_FEATURE_PATTERN.test(text),\n scopedElements:\n transformOptions.defaultDomMode === \"light\" ||\n LIGHT_DOM_PATTERN.test(text) ||\n SCOPED_ELEMENTS_PATTERN.test(text),\n };\n}\n\nfunction shouldIncludeFeaturePlugin(sourceFeatures, key) {\n if (!sourceFeatures) {\n return true;\n }\n\n return sourceFeatures[key] === true;\n}\n\nexport function createLitsxPresetPlugins(options = {}, sourceFeatures = null) {\n const plugins = [\n [transformLitsxRendererProps, options.transformLitsxRendererProps || {}],\n [transformLitsxComponents, normalizeTransformLitsxOptions(options)],\n ];\n\n if (shouldIncludeFeaturePlugin(sourceFeatures, \"hooks\")) {\n plugins.push([transformLitsxHooks, options.transformLitsxHooks || {}]);\n }\n\n if (shouldIncludeFeaturePlugin(sourceFeatures, \"domRefs\")) {\n plugins.push([transformLitsxDomRefs, options.transformLitsxDomRefs || {}]);\n }\n\n if (shouldIncludeFeaturePlugin(sourceFeatures, \"scopedElements\")) {\n plugins.push([transformLitsxScopedElements, options.transformLitsxScopedElements || {}]);\n }\n\n if (options.jsxTemplate !== false) {\n if (options.jsxTemplateOptions && Object.keys(options.jsxTemplateOptions).length > 0) {\n plugins.push([transformJsxHtmlTemplate, options.jsxTemplateOptions]);\n } else {\n plugins.push(transformJsxHtmlTemplate);\n }\n }\n\n return plugins;\n}\n\nexport {\n default as transformLitsxComponents,\n createTransformFunctionToClassPlugin as createTransformLitsxComponentsPlugin,\n} from \"./internal/transform-litsx-components.js\";\nexport {\n setTypescriptModule,\n} from \"./internal/transform-litsx-properties.js\";\n"],"names":["transformLitsxRendererProps","transformLitsxComponents","transformLitsxHooks","transformLitsxDomRefs"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,4BAA4B,GAAG;AACrC,EAAE,g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CAAC;AAC1E,IAAI,CAAC,MAAM;AACX,MAAM,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC;AAC5C,IAAI;AACJ,EAAE;;AAEF,EAAE,OAAO,OAAO;AAChB;;;;;;;;;"}
|
|
@@ -527,7 +527,10 @@ function getOrCreateModuleAnalysis(filename, context) {
|
|
|
527
527
|
|
|
528
528
|
let programPath = null;
|
|
529
529
|
try {
|
|
530
|
-
const ast = parser.parse(source, {
|
|
530
|
+
const ast = parser.parse(source, {
|
|
531
|
+
sourceType: "module",
|
|
532
|
+
plugins: getParserPluginsForModule(normalizedFilename, source),
|
|
533
|
+
});
|
|
531
534
|
traverse(ast, {
|
|
532
535
|
Program(path) {
|
|
533
536
|
if (!programPath) {
|
|
@@ -656,6 +659,73 @@ function resolveExportedHelper(moduleAnalysis, exportedName, context, seen = new
|
|
|
656
659
|
return null;
|
|
657
660
|
}
|
|
658
661
|
|
|
662
|
+
function getParserPluginsForModule(filename, source) {
|
|
663
|
+
if (/\.(?:[cm]?ts|tsx|litsx)$/i.test(filename)) {
|
|
664
|
+
return ["typescript"];
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
if (/\b(?:as|satisfies)\s+[^;,)]+/.test(source)) {
|
|
668
|
+
return ["typescript"];
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
return [];
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
function unwrapNamespaceAliasExpression(node) {
|
|
675
|
+
let current = node;
|
|
676
|
+
while (
|
|
677
|
+
t.isTSAsExpression(current) ||
|
|
678
|
+
t.isTSTypeAssertion(current) ||
|
|
679
|
+
t.isTSNonNullExpression(current) ||
|
|
680
|
+
t.isTSSatisfiesExpression?.(current)
|
|
681
|
+
) {
|
|
682
|
+
current = current.expression;
|
|
683
|
+
}
|
|
684
|
+
return current;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
function getNamespaceMemberAliasInfo(candidateName, moduleAnalysis) {
|
|
688
|
+
const binding = moduleAnalysis.programPath.scope.getBinding(candidateName);
|
|
689
|
+
if (!binding || !isProgramLevelBinding(binding)) {
|
|
690
|
+
return null;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
const declaratorPath = binding.path.isVariableDeclarator?.()
|
|
694
|
+
? binding.path
|
|
695
|
+
: binding.path.parentPath;
|
|
696
|
+
if (!declaratorPath?.isVariableDeclarator?.()) {
|
|
697
|
+
return null;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
const init = unwrapNamespaceAliasExpression(declaratorPath.node.init);
|
|
701
|
+
if (
|
|
702
|
+
!t.isMemberExpression(init) ||
|
|
703
|
+
init.computed ||
|
|
704
|
+
!t.isIdentifier(unwrapNamespaceAliasExpression(init.object)) ||
|
|
705
|
+
!t.isIdentifier(init.property)
|
|
706
|
+
) {
|
|
707
|
+
return null;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
const namespaceObject = unwrapNamespaceAliasExpression(init.object);
|
|
711
|
+
const namespaceImport = moduleAnalysis.importBindings.get(namespaceObject.name);
|
|
712
|
+
if (
|
|
713
|
+
!namespaceImport ||
|
|
714
|
+
namespaceImport.importedName !== "*" ||
|
|
715
|
+
!namespaceImport.resolvedSource
|
|
716
|
+
) {
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
return {
|
|
721
|
+
localName: candidateName,
|
|
722
|
+
namespaceName: namespaceObject.name,
|
|
723
|
+
importedName: init.property.name,
|
|
724
|
+
sourceValue: namespaceImport.sourceValue,
|
|
725
|
+
resolvedSource: namespaceImport.resolvedSource,
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
|
|
659
729
|
function resolveImportedElementRequirement(candidateName, moduleAnalysis, context, rootFilename) {
|
|
660
730
|
const binding = moduleAnalysis.programPath.scope.getBinding(candidateName);
|
|
661
731
|
if (!binding || !isProgramLevelBinding(binding)) {
|
|
@@ -683,6 +753,20 @@ function resolveImportedElementRequirement(candidateName, moduleAnalysis, contex
|
|
|
683
753
|
};
|
|
684
754
|
}
|
|
685
755
|
|
|
756
|
+
const namespaceAliasInfo = getNamespaceMemberAliasInfo(candidateName, moduleAnalysis);
|
|
757
|
+
if (namespaceAliasInfo) {
|
|
758
|
+
return {
|
|
759
|
+
sourceFile: namespaceAliasInfo.resolvedSource,
|
|
760
|
+
sourceSpecifier: isRelativeSpecifier(namespaceAliasInfo.sourceValue)
|
|
761
|
+
? null
|
|
762
|
+
: namespaceAliasInfo.sourceValue,
|
|
763
|
+
importedName: namespaceAliasInfo.importedName,
|
|
764
|
+
originalName: candidateName,
|
|
765
|
+
tagName: candidateName.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(),
|
|
766
|
+
rootFilename,
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
|
|
686
770
|
const exportInfo =
|
|
687
771
|
moduleAnalysis.exportBindings.get(candidateName) ||
|
|
688
772
|
moduleAnalysis.exportBindings.get("default");
|
|
@@ -1167,4 +1251,4 @@ exports.getAnnotatedElementCandidates = getAnnotatedElementCandidates;
|
|
|
1167
1251
|
exports.getAnnotatedImportedElementCandidates = getAnnotatedImportedElementCandidates;
|
|
1168
1252
|
exports.importedBindingNeedsRendererContext = importedBindingNeedsRendererContext;
|
|
1169
1253
|
exports.setElementCandidatesBabelTypes = setElementCandidatesBabelTypes;
|
|
1170
|
-
//# sourceMappingURL=transform-litsx-element-candidates-
|
|
1254
|
+
//# sourceMappingURL=transform-litsx-element-candidates-D0uvqG4Y.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-litsx-element-candidates-D0uvqG4Y.cjs","sources":["../../src/internal/transform-litsx-element-candidates.js"],"sourcesContent":["import helperPluginUtils from \"@babel/helper-plugin-utils\";\nimport babelTraverse from \"@babel/traverse\";\nimport jsxSyntaxPlugin from \"@babel/plugin-syntax-jsx\";\nimport parser from \"@litsx/babel-parser\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { normalizeFilePath } from \"@litsx/typescript-session\";\nimport { ensureTypescriptModule } from \"./transform-litsx-properties.js\";\n\nconst { declare } = helperPluginUtils;\nconst traverse = babelTraverse.default || babelTraverse;\nconst IMPORT_RESOLUTION_EXTENSIONS = [\n \".litsx\",\n \".litsx.jsx\",\n \".jsx\",\n \".js\",\n \".tsx\",\n \".ts\",\n];\nconst DEFAULT_MODULE_RESOLUTION_OPTIONS = {\n moduleResolution: 100,\n allowJs: true,\n checkJs: false,\n jsx: 1,\n target: 99,\n module: 99,\n esModuleInterop: true,\n allowSyntheticDefaultImports: true,\n};\n\nlet t;\n\nexport function setElementCandidatesBabelTypes(nextTypes) {\n t = nextTypes;\n}\n\nfunction isInsideFunctionOrClass(path) {\n return path.findParent(\n (p) =>\n p.isFunctionDeclaration() ||\n p.isFunctionExpression() ||\n p.isArrowFunctionExpression() ||\n p.isClassDeclaration()\n );\n}\n\nfunction isRelativeSpecifier(value) {\n return typeof value === \"string\" && (\n value.startsWith(\"./\") ||\n value.startsWith(\"../\") ||\n value.startsWith(\"/\")\n );\n}\n\nfunction createEmptyCandidateResult() {\n return {\n localCandidates: new Set(),\n importedCandidates: new Map(),\n };\n}\n\nfunction cloneCandidateResult(result) {\n return {\n localCandidates: new Set(result?.localCandidates || []),\n importedCandidates: new Map(result?.importedCandidates || []),\n };\n}\n\nfunction mergeCandidateResults(target, source) {\n source.localCandidates.forEach((candidate) => target.localCandidates.add(candidate));\n source.importedCandidates.forEach((candidate, key) => {\n if (!target.importedCandidates.has(key)) {\n target.importedCandidates.set(key, candidate);\n }\n });\n}\n\nfunction toImportRecordKey(record) {\n return `${record.sourceFile}:${record.importedName}:${record.tagName}`;\n}\n\nfunction toRelativeModuleSpecifier(fromFilename, targetFilename) {\n const fromDir = path.dirname(fromFilename);\n let relativePath = normalizeFilePath(path.relative(fromDir, targetFilename));\n\n if (!relativePath.startsWith(\".\") && !relativePath.startsWith(\"/\")) {\n relativePath = `./${relativePath}`;\n }\n\n return relativePath;\n}\n\nfunction hasSupportedExtension(filePath) {\n return IMPORT_RESOLUTION_EXTENSIONS.some((extension) => filePath.endsWith(extension));\n}\n\nfunction resolveImportSource(fromFilename, sourceValue, context) {\n const cacheKey = `${normalizeFilePath(fromFilename)}::${sourceValue}`;\n if (context.resolvedImportCache.has(cacheKey)) {\n return context.resolvedImportCache.get(cacheKey);\n }\n\n const existingFile = (candidatePath) => {\n try {\n return fs.existsSync(candidatePath) && fs.statSync(candidatePath).isFile();\n } catch {\n return false;\n }\n };\n\n const resolveWithExtensions = (basePath) => {\n const normalizedBasePath = normalizeFilePath(basePath);\n const candidates = [];\n\n if (hasSupportedExtension(normalizedBasePath)) {\n candidates.push(normalizedBasePath);\n } else {\n IMPORT_RESOLUTION_EXTENSIONS.forEach((extension) => {\n candidates.push(`${normalizedBasePath}${extension}`);\n });\n IMPORT_RESOLUTION_EXTENSIONS.forEach((extension) => {\n candidates.push(normalizeFilePath(path.join(normalizedBasePath, `index${extension}`)));\n });\n }\n\n return candidates.find(existingFile) || null;\n };\n\n const resolvePathAlias = () => {\n const compilerOptions = context.getCompilerOptions?.(fromFilename) || {};\n const baseUrl = compilerOptions.baseUrl\n ? normalizeFilePath(\n path.isAbsolute(compilerOptions.baseUrl)\n ? compilerOptions.baseUrl\n : path.resolve(path.dirname(fromFilename), compilerOptions.baseUrl)\n )\n : normalizeFilePath(path.dirname(fromFilename));\n const pathMappings = compilerOptions.paths || {};\n\n for (const [pattern, substitutions] of Object.entries(pathMappings)) {\n const starIndex = pattern.indexOf(\"*\");\n const isStarPattern = starIndex !== -1;\n const prefix = isStarPattern ? pattern.slice(0, starIndex) : pattern;\n const suffix = isStarPattern ? pattern.slice(starIndex + 1) : \"\";\n\n if (isStarPattern) {\n if (!sourceValue.startsWith(prefix) || !sourceValue.endsWith(suffix)) {\n continue;\n }\n } else if (sourceValue !== pattern) {\n continue;\n }\n\n const wildcardValue = isStarPattern\n ? sourceValue.slice(prefix.length, sourceValue.length - suffix.length)\n : \"\";\n\n for (const substitution of substitutions || []) {\n const substituted = isStarPattern\n ? substitution.replace(\"*\", wildcardValue)\n : substitution;\n const candidateBase = path.isAbsolute(substituted)\n ? substituted\n : path.join(baseUrl, substituted);\n const resolvedPath = resolveWithExtensions(candidateBase);\n if (resolvedPath) {\n return resolvedPath;\n }\n }\n }\n\n return null;\n };\n\n let resolved = null;\n if (fromFilename && isRelativeSpecifier(sourceValue)) {\n resolved = resolveWithExtensions(\n path.resolve(path.dirname(fromFilename), sourceValue)\n );\n } else if (fromFilename) {\n resolved = resolvePathAlias();\n if (!resolved) {\n const ts = ensureTypescriptModule();\n const compilerOptions = context.getCompilerOptions?.(fromFilename) || DEFAULT_MODULE_RESOLUTION_OPTIONS;\n const moduleResolutionHost = context.getModuleResolutionHost?.(fromFilename) || ts.sys;\n try {\n const resolution = ts.resolveModuleName(\n sourceValue,\n normalizeFilePath(fromFilename),\n compilerOptions,\n moduleResolutionHost\n );\n const resolvedFileName = resolution?.resolvedModule?.resolvedFileName;\n if (resolvedFileName) {\n resolved = resolveWithExtensions(resolvedFileName) || normalizeFilePath(resolvedFileName);\n }\n } catch {\n resolved = null;\n }\n }\n }\n\n context.resolvedImportCache.set(cacheKey, resolved);\n return resolved;\n}\n\nfunction createCompilerContextResolver(options = {}) {\n const providedTypescriptSession =\n options?.typescriptSession?.projectSession || options?.typescriptSession || null;\n\n const compilerOptionsCache = new Map();\n const moduleResolutionHostCache = new Map();\n\n function getProgramForFile(filename) {\n if (!providedTypescriptSession?.getProgram || !filename) {\n return null;\n }\n\n try {\n if (providedTypescriptSession.kind === \"project\") {\n return providedTypescriptSession.getProgram();\n }\n\n if (providedTypescriptSession.kind === \"standalone\") {\n return providedTypescriptSession.getProgram(normalizeFilePath(filename));\n }\n } catch {\n return null;\n }\n\n return null;\n }\n\n return {\n getCompilerOptions(filename) {\n const cacheKey = normalizeFilePath(filename);\n if (compilerOptionsCache.has(cacheKey)) {\n return compilerOptionsCache.get(cacheKey);\n }\n\n const program = getProgramForFile(filename);\n const compilerOptions = program?.getCompilerOptions?.() || DEFAULT_MODULE_RESOLUTION_OPTIONS;\n compilerOptionsCache.set(cacheKey, compilerOptions);\n return compilerOptions;\n },\n getModuleResolutionHost(filename) {\n const cacheKey = normalizeFilePath(filename);\n if (moduleResolutionHostCache.has(cacheKey)) {\n return moduleResolutionHostCache.get(cacheKey);\n }\n\n const ts = ensureTypescriptModule();\n const program = getProgramForFile(filename);\n const host = providedTypescriptSession?.host || ts.sys;\n moduleResolutionHostCache.set(cacheKey, host);\n return host;\n },\n };\n}\n\nfunction getOrCreateAvailableNames(programPath) {\n const cached = programPath.getData(\"__litsxAvailableNames\");\n if (cached) {\n return cached;\n }\n\n const availableNames = new Set();\n programPath.get(\"body\").forEach((nodePath) => {\n if (nodePath.isImportDeclaration()) {\n nodePath.node.specifiers.forEach((specifier) => {\n if (specifier.local?.name) {\n availableNames.add(specifier.local.name);\n }\n });\n return;\n }\n\n if (nodePath.isClassDeclaration() && nodePath.node.id?.name) {\n availableNames.add(nodePath.node.id.name);\n return;\n }\n\n if (\n (nodePath.isExportNamedDeclaration() || nodePath.isExportDefaultDeclaration()) &&\n nodePath.get(\"declaration\")?.isClassDeclaration?.() &&\n nodePath.node.declaration?.id?.name\n ) {\n availableNames.add(nodePath.node.declaration.id.name);\n return;\n }\n\n if (nodePath.isFunctionDeclaration() && nodePath.node.id?.name) {\n availableNames.add(nodePath.node.id.name);\n return;\n }\n\n if (\n (nodePath.isExportNamedDeclaration() || nodePath.isExportDefaultDeclaration()) &&\n nodePath.get(\"declaration\")?.isFunctionDeclaration?.() &&\n nodePath.node.declaration?.id?.name\n ) {\n availableNames.add(nodePath.node.declaration.id.name);\n return;\n }\n\n if (\n (nodePath.isExportNamedDeclaration() || nodePath.isExportDefaultDeclaration()) &&\n nodePath.get(\"declaration\")?.isVariableDeclaration?.()\n ) {\n nodePath.get(\"declaration.declarations\").forEach((declaratorPath) => {\n const declarator = declaratorPath.node;\n if (t.isIdentifier(declarator.id)) {\n availableNames.add(declarator.id.name);\n }\n });\n return;\n }\n\n if (!nodePath.isVariableDeclaration()) return;\n nodePath.get(\"declarations\").forEach((declaratorPath) => {\n const declarator = declaratorPath.node;\n if (t.isIdentifier(declarator.id)) {\n availableNames.add(declarator.id.name);\n }\n });\n });\n\n programPath.setData(\"__litsxAvailableNames\", availableNames);\n return availableNames;\n}\n\nfunction getOrCreateHelperPaths(programPath) {\n const cached = programPath.getData(\"__litsxHelperPaths\");\n if (cached) {\n return cached;\n }\n\n const helperPaths = new Map();\n programPath.get(\"body\").forEach((nodePath) => {\n if (nodePath.isFunctionDeclaration() && nodePath.node.id?.name) {\n helperPaths.set(nodePath.node.id.name, nodePath);\n return;\n }\n\n if (\n (nodePath.isExportNamedDeclaration() || nodePath.isExportDefaultDeclaration()) &&\n nodePath.get(\"declaration\")?.isFunctionDeclaration?.() &&\n nodePath.node.declaration?.id?.name\n ) {\n helperPaths.set(nodePath.node.declaration.id.name, nodePath.get(\"declaration\"));\n return;\n }\n\n if (\n (nodePath.isExportNamedDeclaration() || nodePath.isExportDefaultDeclaration()) &&\n nodePath.get(\"declaration\")?.isVariableDeclaration?.()\n ) {\n nodePath.get(\"declaration.declarations\").forEach((declaratorPath) => {\n const declarator = declaratorPath.node;\n if (!t.isIdentifier(declarator.id)) {\n return;\n }\n\n const initPath = declaratorPath.get(\"init\");\n if (\n initPath?.isArrowFunctionExpression?.() ||\n initPath?.isFunctionExpression?.()\n ) {\n helperPaths.set(declarator.id.name, initPath);\n }\n });\n return;\n }\n\n if (!nodePath.isVariableDeclaration()) return;\n nodePath.get(\"declarations\").forEach((declaratorPath) => {\n const declarator = declaratorPath.node;\n if (!t.isIdentifier(declarator.id)) {\n return;\n }\n\n const initPath = declaratorPath.get(\"init\");\n if (\n initPath?.isArrowFunctionExpression?.() ||\n initPath?.isFunctionExpression?.()\n ) {\n helperPaths.set(declarator.id.name, initPath);\n }\n });\n });\n\n programPath.setData(\"__litsxHelperPaths\", helperPaths);\n return helperPaths;\n}\n\nfunction buildModuleAnalysis(programPath, filename, context) {\n const availableNames = getOrCreateAvailableNames(programPath);\n const helperPaths = getOrCreateHelperPaths(programPath);\n const importBindings = new Map();\n const exportBindings = new Map();\n\n programPath.get(\"body\").forEach((nodePath) => {\n if (nodePath.isImportDeclaration()) {\n const sourceValue = nodePath.node.source.value;\n const resolvedSource = resolveImportSource(filename, sourceValue, context);\n\n nodePath.node.specifiers.forEach((specifier) => {\n if (!specifier.local?.name) {\n return;\n }\n\n let importedName = null;\n if (specifier.type === \"ImportDefaultSpecifier\") {\n importedName = \"default\";\n } else if (specifier.type === \"ImportSpecifier\") {\n importedName = specifier.imported?.name ?? specifier.imported?.value ?? null;\n } else if (specifier.type === \"ImportNamespaceSpecifier\") {\n importedName = \"*\";\n }\n\n importBindings.set(specifier.local.name, {\n localName: specifier.local.name,\n importedName,\n sourceValue,\n resolvedSource,\n });\n });\n\n return;\n }\n\n if (nodePath.isExportNamedDeclaration()) {\n const declarationPath = nodePath.get(\"declaration\");\n if (declarationPath?.node) {\n if (declarationPath.isFunctionDeclaration() || declarationPath.isClassDeclaration()) {\n const localName = declarationPath.node.id?.name;\n if (localName) {\n exportBindings.set(localName, { localName });\n }\n } else if (declarationPath.isVariableDeclaration()) {\n declarationPath.get(\"declarations\").forEach((declaratorPath) => {\n const localName = declaratorPath.node.id?.name;\n if (localName) {\n exportBindings.set(localName, { localName });\n }\n });\n }\n }\n\n nodePath.get(\"specifiers\").forEach((specifierPath) => {\n const exportedName =\n specifierPath.node.exported?.name ?? specifierPath.node.exported?.value ?? null;\n if (!exportedName) {\n return;\n }\n\n const sourceValue = nodePath.node.source?.value ?? null;\n if (sourceValue) {\n const localName =\n specifierPath.node.local?.name ?? specifierPath.node.local?.value ?? exportedName;\n exportBindings.set(exportedName, {\n reexportSource: resolveImportSource(filename, sourceValue, context),\n importedName: localName === \"default\" ? \"default\" : localName,\n });\n return;\n }\n\n const localName =\n specifierPath.node.local?.name ?? specifierPath.node.local?.value ?? null;\n if (localName) {\n exportBindings.set(exportedName, { localName });\n }\n });\n\n return;\n }\n\n if (!nodePath.isExportDefaultDeclaration()) {\n return;\n }\n\n const declarationPath = nodePath.get(\"declaration\");\n if (declarationPath.isIdentifier()) {\n exportBindings.set(\"default\", { localName: declarationPath.node.name });\n return;\n }\n\n if (\n declarationPath.isFunctionDeclaration() ||\n declarationPath.isClassDeclaration()\n ) {\n const localName = declarationPath.node.id?.name;\n if (localName) {\n exportBindings.set(\"default\", { localName });\n } else {\n exportBindings.set(\"default\", { path: declarationPath });\n }\n return;\n }\n\n if (\n declarationPath.isArrowFunctionExpression() ||\n declarationPath.isFunctionExpression()\n ) {\n exportBindings.set(\"default\", { path: declarationPath });\n }\n });\n\n return {\n filename,\n programPath,\n availableNames,\n helperPaths,\n importBindings,\n exportBindings,\n compatPascalNames: new Set(),\n };\n}\n\nfunction getOrCreateModuleAnalysis(filename, context) {\n const normalizedFilename = normalizeFilePath(filename);\n if (!normalizedFilename) {\n return null;\n }\n\n if (context.moduleAnalysisCache.has(normalizedFilename)) {\n return context.moduleAnalysisCache.get(normalizedFilename);\n }\n\n let source;\n try {\n source = fs.readFileSync(normalizedFilename, \"utf8\");\n } catch {\n return null;\n }\n\n let programPath = null;\n try {\n const ast = parser.parse(source, {\n sourceType: \"module\",\n plugins: getParserPluginsForModule(normalizedFilename, source),\n });\n traverse(ast, {\n Program(path) {\n if (!programPath) {\n programPath = path;\n path.scope.crawl();\n }\n },\n });\n } catch {\n return null;\n }\n\n if (!programPath) {\n return null;\n }\n\n const analysis = buildModuleAnalysis(programPath, normalizedFilename, context);\n context.moduleAnalysisCache.set(normalizedFilename, analysis);\n return analysis;\n}\n\nfunction isCapitalizedName(name) {\n if (typeof name !== \"string\" || name.length === 0) {\n return false;\n }\n\n const first = name[0];\n return first === first.toUpperCase() && first !== first.toLowerCase();\n}\n\nfunction isProgramLevelBinding(binding) {\n return binding?.scope?.path?.isProgram?.() === true;\n}\n\nfunction validateComponentName(nameNode, pathForErrors, context) {\n if (!nameNode || nameNode.type !== \"JSXIdentifier\") return null;\n const originalName = nameNode.__scopedOriginal || nameNode.name;\n if (!isCapitalizedName(originalName)) return null;\n\n const binding = pathForErrors?.scope?.getBinding?.(originalName) || null;\n if (!binding) {\n if (context.availableNames.has(originalName)) {\n return originalName;\n }\n if (context.compatPascalNames.has(originalName)) {\n return null;\n }\n if (context.options?.allowUnknownPascalCase === true) {\n return null;\n }\n throw (pathForErrors?.buildCodeFrameError?.(\n `Unknown LitSX component \"${originalName}\". Add an import or declare it in this module before using it in JSX.`\n ) || new Error(\n `Unknown LitSX component \"${originalName}\". Add an import or declare it in this module before using it in JSX.`\n ));\n }\n\n if (!isProgramLevelBinding(binding)) {\n return null;\n }\n\n return originalName;\n}\n\nfunction resolveImportedHelper(moduleAnalysis, helperName, context, seen = new Set()) {\n const importInfo = moduleAnalysis.importBindings.get(helperName);\n if (!importInfo?.resolvedSource || importInfo.importedName === \"*\") {\n return null;\n }\n\n const visitedKey = `${moduleAnalysis.filename}:${helperName}:${importInfo.resolvedSource}:${importInfo.importedName}`;\n if (seen.has(visitedKey)) {\n return null;\n }\n const nextSeen = new Set(seen);\n nextSeen.add(visitedKey);\n\n const importedModule = getOrCreateModuleAnalysis(importInfo.resolvedSource, context);\n if (!importedModule) {\n return null;\n }\n\n return resolveExportedHelper(importedModule, importInfo.importedName, context, nextSeen);\n}\n\nfunction resolveExportedHelper(moduleAnalysis, exportedName, context, seen = new Set()) {\n const exportInfo = moduleAnalysis.exportBindings.get(exportedName);\n if (!exportInfo) {\n return null;\n }\n\n if (exportInfo.path?.node) {\n return {\n moduleAnalysis,\n path: exportInfo.path,\n };\n }\n\n if (exportInfo.localName) {\n const helperPath = moduleAnalysis.helperPaths.get(exportInfo.localName);\n if (!helperPath?.node) {\n if (moduleAnalysis.importBindings.has(exportInfo.localName)) {\n return resolveImportedHelper(moduleAnalysis, exportInfo.localName, context, seen);\n }\n return null;\n }\n return {\n moduleAnalysis,\n path: helperPath,\n };\n }\n\n if (exportInfo.reexportSource) {\n const reexportedModule = getOrCreateModuleAnalysis(exportInfo.reexportSource, context);\n if (!reexportedModule) {\n return null;\n }\n return resolveExportedHelper(\n reexportedModule,\n exportInfo.importedName,\n context,\n seen\n );\n }\n\n return null;\n}\n\nfunction getParserPluginsForModule(filename, source) {\n if (/\\.(?:[cm]?ts|tsx|litsx)$/i.test(filename)) {\n return [\"typescript\"];\n }\n\n if (/\\b(?:as|satisfies)\\s+[^;,)]+/.test(source)) {\n return [\"typescript\"];\n }\n\n return [];\n}\n\nfunction unwrapNamespaceAliasExpression(node) {\n let current = node;\n while (\n t.isTSAsExpression(current) ||\n t.isTSTypeAssertion(current) ||\n t.isTSNonNullExpression(current) ||\n t.isTSSatisfiesExpression?.(current)\n ) {\n current = current.expression;\n }\n return current;\n}\n\nfunction getNamespaceMemberAliasInfo(candidateName, moduleAnalysis) {\n const binding = moduleAnalysis.programPath.scope.getBinding(candidateName);\n if (!binding || !isProgramLevelBinding(binding)) {\n return null;\n }\n\n const declaratorPath = binding.path.isVariableDeclarator?.()\n ? binding.path\n : binding.path.parentPath;\n if (!declaratorPath?.isVariableDeclarator?.()) {\n return null;\n }\n\n const init = unwrapNamespaceAliasExpression(declaratorPath.node.init);\n if (\n !t.isMemberExpression(init) ||\n init.computed ||\n !t.isIdentifier(unwrapNamespaceAliasExpression(init.object)) ||\n !t.isIdentifier(init.property)\n ) {\n return null;\n }\n\n const namespaceObject = unwrapNamespaceAliasExpression(init.object);\n const namespaceImport = moduleAnalysis.importBindings.get(namespaceObject.name);\n if (\n !namespaceImport ||\n namespaceImport.importedName !== \"*\" ||\n !namespaceImport.resolvedSource\n ) {\n return null;\n }\n\n return {\n localName: candidateName,\n namespaceName: namespaceObject.name,\n importedName: init.property.name,\n sourceValue: namespaceImport.sourceValue,\n resolvedSource: namespaceImport.resolvedSource,\n };\n}\n\nfunction resolveImportedElementRequirement(candidateName, moduleAnalysis, context, rootFilename) {\n const binding = moduleAnalysis.programPath.scope.getBinding(candidateName);\n if (!binding || !isProgramLevelBinding(binding)) {\n return null;\n }\n\n if (\n binding.path.isImportSpecifier?.() ||\n binding.path.isImportDefaultSpecifier?.()\n ) {\n const importInfo = moduleAnalysis.importBindings.get(candidateName);\n if (!importInfo?.resolvedSource || importInfo.importedName === \"*\") {\n return null;\n }\n\n return {\n sourceFile: importInfo.resolvedSource,\n sourceSpecifier: isRelativeSpecifier(importInfo.sourceValue)\n ? null\n : importInfo.sourceValue,\n importedName: importInfo.importedName,\n originalName: candidateName,\n tagName: candidateName.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase(),\n rootFilename,\n };\n }\n\n const namespaceAliasInfo = getNamespaceMemberAliasInfo(candidateName, moduleAnalysis);\n if (namespaceAliasInfo) {\n return {\n sourceFile: namespaceAliasInfo.resolvedSource,\n sourceSpecifier: isRelativeSpecifier(namespaceAliasInfo.sourceValue)\n ? null\n : namespaceAliasInfo.sourceValue,\n importedName: namespaceAliasInfo.importedName,\n originalName: candidateName,\n tagName: candidateName.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase(),\n rootFilename,\n };\n }\n\n const exportInfo =\n moduleAnalysis.exportBindings.get(candidateName) ||\n moduleAnalysis.exportBindings.get(\"default\");\n if (!exportInfo) {\n throw new Error(\n `Imported renderer helper transitively renders \"${candidateName}\" from \"${moduleAnalysis.filename}\", but that symbol is not exported and cannot be added to static elements in \"${rootFilename}\".`\n );\n }\n\n const importedName = exportInfo.localName === candidateName\n ? candidateName\n : [...moduleAnalysis.exportBindings.entries()].find(\n ([, entry]) => entry.localName === candidateName\n )?.[0] ?? null;\n\n if (!importedName) {\n throw new Error(\n `Imported renderer helper transitively renders \"${candidateName}\" from \"${moduleAnalysis.filename}\", but that symbol cannot be resolved as an importable export for \"${rootFilename}\".`\n );\n }\n\n return {\n sourceFile: moduleAnalysis.filename,\n sourceSpecifier: null,\n importedName,\n originalName: candidateName,\n tagName: candidateName.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase(),\n rootFilename,\n };\n}\n\nfunction collectCandidateResult(functionPath, programPath, options = {}) {\n const result = createEmptyCandidateResult();\n if (!programPath || !functionPath?.node) return result;\n programPath.scope.crawl();\n const compilationSession = options.__litsxCompilationSession || null;\n\n const rootFilename = normalizeFilePath(\n options.filename || programPath.hub.file?.opts?.filename || \"\"\n );\n const helperCandidateCache =\n programPath.getData(\"__litsxHelperCandidateCache\") || new WeakMap();\n programPath.setData(\"__litsxHelperCandidateCache\", helperCandidateCache);\n const moduleAnalysisCache =\n compilationSession?.importedModuleAnalysisCache ||\n programPath.getData(\"__litsxImportedModuleAnalyses\") ||\n new Map();\n programPath.setData(\"__litsxImportedModuleAnalyses\", moduleAnalysisCache);\n const resolvedImportCache =\n compilationSession?.resolvedImportCache ||\n programPath.getData(\"__litsxResolvedImports\") ||\n new Map();\n programPath.setData(\"__litsxResolvedImports\", resolvedImportCache);\n\n const rootModule = {\n filename: rootFilename,\n programPath,\n availableNames: getOrCreateAvailableNames(programPath),\n helperPaths: getOrCreateHelperPaths(programPath),\n compatPascalNames: programPath.getData(\"__litsxCompatPascalNames\") || new Set(),\n importBindings: new Map(),\n exportBindings: new Map(),\n };\n\n programPath.get(\"body\").forEach((nodePath) => {\n if (!nodePath.isImportDeclaration()) {\n return;\n }\n\n const sourceValue = nodePath.node.source.value;\n const resolvedSource = resolveImportSource(rootFilename, sourceValue, {\n moduleAnalysisCache,\n resolvedImportCache,\n });\n\n nodePath.node.specifiers.forEach((specifier) => {\n if (!specifier.local?.name) {\n return;\n }\n\n let importedName = null;\n if (specifier.type === \"ImportDefaultSpecifier\") {\n importedName = \"default\";\n } else if (specifier.type === \"ImportSpecifier\") {\n importedName = specifier.imported?.name ?? specifier.imported?.value ?? null;\n } else if (specifier.type === \"ImportNamespaceSpecifier\") {\n importedName = \"*\";\n }\n\n rootModule.importBindings.set(specifier.local.name, {\n localName: specifier.local.name,\n importedName,\n sourceValue,\n resolvedSource,\n });\n });\n });\n\n const context = {\n rootFilename,\n rootModule,\n options,\n helperCandidateCache,\n moduleAnalysisCache,\n resolvedImportCache,\n ...createCompilerContextResolver(options),\n };\n\n function scanFunction(path, moduleAnalysis, seen = new Set()) {\n if (!path?.node) {\n return createEmptyCandidateResult();\n }\n\n if (context.helperCandidateCache.has(path.node)) {\n return cloneCandidateResult(context.helperCandidateCache.get(path.node));\n }\n\n if (seen.has(path.node)) {\n return createEmptyCandidateResult();\n }\n\n const nextSeen = new Set(seen);\n nextSeen.add(path.node);\n const localResult = createEmptyCandidateResult();\n const referencedHelpers = [];\n const scanContext = {\n availableNames: moduleAnalysis.availableNames,\n helperPaths: moduleAnalysis.helperPaths,\n compatPascalNames: moduleAnalysis.compatPascalNames,\n options,\n };\n\n path.traverse({\n JSXOpeningElement(jsxPath) {\n const candidate = validateComponentName(jsxPath.node.name, jsxPath, scanContext);\n if (candidate) {\n if (moduleAnalysis.filename === context.rootFilename) {\n localResult.localCandidates.add(candidate);\n } else {\n const requirement = resolveImportedElementRequirement(\n candidate,\n moduleAnalysis,\n context,\n context.rootFilename\n );\n if (requirement) {\n localResult.importedCandidates.set(\n toImportRecordKey(requirement),\n requirement\n );\n }\n }\n }\n },\n JSXClosingElement(jsxPath) {\n validateComponentName(jsxPath.node.name, jsxPath, scanContext);\n },\n Identifier(identifierPath) {\n if (!identifierPath.isReferencedIdentifier()) {\n return;\n }\n\n if (moduleAnalysis.helperPaths.has(identifierPath.node.name)) {\n referencedHelpers.push({\n moduleAnalysis,\n path: moduleAnalysis.helperPaths.get(identifierPath.node.name),\n });\n return;\n }\n\n const binding = identifierPath.scope.getBinding(identifierPath.node.name);\n if (!binding) {\n return;\n }\n\n if (\n !binding.path.isImportSpecifier?.() &&\n !binding.path.isImportDefaultSpecifier?.()\n ) {\n return;\n }\n\n const resolvedHelper = resolveImportedHelper(\n moduleAnalysis,\n identifierPath.node.name,\n context\n );\n if (!resolvedHelper?.path?.node) {\n return;\n }\n\n referencedHelpers.push(resolvedHelper);\n },\n });\n\n referencedHelpers.forEach((helperEntry) => {\n const helperCandidates = scanFunction(\n helperEntry.path,\n helperEntry.moduleAnalysis,\n nextSeen\n );\n mergeCandidateResults(localResult, helperCandidates);\n });\n\n context.helperCandidateCache.set(path.node, cloneCandidateResult(localResult));\n return localResult;\n }\n\n return scanFunction(functionPath, rootModule);\n}\n\nexport function getAnnotatedElementCandidates(path, programPath, options = {}) {\n if (path?.node?._litsxElementCandidates instanceof Set) {\n return new Set(path.node._litsxElementCandidates);\n }\n\n return collectCandidateResult(path, programPath, options).localCandidates;\n}\n\nexport function getAnnotatedImportedElementCandidates(path, programPath, options = {}) {\n if (Array.isArray(path?.node?._litsxImportedElementCandidates)) {\n return [...path.node._litsxImportedElementCandidates];\n }\n\n return [...collectCandidateResult(path, programPath, options).importedCandidates.values()];\n}\n\nexport function importedBindingNeedsRendererContext(programPath, localName, options = {}) {\n if (!programPath?.node || !localName) {\n return false;\n }\n\n programPath.scope.crawl();\n const compilationSession = options.__litsxCompilationSession || null;\n const rootFilename = normalizeFilePath(\n options.filename || programPath.hub.file?.opts?.filename || \"\"\n );\n const helperCandidateCache =\n programPath.getData(\"__litsxHelperCandidateCache\") || new WeakMap();\n programPath.setData(\"__litsxHelperCandidateCache\", helperCandidateCache);\n const moduleAnalysisCache =\n compilationSession?.importedModuleAnalysisCache ||\n programPath.getData(\"__litsxImportedModuleAnalyses\") ||\n new Map();\n programPath.setData(\"__litsxImportedModuleAnalyses\", moduleAnalysisCache);\n const resolvedImportCache =\n compilationSession?.resolvedImportCache ||\n programPath.getData(\"__litsxResolvedImports\") ||\n new Map();\n programPath.setData(\"__litsxResolvedImports\", resolvedImportCache);\n\n const rootModule = {\n filename: rootFilename,\n programPath,\n availableNames: getOrCreateAvailableNames(programPath),\n helperPaths: getOrCreateHelperPaths(programPath),\n compatPascalNames: programPath.getData(\"__litsxCompatPascalNames\") || new Set(),\n importBindings: new Map(),\n exportBindings: new Map(),\n };\n\n programPath.get(\"body\").forEach((nodePath) => {\n if (!nodePath.isImportDeclaration()) {\n return;\n }\n\n const sourceValue = nodePath.node.source.value;\n const resolvedSource = resolveImportSource(rootFilename, sourceValue, {\n moduleAnalysisCache,\n resolvedImportCache,\n });\n\n nodePath.node.specifiers.forEach((specifier) => {\n if (!specifier.local?.name) {\n return;\n }\n\n let importedName = null;\n if (specifier.type === \"ImportDefaultSpecifier\") {\n importedName = \"default\";\n } else if (specifier.type === \"ImportSpecifier\") {\n importedName = specifier.imported?.name ?? specifier.imported?.value ?? null;\n } else if (specifier.type === \"ImportNamespaceSpecifier\") {\n importedName = \"*\";\n }\n\n rootModule.importBindings.set(specifier.local.name, {\n localName: specifier.local.name,\n importedName,\n sourceValue,\n resolvedSource,\n });\n });\n });\n\n const context = {\n rootFilename,\n rootModule,\n options,\n helperCandidateCache,\n moduleAnalysisCache,\n resolvedImportCache,\n ...createCompilerContextResolver(options),\n };\n\n const resolvedHelper = resolveImportedHelper(rootModule, localName, context);\n if (!resolvedHelper?.path?.node) {\n return false;\n }\n\n function scanFunction(path, moduleAnalysis, seen = new Set()) {\n if (!path?.node) {\n return false;\n }\n\n const cacheKey = path.node;\n if (context.helperCandidateCache.has(cacheKey)) {\n const cached = context.helperCandidateCache.get(cacheKey);\n return cached.localCandidates.size > 0 || cached.importedCandidates.size > 0;\n }\n\n if (seen.has(path.node)) {\n return false;\n }\n\n const nextSeen = new Set(seen);\n nextSeen.add(path.node);\n let needsContext = false;\n const referencedHelpers = [];\n const scanContext = {\n availableNames: moduleAnalysis.availableNames,\n helperPaths: moduleAnalysis.helperPaths,\n compatPascalNames: moduleAnalysis.compatPascalNames,\n options,\n };\n\n path.traverse({\n JSXOpeningElement(jsxPath) {\n const candidate = validateComponentName(jsxPath.node.name, jsxPath, scanContext);\n if (candidate) {\n needsContext = true;\n }\n },\n JSXClosingElement(jsxPath) {\n validateComponentName(jsxPath.node.name, jsxPath, scanContext);\n },\n Identifier(identifierPath) {\n if (!identifierPath.isReferencedIdentifier()) {\n return;\n }\n\n if (moduleAnalysis.helperPaths.has(identifierPath.node.name)) {\n referencedHelpers.push({\n moduleAnalysis,\n path: moduleAnalysis.helperPaths.get(identifierPath.node.name),\n });\n return;\n }\n\n const binding = identifierPath.scope.getBinding(identifierPath.node.name);\n if (\n !binding ||\n (\n !binding.path.isImportSpecifier?.() &&\n !binding.path.isImportDefaultSpecifier?.()\n )\n ) {\n return;\n }\n\n const importedHelper = resolveImportedHelper(\n moduleAnalysis,\n identifierPath.node.name,\n context\n );\n if (importedHelper?.path?.node) {\n referencedHelpers.push(importedHelper);\n }\n },\n });\n\n if (!needsContext) {\n needsContext = referencedHelpers.some((helperEntry) =>\n scanFunction(helperEntry.path, helperEntry.moduleAnalysis, nextSeen)\n );\n }\n\n context.helperCandidateCache.set(cacheKey, needsContext\n ? {\n localCandidates: new Set([\"__context\"]),\n importedCandidates: new Map(),\n }\n : createEmptyCandidateResult()\n );\n\n return needsContext;\n }\n\n return scanFunction(resolvedHelper.path, resolvedHelper.moduleAnalysis);\n}\n\nexport default declare((api) => {\n api.assertVersion(7);\n t = api.types;\n\n return {\n name: \"transform-litsx-element-candidates\",\n inherits: jsxSyntaxPlugin.default || jsxSyntaxPlugin,\n visitor: {\n Program: {\n enter(path) {\n path.scope.crawl();\n path.setData(\"__litsxAvailableNames\", null);\n path.setData(\"__litsxHelperPaths\", null);\n path.setData(\"__litsxHelperCandidateCache\", new WeakMap());\n path.setData(\"__litsxImportedModuleAnalyses\", new Map());\n path.setData(\"__litsxResolvedImports\", new Map());\n },\n },\n FunctionDeclaration: {\n exit(path, state) {\n if (isInsideFunctionOrClass(path)) {\n return;\n }\n\n const programPath = path.findParent((entry) => entry.isProgram());\n const result = collectCandidateResult(\n path,\n programPath,\n {\n ...(state.opts || {}),\n filename: state.file?.opts?.filename || \"\",\n }\n );\n path.node._litsxElementCandidates = result.localCandidates;\n path.node._litsxImportedElementCandidates = [...result.importedCandidates.values()];\n },\n },\n ArrowFunctionExpression: {\n exit(path, state) {\n if (isInsideFunctionOrClass(path)) {\n return;\n }\n\n const programPath = path.findParent((entry) => entry.isProgram());\n const result = collectCandidateResult(\n path,\n programPath,\n {\n ...(state.opts || {}),\n filename: state.file?.opts?.filename || \"\",\n }\n );\n path.node._litsxElementCandidates = result.localCandidates;\n path.node._litsxImportedElementCandidates = [...result.importedCandidates.values()];\n },\n },\n FunctionExpression: {\n exit(path, state) {\n if (isInsideFunctionOrClass(path)) {\n return;\n }\n\n const programPath = path.findParent((entry) => entry.isProgram());\n const result = collectCandidateResult(\n path,\n programPath,\n {\n ...(state.opts || {}),\n filename: state.file?.opts?.filename || \"\",\n }\n );\n path.node._litsxElementCandidates = result.localCandidates;\n path.node._litsxImportedElementCandidates = [...result.importedCandidates.values()];\n },\n },\n },\n };\n});\n"],"names":["normalizeFilePath","ensureTypescriptModule"],"mappings":";;;;;;;;;;;AASA,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB;AACrC,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,IAAI,aAAa;AACvD,MAAM,4BAA4B,GAAG;AACrC,EAAE,QAAQ;AACV,EAAE,YAAY;AACd,EAAE,MAAM;AACR,EAAE,KAAK;AACP,EAAE,MAAM;AACR,EAAE,KAAK;AACP,CAAC;AACD,MAAM,iCAAiC,GAAG;AAC1C,EAAE,gBAAgB,EAAE,GAAG;AACvB,EAAE,OAAO,EAAE,IAAI;AACf,EAAE,OAAO,EAAE,KAAK;AAChB,EAAE,GAAG,EAAE,CAAC;AACR,EAAE,MAAM,EAAE,EAAE;AACZ,EAAE,MAAM,EAAE,EAAE;AACZ,EAAE,eAAe,EAAE,IAAI;AACvB,EAAE,4BAA4B,EAAE,IAAI;AACpC,CAAC;;AAED,IAAI,CAAC;;AAEE,SAAS,8BAA8B,CAAC,SAAS,EAAE;AAC1D,EAAE,CAAC,GAAG,SAAS;AACf;;AAEA,SAAS,uBAAuB,CAAC,IAAI,EAAE;AACvC,EAAE,OAAO,IAAI,CAAC,UAAU;AACxB,IAAI,CAAC,CAAC;AACN,MAAM,CAAC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AAC;AACT,OAAO;AACP,MAAM,kBAAkB,EAAE;AAC1B,QAAQ,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;AAC1B,UAAU,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE;AAC7C,YAAY;AACZ,UAAU;;AAEV,UAAU,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,SAAS,EAAE,CAAC;AAC3E,UAAU,MAAM,MAAM,GAAG,sBAAsB;AAC/C,YAAY,IAAI;AAChB,YAAY,WAAW;AACvB,YAAY;AACZ,cAAc,IAAI,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;AACnC,cAAc,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,IAAI,EAAE;AACxD;AACA,WAAW;AACX,UAAU,IAAI,CAAC,IAAI,CAAC,uBAAuB,GAAG,MAAM,CAAC,eAAe;AACpE,UAAU,IAAI,CAAC,IAAI,CAAC,+BAA+B,GAAG,CAAC,GAAG,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC;AAC7F,QAAQ,CAAC;AACT,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAC,CAAC;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litsx/babel-preset-litsx",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Canonical native Babel preset for LitSX-authored source",
|
|
5
5
|
"author": "LitSX Team",
|
|
6
6
|
"type": "module",
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
"@babel/traverse": "^7.28.5",
|
|
78
78
|
"@litsx/authoring": "^0.5.0",
|
|
79
79
|
"@litsx/babel-parser": "^0.2.5",
|
|
80
|
-
"@litsx/babel-plugin-shared-hooks": "^0.3.
|
|
81
|
-
"@litsx/babel-plugin-transform-jsx-html-template": "^0.3.
|
|
82
|
-
"@litsx/babel-plugin-transform-litsx-scoped-elements": "^0.4.
|
|
83
|
-
"@litsx/typescript-session": "^0.2.
|
|
80
|
+
"@litsx/babel-plugin-shared-hooks": "^0.3.1",
|
|
81
|
+
"@litsx/babel-plugin-transform-jsx-html-template": "^0.3.6",
|
|
82
|
+
"@litsx/babel-plugin-transform-litsx-scoped-elements": "^0.4.3",
|
|
83
|
+
"@litsx/typescript-session": "^0.2.3"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"build": "../../node_modules/.bin/rollup --config rollup.config.js",
|
|
@@ -536,7 +536,10 @@ function getOrCreateModuleAnalysis(filename, context) {
|
|
|
536
536
|
|
|
537
537
|
let programPath = null;
|
|
538
538
|
try {
|
|
539
|
-
const ast = parser.parse(source, {
|
|
539
|
+
const ast = parser.parse(source, {
|
|
540
|
+
sourceType: "module",
|
|
541
|
+
plugins: getParserPluginsForModule(normalizedFilename, source),
|
|
542
|
+
});
|
|
540
543
|
traverse(ast, {
|
|
541
544
|
Program(path) {
|
|
542
545
|
if (!programPath) {
|
|
@@ -665,6 +668,73 @@ function resolveExportedHelper(moduleAnalysis, exportedName, context, seen = new
|
|
|
665
668
|
return null;
|
|
666
669
|
}
|
|
667
670
|
|
|
671
|
+
function getParserPluginsForModule(filename, source) {
|
|
672
|
+
if (/\.(?:[cm]?ts|tsx|litsx)$/i.test(filename)) {
|
|
673
|
+
return ["typescript"];
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
if (/\b(?:as|satisfies)\s+[^;,)]+/.test(source)) {
|
|
677
|
+
return ["typescript"];
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
return [];
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
function unwrapNamespaceAliasExpression(node) {
|
|
684
|
+
let current = node;
|
|
685
|
+
while (
|
|
686
|
+
t.isTSAsExpression(current) ||
|
|
687
|
+
t.isTSTypeAssertion(current) ||
|
|
688
|
+
t.isTSNonNullExpression(current) ||
|
|
689
|
+
t.isTSSatisfiesExpression?.(current)
|
|
690
|
+
) {
|
|
691
|
+
current = current.expression;
|
|
692
|
+
}
|
|
693
|
+
return current;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
function getNamespaceMemberAliasInfo(candidateName, moduleAnalysis) {
|
|
697
|
+
const binding = moduleAnalysis.programPath.scope.getBinding(candidateName);
|
|
698
|
+
if (!binding || !isProgramLevelBinding(binding)) {
|
|
699
|
+
return null;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
const declaratorPath = binding.path.isVariableDeclarator?.()
|
|
703
|
+
? binding.path
|
|
704
|
+
: binding.path.parentPath;
|
|
705
|
+
if (!declaratorPath?.isVariableDeclarator?.()) {
|
|
706
|
+
return null;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
const init = unwrapNamespaceAliasExpression(declaratorPath.node.init);
|
|
710
|
+
if (
|
|
711
|
+
!t.isMemberExpression(init) ||
|
|
712
|
+
init.computed ||
|
|
713
|
+
!t.isIdentifier(unwrapNamespaceAliasExpression(init.object)) ||
|
|
714
|
+
!t.isIdentifier(init.property)
|
|
715
|
+
) {
|
|
716
|
+
return null;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
const namespaceObject = unwrapNamespaceAliasExpression(init.object);
|
|
720
|
+
const namespaceImport = moduleAnalysis.importBindings.get(namespaceObject.name);
|
|
721
|
+
if (
|
|
722
|
+
!namespaceImport ||
|
|
723
|
+
namespaceImport.importedName !== "*" ||
|
|
724
|
+
!namespaceImport.resolvedSource
|
|
725
|
+
) {
|
|
726
|
+
return null;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
return {
|
|
730
|
+
localName: candidateName,
|
|
731
|
+
namespaceName: namespaceObject.name,
|
|
732
|
+
importedName: init.property.name,
|
|
733
|
+
sourceValue: namespaceImport.sourceValue,
|
|
734
|
+
resolvedSource: namespaceImport.resolvedSource,
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
|
|
668
738
|
function resolveImportedElementRequirement(candidateName, moduleAnalysis, context, rootFilename) {
|
|
669
739
|
const binding = moduleAnalysis.programPath.scope.getBinding(candidateName);
|
|
670
740
|
if (!binding || !isProgramLevelBinding(binding)) {
|
|
@@ -692,6 +762,20 @@ function resolveImportedElementRequirement(candidateName, moduleAnalysis, contex
|
|
|
692
762
|
};
|
|
693
763
|
}
|
|
694
764
|
|
|
765
|
+
const namespaceAliasInfo = getNamespaceMemberAliasInfo(candidateName, moduleAnalysis);
|
|
766
|
+
if (namespaceAliasInfo) {
|
|
767
|
+
return {
|
|
768
|
+
sourceFile: namespaceAliasInfo.resolvedSource,
|
|
769
|
+
sourceSpecifier: isRelativeSpecifier(namespaceAliasInfo.sourceValue)
|
|
770
|
+
? null
|
|
771
|
+
: namespaceAliasInfo.sourceValue,
|
|
772
|
+
importedName: namespaceAliasInfo.importedName,
|
|
773
|
+
originalName: candidateName,
|
|
774
|
+
tagName: candidateName.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(),
|
|
775
|
+
rootFilename,
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
|
|
695
779
|
const exportInfo =
|
|
696
780
|
moduleAnalysis.exportBindings.get(candidateName) ||
|
|
697
781
|
moduleAnalysis.exportBindings.get("default");
|
|
@@ -28,11 +28,46 @@ const RUNTIME_HELPERS = [
|
|
|
28
28
|
"useStyle",
|
|
29
29
|
"useRef",
|
|
30
30
|
"useCallbackRef",
|
|
31
|
+
"useStableId",
|
|
31
32
|
];
|
|
32
33
|
|
|
34
|
+
function normalizePath(value) {
|
|
35
|
+
return String(value || "").replace(/\\/g, "/");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function hashStableId(value) {
|
|
39
|
+
let hash = 2166136261;
|
|
40
|
+
const text = String(value);
|
|
41
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
42
|
+
hash ^= text.charCodeAt(index);
|
|
43
|
+
hash = Math.imul(hash, 16777619);
|
|
44
|
+
}
|
|
45
|
+
return (hash >>> 0).toString(36);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function createStableIdCallsiteMetadata(callPath, state, t) {
|
|
49
|
+
const filename =
|
|
50
|
+
state.file?.opts?.sourceFileName ||
|
|
51
|
+
state.file?.opts?.filename ||
|
|
52
|
+
state.filename ||
|
|
53
|
+
"";
|
|
54
|
+
const normalizedFilename = normalizePath(filename);
|
|
55
|
+
const loc = callPath.node.loc?.start ?? null;
|
|
56
|
+
const start = typeof callPath.node.start === "number"
|
|
57
|
+
? callPath.node.start
|
|
58
|
+
: 0;
|
|
59
|
+
const line = loc?.line ?? 0;
|
|
60
|
+
const column = loc?.column ?? 0;
|
|
61
|
+
const seed = `${normalizedFilename}:${line}:${column}:${start}`;
|
|
62
|
+
return t.stringLiteral(`litsx-stable-${hashStableId(seed)}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
33
65
|
export default createRuntimeHooksTransform({
|
|
34
66
|
pluginName: "transform-litsx-hooks",
|
|
35
67
|
runtimeModule: RUNTIME_MODULE,
|
|
36
68
|
importSources: IMPORT_SOURCES,
|
|
37
69
|
helperNames: RUNTIME_HELPERS,
|
|
70
|
+
callMetadataByHelper: {
|
|
71
|
+
useStableId: createStableIdCallsiteMetadata,
|
|
72
|
+
},
|
|
38
73
|
});
|