@mui/internal-docs-infra 0.1.1-alpha.0 → 0.1.1-alpha.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/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/loadPrecomputedCodeHighlighter.d.ts.map +1 -1
- package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/loadPrecomputedCodeHighlighter.js +2 -1
- package/loaderUtils/resolveModulePath.d.ts.map +1 -0
- package/{build/esm/loaderUtils → loaderUtils}/resolveModulePath.js +185 -150
- package/package.json +13 -72
- package/build/CodeControllerContext/CodeControllerContext.js +0 -21
- package/build/CodeControllerContext/index.js +0 -16
- package/build/CodeHighlighter/CodeHighlighter.js +0 -329
- package/build/CodeHighlighter/CodeHighlighterClient.js +0 -406
- package/build/CodeHighlighter/CodeHighlighterContext.js +0 -22
- package/build/CodeHighlighter/CodeHighlighterFallbackContext.js +0 -18
- package/build/CodeHighlighter/applyTransform.js +0 -83
- package/build/CodeHighlighter/codeToFallbackProps.js +0 -77
- package/build/CodeHighlighter/errors.js +0 -2
- package/build/CodeHighlighter/hasAllVariants.js +0 -37
- package/build/CodeHighlighter/index.js +0 -49
- package/build/CodeHighlighter/loadFallbackCode.js +0 -474
- package/build/CodeHighlighter/loadVariant.js +0 -715
- package/build/CodeHighlighter/maybeInitialData.js +0 -101
- package/build/CodeHighlighter/parseCode.js +0 -129
- package/build/CodeHighlighter/parseControlledCode.js +0 -83
- package/build/CodeHighlighter/transformCode.js +0 -231
- package/build/CodeHighlighter/transformParsedSource.js +0 -73
- package/build/CodeHighlighter/transformSource.js +0 -114
- package/build/CodeHighlighter/types.js +0 -5
- package/build/CodeProvider/CodeContext.js +0 -14
- package/build/CodeProvider/CodeProvider.js +0 -57
- package/build/CodeProvider/index.js +0 -27
- package/build/README.md +0 -19
- package/build/esm/CodeControllerContext/CodeControllerContext.d.ts +0 -22
- package/build/esm/CodeControllerContext/index.d.ts +0 -1
- package/build/esm/CodeHighlighter/CodeHighlighter.d.ts +0 -2
- package/build/esm/CodeHighlighter/CodeHighlighterClient.d.ts +0 -2
- package/build/esm/CodeHighlighter/CodeHighlighterContext.d.ts +0 -14
- package/build/esm/CodeHighlighter/CodeHighlighterFallbackContext.d.ts +0 -7
- package/build/esm/CodeHighlighter/applyTransform.d.ts +0 -19
- package/build/esm/CodeHighlighter/codeToFallbackProps.d.ts +0 -2
- package/build/esm/CodeHighlighter/errors.d.ts +0 -0
- package/build/esm/CodeHighlighter/hasAllVariants.d.ts +0 -2
- package/build/esm/CodeHighlighter/index.d.ts +0 -4
- package/build/esm/CodeHighlighter/loadFallbackCode.d.ts +0 -9
- package/build/esm/CodeHighlighter/loadVariant.d.ts +0 -11
- package/build/esm/CodeHighlighter/maybeInitialData.d.ts +0 -10
- package/build/esm/CodeHighlighter/parseCode.d.ts +0 -6
- package/build/esm/CodeHighlighter/parseControlledCode.d.ts +0 -6
- package/build/esm/CodeHighlighter/transformCode.d.ts +0 -20
- package/build/esm/CodeHighlighter/transformParsedSource.d.ts +0 -3
- package/build/esm/CodeHighlighter/transformSource.d.ts +0 -2
- package/build/esm/CodeHighlighter/types.d.ts +0 -138
- package/build/esm/CodeProvider/CodeContext.d.ts +0 -12
- package/build/esm/CodeProvider/CodeProvider.d.ts +0 -13
- package/build/esm/CodeProvider/index.d.ts +0 -2
- package/build/esm/loaderUtils/resolveModulePath.d.ts.map +0 -1
- package/build/esm/package.json +0 -1
- package/build/hast/hast.d.ts +0 -11
- package/build/hast/hast.js +0 -75
- package/build/hast/index.d.ts +0 -1
- package/build/hast/index.js +0 -16
- package/build/loadPrecomputedCodeHighlighter/index.d.ts +0 -2
- package/build/loadPrecomputedCodeHighlighter/index.js +0 -9
- package/build/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.d.ts +0 -57
- package/build/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +0 -201
- package/build/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.d.ts +0 -20
- package/build/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.js +0 -248
- package/build/loadPrecomputedCodeHighlighter/parseFunctionParameters.d.ts +0 -15
- package/build/loadPrecomputedCodeHighlighter/parseFunctionParameters.js +0 -174
- package/build/loadPrecomputedCodeHighlighter/replacePrecomputeValue.d.ts +0 -27
- package/build/loadPrecomputedCodeHighlighter/replacePrecomputeValue.js +0 -43
- package/build/loadServerCodeMeta/index.d.ts +0 -1
- package/build/loadServerCodeMeta/index.js +0 -16
- package/build/loadServerCodeMeta/serverLoadCodeMeta.d.ts +0 -24
- package/build/loadServerCodeMeta/serverLoadCodeMeta.js +0 -85
- package/build/loadServerSource/index.d.ts +0 -1
- package/build/loadServerSource/index.js +0 -16
- package/build/loadServerSource/serverLoadSource.d.ts +0 -25
- package/build/loadServerSource/serverLoadSource.js +0 -108
- package/build/loaderUtils/getFileNameFromUrl.d.ts +0 -11
- package/build/loaderUtils/getFileNameFromUrl.js +0 -38
- package/build/loaderUtils/index.d.ts +0 -5
- package/build/loaderUtils/index.js +0 -60
- package/build/loaderUtils/processImports.d.ts +0 -19
- package/build/loaderUtils/processImports.js +0 -89
- package/build/loaderUtils/resolveImports.d.ts +0 -4
- package/build/loaderUtils/resolveImports.js +0 -78
- package/build/loaderUtils/resolveModulePath.d.ts +0 -74
- package/build/loaderUtils/resolveModulePath.js +0 -835
- package/build/loaderUtils/resolveModulePathWithFs.d.ts +0 -44
- package/build/loaderUtils/resolveModulePathWithFs.js +0 -163
- package/build/loaderUtils/rewriteImports.d.ts +0 -9
- package/build/loaderUtils/rewriteImports.js +0 -62
- package/build/package.json +0 -101
- package/build/parseSource/grammars.d.ts +0 -2
- package/build/parseSource/grammars.js +0 -34
- package/build/parseSource/index.d.ts +0 -1
- package/build/parseSource/index.js +0 -16
- package/build/parseSource/parseSource.d.ts +0 -3
- package/build/parseSource/parseSource.js +0 -44
- package/build/transformRelativeMarkdownPaths/index.d.ts +0 -2
- package/build/transformRelativeMarkdownPaths/index.js +0 -9
- package/build/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.d.ts +0 -12
- package/build/transformRelativeMarkdownPaths/transformRelativeMarkdownPaths.js +0 -36
- package/build/transformTsToJs/index.d.ts +0 -1
- package/build/transformTsToJs/index.js +0 -16
- package/build/transformTsToJs/removeTypes.d.ts +0 -13
- package/build/transformTsToJs/removeTypes.js +0 -141
- package/build/transformTsToJs/transformTsToJs.d.ts +0 -3
- package/build/transformTsToJs/transformTsToJs.js +0 -41
- package/build/useCode/index.d.ts +0 -1
- package/build/useCode/index.js +0 -16
- package/build/useCode/useCode.d.ts +0 -37
- package/build/useCode/useCode.js +0 -401
- package/build/useCopier/index.d.ts +0 -15
- package/build/useCopier/index.js +0 -70
- package/build/useDemo/index.d.ts +0 -39
- package/build/useDemo/index.js +0 -25
- package/build/useOnHydrate/index.d.ts +0 -1
- package/build/useOnHydrate/index.js +0 -16
- package/build/useOnHydrate/useOnHydrate.d.ts +0 -1
- package/build/useOnHydrate/useOnHydrate.js +0 -26
- package/build/useOnIdle/index.d.ts +0 -1
- package/build/useOnIdle/index.js +0 -16
- package/build/useOnIdle/useOnIdle.d.ts +0 -1
- package/build/useOnIdle/useOnIdle.js +0 -47
- /package/{build/CodeControllerContext → CodeControllerContext}/CodeControllerContext.d.ts +0 -0
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/CodeControllerContext.d.ts.map +0 -0
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/CodeControllerContext.js +0 -0
- /package/{build/CodeControllerContext → CodeControllerContext}/index.d.ts +0 -0
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/index.d.ts.map +0 -0
- /package/{build/esm/CodeControllerContext → CodeControllerContext}/index.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighter.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighter.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighter.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterClient.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterClient.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterClient.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterContext.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/CodeHighlighterFallbackContext.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/applyTransform.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/applyTransform.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/applyTransform.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/codeToFallbackProps.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/errors.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/errors.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/errors.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/hasAllVariants.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/hasAllVariants.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/hasAllVariants.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/index.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/index.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/index.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/loadFallbackCode.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/loadFallbackCode.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/loadFallbackCode.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/loadVariant.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/loadVariant.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/loadVariant.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/maybeInitialData.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/maybeInitialData.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/maybeInitialData.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/parseCode.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/parseCode.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/parseCode.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/parseControlledCode.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/parseControlledCode.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/parseControlledCode.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/transformCode.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformCode.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformCode.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/transformParsedSource.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformParsedSource.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformParsedSource.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/transformSource.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformSource.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/transformSource.js +0 -0
- /package/{build/CodeHighlighter → CodeHighlighter}/types.d.ts +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/types.d.ts.map +0 -0
- /package/{build/esm/CodeHighlighter → CodeHighlighter}/types.js +0 -0
- /package/{build/CodeProvider → CodeProvider}/CodeContext.d.ts +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/CodeContext.d.ts.map +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/CodeContext.js +0 -0
- /package/{build/CodeProvider → CodeProvider}/CodeProvider.d.ts +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/CodeProvider.d.ts.map +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/CodeProvider.js +0 -0
- /package/{build/CodeProvider → CodeProvider}/index.d.ts +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/index.d.ts.map +0 -0
- /package/{build/esm/CodeProvider → CodeProvider}/index.js +0 -0
- /package/{build/LICENSE → LICENSE} +0 -0
- /package/{build/esm/hast → hast}/hast.d.ts +0 -0
- /package/{build/esm/hast → hast}/hast.d.ts.map +0 -0
- /package/{build/esm/hast → hast}/hast.js +0 -0
- /package/{build/esm/hast → hast}/index.d.ts +0 -0
- /package/{build/esm/hast → hast}/index.d.ts.map +0 -0
- /package/{build/esm/hast → hast}/index.js +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/index.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/index.d.ts.map +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/index.js +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/loadPrecomputedCodeHighlighter.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseCreateFactoryCall.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseCreateFactoryCall.d.ts.map +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseCreateFactoryCall.js +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseFunctionParameters.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseFunctionParameters.d.ts.map +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/parseFunctionParameters.js +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/replacePrecomputeValue.d.ts +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/replacePrecomputeValue.d.ts.map +0 -0
- /package/{build/esm/loadPrecomputedCodeHighlighter → loadPrecomputedCodeHighlighter}/replacePrecomputeValue.js +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/index.d.ts +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/index.d.ts.map +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/index.js +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/serverLoadCodeMeta.d.ts +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/serverLoadCodeMeta.d.ts.map +0 -0
- /package/{build/esm/loadServerCodeMeta → loadServerCodeMeta}/serverLoadCodeMeta.js +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/index.d.ts +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/index.d.ts.map +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/index.js +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/serverLoadSource.d.ts +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/serverLoadSource.d.ts.map +0 -0
- /package/{build/esm/loadServerSource → loadServerSource}/serverLoadSource.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/getFileNameFromUrl.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/getFileNameFromUrl.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/getFileNameFromUrl.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/index.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/index.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/index.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/processImports.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/processImports.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/processImports.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveImports.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveImports.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveImports.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveModulePath.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveModulePathWithFs.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveModulePathWithFs.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/resolveModulePathWithFs.js +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/rewriteImports.d.ts +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/rewriteImports.d.ts.map +0 -0
- /package/{build/esm/loaderUtils → loaderUtils}/rewriteImports.js +0 -0
- /package/{build/esm/parseSource → parseSource}/grammars.d.ts +0 -0
- /package/{build/esm/parseSource → parseSource}/grammars.d.ts.map +0 -0
- /package/{build/esm/parseSource → parseSource}/grammars.js +0 -0
- /package/{build/esm/parseSource → parseSource}/index.d.ts +0 -0
- /package/{build/esm/parseSource → parseSource}/index.d.ts.map +0 -0
- /package/{build/esm/parseSource → parseSource}/index.js +0 -0
- /package/{build/esm/parseSource → parseSource}/parseSource.d.ts +0 -0
- /package/{build/esm/parseSource → parseSource}/parseSource.d.ts.map +0 -0
- /package/{build/esm/parseSource → parseSource}/parseSource.js +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/index.d.ts +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/index.d.ts.map +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/index.js +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/transformRelativeMarkdownPaths.d.ts +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/transformRelativeMarkdownPaths.d.ts.map +0 -0
- /package/{build/esm/transformRelativeMarkdownPaths → transformRelativeMarkdownPaths}/transformRelativeMarkdownPaths.js +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/index.d.ts +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/index.d.ts.map +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/index.js +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/removeTypes.d.ts +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/removeTypes.d.ts.map +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/removeTypes.js +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/transformTsToJs.d.ts +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/transformTsToJs.d.ts.map +0 -0
- /package/{build/esm/transformTsToJs → transformTsToJs}/transformTsToJs.js +0 -0
- /package/{build/esm/useCode → useCode}/index.d.ts +0 -0
- /package/{build/esm/useCode → useCode}/index.d.ts.map +0 -0
- /package/{build/esm/useCode → useCode}/index.js +0 -0
- /package/{build/esm/useCode → useCode}/useCode.d.ts +0 -0
- /package/{build/esm/useCode → useCode}/useCode.d.ts.map +0 -0
- /package/{build/esm/useCode → useCode}/useCode.js +0 -0
- /package/{build/esm/useCopier → useCopier}/index.d.ts +0 -0
- /package/{build/esm/useCopier → useCopier}/index.d.ts.map +0 -0
- /package/{build/esm/useCopier → useCopier}/index.js +0 -0
- /package/{build/esm/useDemo → useDemo}/index.d.ts +0 -0
- /package/{build/esm/useDemo → useDemo}/index.d.ts.map +0 -0
- /package/{build/esm/useDemo → useDemo}/index.js +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/index.d.ts +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/index.d.ts.map +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/index.js +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/useOnHydrate.d.ts +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/useOnHydrate.d.ts.map +0 -0
- /package/{build/esm/useOnHydrate → useOnHydrate}/useOnHydrate.js +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/index.d.ts +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/index.d.ts.map +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/index.js +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/useOnIdle.d.ts +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/useOnIdle.d.ts.map +0 -0
- /package/{build/esm/useOnIdle → useOnIdle}/useOnIdle.js +0 -0
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.parseFunctionParameters = parseFunctionParameters;
|
|
7
|
-
/**
|
|
8
|
-
* Utility function for parsing function parameters and handling nested structures
|
|
9
|
-
* in JavaScript/TypeScript code.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Parses function parameters, splitting by top-level commas and extracting object literals.
|
|
14
|
-
* This combines comma-splitting with object extraction for common use cases.
|
|
15
|
-
*/
|
|
16
|
-
function parseFunctionParameters(str) {
|
|
17
|
-
var parts = [];
|
|
18
|
-
var objects = [];
|
|
19
|
-
var current = '';
|
|
20
|
-
var parenCount = 0;
|
|
21
|
-
var braceCount = 0;
|
|
22
|
-
var inSingleLineComment = false;
|
|
23
|
-
var inMultiLineComment = false;
|
|
24
|
-
var inString = false;
|
|
25
|
-
var stringChar = '';
|
|
26
|
-
for (var i = 0; i < str.length; i += 1) {
|
|
27
|
-
var _char = str[i];
|
|
28
|
-
var nextChar = str[i + 1];
|
|
29
|
-
|
|
30
|
-
// Handle comments
|
|
31
|
-
if (!inString && !inSingleLineComment && !inMultiLineComment) {
|
|
32
|
-
if (_char === '/' && nextChar === '/') {
|
|
33
|
-
inSingleLineComment = true;
|
|
34
|
-
current += _char;
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
if (_char === '/' && nextChar === '*') {
|
|
38
|
-
inMultiLineComment = true;
|
|
39
|
-
current += _char;
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
if (inSingleLineComment && _char === '\n') {
|
|
44
|
-
inSingleLineComment = false;
|
|
45
|
-
current += _char;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
if (inMultiLineComment && _char === '*' && nextChar === '/') {
|
|
49
|
-
inMultiLineComment = false;
|
|
50
|
-
current += _char + nextChar;
|
|
51
|
-
i += 1; // Skip next character
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
if (inSingleLineComment || inMultiLineComment) {
|
|
55
|
-
current += _char;
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Handle strings
|
|
60
|
-
if (!inString && (_char === '"' || _char === "'" || _char === '`')) {
|
|
61
|
-
inString = true;
|
|
62
|
-
stringChar = _char;
|
|
63
|
-
current += _char;
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (inString && _char === stringChar && str[i - 1] !== '\\') {
|
|
67
|
-
inString = false;
|
|
68
|
-
stringChar = '';
|
|
69
|
-
current += _char;
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
if (inString) {
|
|
73
|
-
current += _char;
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Handle brackets and parentheses
|
|
78
|
-
if (_char === '(') {
|
|
79
|
-
parenCount += 1;
|
|
80
|
-
} else if (_char === ')') {
|
|
81
|
-
parenCount -= 1;
|
|
82
|
-
} else if (_char === '{') {
|
|
83
|
-
braceCount += 1;
|
|
84
|
-
} else if (_char === '}') {
|
|
85
|
-
braceCount -= 1;
|
|
86
|
-
} else if (_char === ',' && parenCount === 0 && braceCount === 0) {
|
|
87
|
-
var trimmedPart = current.trim();
|
|
88
|
-
parts.push(trimmedPart);
|
|
89
|
-
objects.push(extractBalancedBraces(trimmedPart));
|
|
90
|
-
current = '';
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
current += _char;
|
|
94
|
-
}
|
|
95
|
-
if (current.trim()) {
|
|
96
|
-
var _trimmedPart = current.trim();
|
|
97
|
-
parts.push(_trimmedPart);
|
|
98
|
-
objects.push(extractBalancedBraces(_trimmedPart));
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
parts: parts,
|
|
102
|
-
objects: objects
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Extracts a balanced brace object from a string, handling leading whitespace and comments
|
|
108
|
-
*/
|
|
109
|
-
function extractBalancedBraces(str) {
|
|
110
|
-
// Find the first opening brace, skipping whitespace and comments
|
|
111
|
-
var startIndex = -1;
|
|
112
|
-
var inSingleLineComment = false;
|
|
113
|
-
var inMultiLineComment = false;
|
|
114
|
-
for (var i = 0; i < str.length; i += 1) {
|
|
115
|
-
var _char2 = str[i];
|
|
116
|
-
var nextChar = str[i + 1];
|
|
117
|
-
|
|
118
|
-
// Handle comments
|
|
119
|
-
if (!inSingleLineComment && !inMultiLineComment) {
|
|
120
|
-
if (_char2 === '/' && nextChar === '/') {
|
|
121
|
-
inSingleLineComment = true;
|
|
122
|
-
continue;
|
|
123
|
-
}
|
|
124
|
-
if (_char2 === '/' && nextChar === '*') {
|
|
125
|
-
inMultiLineComment = true;
|
|
126
|
-
i += 1; // Skip next character
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (inSingleLineComment && _char2 === '\n') {
|
|
131
|
-
inSingleLineComment = false;
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
if (inMultiLineComment && _char2 === '*' && nextChar === '/') {
|
|
135
|
-
inMultiLineComment = false;
|
|
136
|
-
i += 1; // Skip next character
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
if (inSingleLineComment || inMultiLineComment) {
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Skip whitespace
|
|
144
|
-
if (_char2 === ' ' || _char2 === '\t' || _char2 === '\n' || _char2 === '\r') {
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Found first non-whitespace, non-comment character
|
|
149
|
-
if (_char2 === '{') {
|
|
150
|
-
startIndex = i;
|
|
151
|
-
break;
|
|
152
|
-
} else {
|
|
153
|
-
// If it's not a brace, this isn't a valid object
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
if (startIndex === -1) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
var braceCount = 0;
|
|
161
|
-
var endIndex = -1;
|
|
162
|
-
for (var _i = startIndex; _i < str.length; _i += 1) {
|
|
163
|
-
if (str[_i] === '{') {
|
|
164
|
-
braceCount += 1;
|
|
165
|
-
} else if (str[_i] === '}') {
|
|
166
|
-
braceCount -= 1;
|
|
167
|
-
if (braceCount === 0) {
|
|
168
|
-
endIndex = _i;
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return endIndex !== -1 ? str.substring(startIndex, endIndex + 1) : null;
|
|
174
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Replaces 'precompute: true' with the actual precomputed data in source code.
|
|
3
|
-
*
|
|
4
|
-
* This function performs a precise replacement of the boolean true value in
|
|
5
|
-
* 'precompute: true' expressions with the provided data object, keeping the
|
|
6
|
-
* rest of the source code unchanged.
|
|
7
|
-
*
|
|
8
|
-
* @param source - The source code string containing 'precompute: true'
|
|
9
|
-
* @param precomputeData - The data object to replace the true value with
|
|
10
|
-
* @returns The modified source code with precompute data injected
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* const source = `
|
|
15
|
-
* export const demo = createDemo(
|
|
16
|
-
* import.meta.url,
|
|
17
|
-
* { Component },
|
|
18
|
-
* { precompute: true }
|
|
19
|
-
* );
|
|
20
|
-
* `;
|
|
21
|
-
*
|
|
22
|
-
* const data = { variants: { default: { code: "..." } } };
|
|
23
|
-
* const result = replacePrecomputeValue(source, data);
|
|
24
|
-
* // Result will have 'precompute: true' replaced with 'precompute: { variants: { default: { code: "..." } } }'
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare function replacePrecomputeValue(source: string, precomputeData: Record<string, any>): string;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.replacePrecomputeValue = replacePrecomputeValue;
|
|
7
|
-
/**
|
|
8
|
-
* Replaces 'precompute: true' with the actual precomputed data in source code.
|
|
9
|
-
*
|
|
10
|
-
* This function performs a precise replacement of the boolean true value in
|
|
11
|
-
* 'precompute: true' expressions with the provided data object, keeping the
|
|
12
|
-
* rest of the source code unchanged.
|
|
13
|
-
*
|
|
14
|
-
* @param source - The source code string containing 'precompute: true'
|
|
15
|
-
* @param precomputeData - The data object to replace the true value with
|
|
16
|
-
* @returns The modified source code with precompute data injected
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* const source = `
|
|
21
|
-
* export const demo = createDemo(
|
|
22
|
-
* import.meta.url,
|
|
23
|
-
* { Component },
|
|
24
|
-
* { precompute: true }
|
|
25
|
-
* );
|
|
26
|
-
* `;
|
|
27
|
-
*
|
|
28
|
-
* const data = { variants: { default: { code: "..." } } };
|
|
29
|
-
* const result = replacePrecomputeValue(source, data);
|
|
30
|
-
* // Result will have 'precompute: true' replaced with 'precompute: { variants: { default: { code: "..." } } }'
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
function replacePrecomputeValue(source, precomputeData) {
|
|
34
|
-
// Regex to match 'precompute: true' with optional whitespace
|
|
35
|
-
var precomputeRegex = /precompute\s*:\s*true/g;
|
|
36
|
-
|
|
37
|
-
// Convert the data to a properly formatted JSON string
|
|
38
|
-
var precomputeDataString = JSON.stringify(precomputeData, null, 2);
|
|
39
|
-
|
|
40
|
-
// Replace 'precompute: true' with 'precompute: {data}'
|
|
41
|
-
// The regex will match the exact pattern and we replace just that part
|
|
42
|
-
return source.replace(precomputeRegex, "precompute: ".concat(precomputeDataString));
|
|
43
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./serverLoadCodeMeta.js";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _serverLoadCodeMeta = require("./serverLoadCodeMeta");
|
|
7
|
-
Object.keys(_serverLoadCodeMeta).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _serverLoadCodeMeta[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _serverLoadCodeMeta[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { LoadCodeMeta } from "../CodeHighlighter/types.js";
|
|
2
|
-
export interface CreateLoadCodeMetaOptions {}
|
|
3
|
-
/**
|
|
4
|
-
* Default serverLoadCodeMeta function that resolves variant paths from demo files.
|
|
5
|
-
* This function is used to load code metadata for demos, specifically resolving paths for variants defined in the demo files.
|
|
6
|
-
* It reads the demo file, parses it to find `createDemo` calls with variants, and resolves the paths for those variants.
|
|
7
|
-
* It returns a Code object mapping variant names to their resolved file URLs.
|
|
8
|
-
*/
|
|
9
|
-
export declare const serverLoadCodeMeta: LoadCodeMeta;
|
|
10
|
-
/**
|
|
11
|
-
* Creates a loadCodeMeta function that resolves variant paths from demo files.
|
|
12
|
-
*
|
|
13
|
-
* This factory function creates a LoadCodeMeta implementation that:
|
|
14
|
-
* 1. Parses the demo file to find createDemo calls with variants
|
|
15
|
-
* 2. Resolves all variant entry point paths using resolveVariantPaths
|
|
16
|
-
* 3. Returns a Code object mapping variant names to their resolved file URLs
|
|
17
|
-
*
|
|
18
|
-
* The actual loading, parsing, and transformation of the variants is handled
|
|
19
|
-
* elsewhere by the CodeHighlighter component using loadVariant.
|
|
20
|
-
*
|
|
21
|
-
* @param options - Configuration options (currently unused)
|
|
22
|
-
* @returns LoadCodeMeta function that takes a URL and returns Promise<Code>
|
|
23
|
-
*/
|
|
24
|
-
export declare function createServerLoadCodeMeta(_options?: CreateLoadCodeMetaOptions): LoadCodeMeta;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.createServerLoadCodeMeta = createServerLoadCodeMeta;
|
|
8
|
-
exports.serverLoadCodeMeta = void 0;
|
|
9
|
-
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
-
var _promises = require("node:fs/promises");
|
|
13
|
-
var _resolveModulePathWithFs = require("../loaderUtils/resolveModulePathWithFs");
|
|
14
|
-
var _parseCreateFactoryCall = require("../loadPrecomputedCodeHighlighter/parseCreateFactoryCall");
|
|
15
|
-
/**
|
|
16
|
-
* Default serverLoadCodeMeta function that resolves variant paths from demo files.
|
|
17
|
-
* This function is used to load code metadata for demos, specifically resolving paths for variants defined in the demo files.
|
|
18
|
-
* It reads the demo file, parses it to find `createDemo` calls with variants, and resolves the paths for those variants.
|
|
19
|
-
* It returns a Code object mapping variant names to their resolved file URLs.
|
|
20
|
-
*/
|
|
21
|
-
var serverLoadCodeMeta = exports.serverLoadCodeMeta = createServerLoadCodeMeta();
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Creates a loadCodeMeta function that resolves variant paths from demo files.
|
|
25
|
-
*
|
|
26
|
-
* This factory function creates a LoadCodeMeta implementation that:
|
|
27
|
-
* 1. Parses the demo file to find createDemo calls with variants
|
|
28
|
-
* 2. Resolves all variant entry point paths using resolveVariantPaths
|
|
29
|
-
* 3. Returns a Code object mapping variant names to their resolved file URLs
|
|
30
|
-
*
|
|
31
|
-
* The actual loading, parsing, and transformation of the variants is handled
|
|
32
|
-
* elsewhere by the CodeHighlighter component using loadVariant.
|
|
33
|
-
*
|
|
34
|
-
* @param options - Configuration options (currently unused)
|
|
35
|
-
* @returns LoadCodeMeta function that takes a URL and returns Promise<Code>
|
|
36
|
-
*/
|
|
37
|
-
function createServerLoadCodeMeta() {
|
|
38
|
-
var _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
39
|
-
return /*#__PURE__*/function () {
|
|
40
|
-
var _loadCodeMeta = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee(url) {
|
|
41
|
-
var filePath, source, demoCall, code, resolvedVariantMap;
|
|
42
|
-
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
43
|
-
while (1) switch (_context.prev = _context.next) {
|
|
44
|
-
case 0:
|
|
45
|
-
// Remove file:// prefix if present to get file path
|
|
46
|
-
filePath = url.replace('file://', ''); // Read the source file to find createDemo calls
|
|
47
|
-
_context.next = 3;
|
|
48
|
-
return (0, _promises.readFile)(filePath, 'utf-8');
|
|
49
|
-
case 3:
|
|
50
|
-
source = _context.sent;
|
|
51
|
-
_context.next = 6;
|
|
52
|
-
return (0, _parseCreateFactoryCall.parseCreateFactoryCall)(source, filePath);
|
|
53
|
-
case 6:
|
|
54
|
-
demoCall = _context.sent;
|
|
55
|
-
if (!(!demoCall || !demoCall.variants)) {
|
|
56
|
-
_context.next = 9;
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
return _context.abrupt("return", {});
|
|
60
|
-
case 9:
|
|
61
|
-
code = {}; // Resolve all variant paths and get them as file URLs
|
|
62
|
-
_context.next = 12;
|
|
63
|
-
return (0, _resolveModulePathWithFs.resolveVariantPathsWithFs)(demoCall.variants);
|
|
64
|
-
case 12:
|
|
65
|
-
resolvedVariantMap = _context.sent;
|
|
66
|
-
// Build Code object from the resolved variant map
|
|
67
|
-
Array.from(resolvedVariantMap.entries()).forEach(function (_ref) {
|
|
68
|
-
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
69
|
-
variantName = _ref2[0],
|
|
70
|
-
fileUrl = _ref2[1];
|
|
71
|
-
code[variantName] = fileUrl;
|
|
72
|
-
});
|
|
73
|
-
return _context.abrupt("return", code);
|
|
74
|
-
case 15:
|
|
75
|
-
case "end":
|
|
76
|
-
return _context.stop();
|
|
77
|
-
}
|
|
78
|
-
}, _callee);
|
|
79
|
-
}));
|
|
80
|
-
function loadCodeMeta(_x) {
|
|
81
|
-
return _loadCodeMeta.apply(this, arguments);
|
|
82
|
-
}
|
|
83
|
-
return loadCodeMeta;
|
|
84
|
-
}();
|
|
85
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./serverLoadSource.js";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _serverLoadSource = require("./serverLoadSource");
|
|
7
|
-
Object.keys(_serverLoadSource).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _serverLoadSource[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _serverLoadSource[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { LoadSource } from "../CodeHighlighter/types.js";
|
|
2
|
-
import { type StoreAtMode } from "../loaderUtils/processImports.js";
|
|
3
|
-
interface LoadSourceOptions {
|
|
4
|
-
maxDepth?: number;
|
|
5
|
-
maxFiles?: number;
|
|
6
|
-
includeDependencies?: boolean;
|
|
7
|
-
storeAt?: StoreAtMode;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Default serverLoadSource function that reads a file and extracts its dependencies.
|
|
11
|
-
* This function is used to load source files for demos, resolving their imports and dependencies.
|
|
12
|
-
* It reads the source file, resolves its imports, and returns the processed source along with any
|
|
13
|
-
* additional files and dependencies that were found.
|
|
14
|
-
*/
|
|
15
|
-
export declare const serverLoadSource: LoadSource;
|
|
16
|
-
/**
|
|
17
|
-
* Creates a loadSource function that reads a file and extracts its dependencies.
|
|
18
|
-
*
|
|
19
|
-
* @param options.storeAt - Controls how imports are stored in extraFiles:
|
|
20
|
-
* - 'canonical': Full resolved path (e.g., '../Component/index.js')
|
|
21
|
-
* - 'import': Import path with file extension (e.g., '../Component.js')
|
|
22
|
-
* - 'flat': Flattened to current directory with rewritten imports (e.g., './Component.js')
|
|
23
|
-
*/
|
|
24
|
-
export declare function createServerLoadSource(options?: LoadSourceOptions): LoadSource;
|
|
25
|
-
export {};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.createServerLoadSource = createServerLoadSource;
|
|
8
|
-
exports.serverLoadSource = void 0;
|
|
9
|
-
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
-
var _promises = require("node:fs/promises");
|
|
12
|
-
var _resolveImports = require("../loaderUtils/resolveImports");
|
|
13
|
-
var _resolveModulePathWithFs = require("../loaderUtils/resolveModulePathWithFs");
|
|
14
|
-
var _processImports = require("../loaderUtils/processImports");
|
|
15
|
-
var _resolveModulePath = require("../loaderUtils/resolveModulePath");
|
|
16
|
-
/**
|
|
17
|
-
* Default serverLoadSource function that reads a file and extracts its dependencies.
|
|
18
|
-
* This function is used to load source files for demos, resolving their imports and dependencies.
|
|
19
|
-
* It reads the source file, resolves its imports, and returns the processed source along with any
|
|
20
|
-
* additional files and dependencies that were found.
|
|
21
|
-
*/
|
|
22
|
-
var serverLoadSource = exports.serverLoadSource = createServerLoadSource();
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Creates a loadSource function that reads a file and extracts its dependencies.
|
|
26
|
-
*
|
|
27
|
-
* @param options.storeAt - Controls how imports are stored in extraFiles:
|
|
28
|
-
* - 'canonical': Full resolved path (e.g., '../Component/index.js')
|
|
29
|
-
* - 'import': Import path with file extension (e.g., '../Component.js')
|
|
30
|
-
* - 'flat': Flattened to current directory with rewritten imports (e.g., './Component.js')
|
|
31
|
-
*/
|
|
32
|
-
function createServerLoadSource() {
|
|
33
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
34
|
-
var _options$includeDepen = options.includeDependencies,
|
|
35
|
-
includeDependencies = _options$includeDepen === void 0 ? true : _options$includeDepen,
|
|
36
|
-
_options$storeAt = options.storeAt,
|
|
37
|
-
storeAt = _options$storeAt === void 0 ? 'flat' : _options$storeAt;
|
|
38
|
-
return /*#__PURE__*/function () {
|
|
39
|
-
var _loadSource = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regeneratorRuntime2["default"])().mark(function _callee(url) {
|
|
40
|
-
var filePath, source, isJavascriptModuleFile, importResult, resolvedPathsMap, _processImportsWithSt, processedSource, extraFiles, extraDependencies;
|
|
41
|
-
return (0, _regeneratorRuntime2["default"])().wrap(function _callee$(_context) {
|
|
42
|
-
while (1) switch (_context.prev = _context.next) {
|
|
43
|
-
case 0:
|
|
44
|
-
// Remove file:// prefix if present
|
|
45
|
-
filePath = url.replace('file://', ''); // Read the file
|
|
46
|
-
_context.next = 3;
|
|
47
|
-
return (0, _promises.readFile)(filePath, 'utf8');
|
|
48
|
-
case 3:
|
|
49
|
-
source = _context.sent;
|
|
50
|
-
if (includeDependencies) {
|
|
51
|
-
_context.next = 6;
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
return _context.abrupt("return", {
|
|
55
|
-
source: source
|
|
56
|
-
});
|
|
57
|
-
case 6:
|
|
58
|
-
// Check if this is a static asset file (non-JS/TS modules)
|
|
59
|
-
isJavascriptModuleFile = (0, _resolveModulePath.isJavaScriptModule)(filePath);
|
|
60
|
-
if (isJavascriptModuleFile) {
|
|
61
|
-
_context.next = 9;
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
return _context.abrupt("return", {
|
|
65
|
-
source: source
|
|
66
|
-
});
|
|
67
|
-
case 9:
|
|
68
|
-
_context.next = 11;
|
|
69
|
-
return (0, _resolveImports.resolveImports)(source, filePath);
|
|
70
|
-
case 11:
|
|
71
|
-
importResult = _context.sent;
|
|
72
|
-
if (!(Object.keys(importResult).length === 0)) {
|
|
73
|
-
_context.next = 14;
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
return _context.abrupt("return", {
|
|
77
|
-
source: source
|
|
78
|
-
});
|
|
79
|
-
case 14:
|
|
80
|
-
_context.next = 16;
|
|
81
|
-
return (0, _resolveModulePathWithFs.resolveImportResultWithFs)(importResult);
|
|
82
|
-
case 16:
|
|
83
|
-
resolvedPathsMap = _context.sent;
|
|
84
|
-
// Process imports using the consolidated helper function
|
|
85
|
-
_processImportsWithSt = (0, _processImports.processImportsWithStoreAt)(source, importResult, resolvedPathsMap, storeAt), processedSource = _processImportsWithSt.processedSource, extraFiles = _processImportsWithSt.extraFiles; // Build dependencies list for recursive loading
|
|
86
|
-
extraDependencies = Object.values(importResult).map(function (_ref) {
|
|
87
|
-
var path = _ref.path;
|
|
88
|
-
return resolvedPathsMap.get(path);
|
|
89
|
-
}).filter(function (path) {
|
|
90
|
-
return path !== undefined;
|
|
91
|
-
});
|
|
92
|
-
return _context.abrupt("return", {
|
|
93
|
-
source: processedSource,
|
|
94
|
-
extraFiles: Object.keys(extraFiles).length > 0 ? extraFiles : undefined,
|
|
95
|
-
extraDependencies: extraDependencies.length > 0 ? extraDependencies : undefined
|
|
96
|
-
});
|
|
97
|
-
case 20:
|
|
98
|
-
case "end":
|
|
99
|
-
return _context.stop();
|
|
100
|
-
}
|
|
101
|
-
}, _callee);
|
|
102
|
-
}));
|
|
103
|
-
function loadSource(_x) {
|
|
104
|
-
return _loadSource.apply(this, arguments);
|
|
105
|
-
}
|
|
106
|
-
return loadSource;
|
|
107
|
-
}();
|
|
108
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extracts the filename and extension from a URL or file path.
|
|
3
|
-
* This function is isomorphic and works in both Node.js and browser environments.
|
|
4
|
-
*
|
|
5
|
-
* @param url - The URL or file path to extract the filename from
|
|
6
|
-
* @returns An object containing the filename and extension
|
|
7
|
-
*/
|
|
8
|
-
export declare function getFileNameFromUrl(url: string): {
|
|
9
|
-
fileName: string;
|
|
10
|
-
extension: string;
|
|
11
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getFileNameFromUrl = getFileNameFromUrl;
|
|
7
|
-
/**
|
|
8
|
-
* Extracts the filename and extension from a URL or file path.
|
|
9
|
-
* This function is isomorphic and works in both Node.js and browser environments.
|
|
10
|
-
*
|
|
11
|
-
* @param url - The URL or file path to extract the filename from
|
|
12
|
-
* @returns An object containing the filename and extension
|
|
13
|
-
*/
|
|
14
|
-
function getFileNameFromUrl(url) {
|
|
15
|
-
try {
|
|
16
|
-
// Use URL constructor to handle various URL formats
|
|
17
|
-
var urlObj = new URL(url);
|
|
18
|
-
var pathname = urlObj.pathname;
|
|
19
|
-
var fileName = pathname.split('/').pop() || '';
|
|
20
|
-
|
|
21
|
-
// Extract extension (including the dot)
|
|
22
|
-
var lastDotIndex = fileName.lastIndexOf('.');
|
|
23
|
-
var extension = lastDotIndex > 0 ? fileName.substring(lastDotIndex) : '';
|
|
24
|
-
return {
|
|
25
|
-
fileName: fileName,
|
|
26
|
-
extension: extension
|
|
27
|
-
};
|
|
28
|
-
} catch (_unused) {
|
|
29
|
-
// If URL parsing fails, fall back to simple string manipulation
|
|
30
|
-
var _fileName = url.split('/').pop() || url;
|
|
31
|
-
var _lastDotIndex = _fileName.lastIndexOf('.');
|
|
32
|
-
var _extension = _lastDotIndex > 0 ? _fileName.substring(_lastDotIndex) : '';
|
|
33
|
-
return {
|
|
34
|
-
fileName: _fileName,
|
|
35
|
-
extension: _extension
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _resolveImports = require("./resolveImports");
|
|
7
|
-
Object.keys(_resolveImports).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _resolveImports[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _resolveImports[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _resolveModulePath = require("./resolveModulePath");
|
|
18
|
-
Object.keys(_resolveModulePath).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _resolveModulePath[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _resolveModulePath[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _rewriteImports = require("./rewriteImports");
|
|
29
|
-
Object.keys(_rewriteImports).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _rewriteImports[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function get() {
|
|
35
|
-
return _rewriteImports[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _processImports = require("./processImports");
|
|
40
|
-
Object.keys(_processImports).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _processImports[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function get() {
|
|
46
|
-
return _processImports[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _getFileNameFromUrl = require("./getFileNameFromUrl");
|
|
51
|
-
Object.keys(_getFileNameFromUrl).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _getFileNameFromUrl[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function get() {
|
|
57
|
-
return _getFileNameFromUrl[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type StoreAtMode = 'canonical' | 'import' | 'flat';
|
|
2
|
-
export interface ProcessImportsResult {
|
|
3
|
-
processedSource: string;
|
|
4
|
-
extraFiles: Record<string, string>;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Processes imports based on the specified storage mode, automatically handling
|
|
8
|
-
* source rewriting when needed (e.g., for 'flat' mode).
|
|
9
|
-
*
|
|
10
|
-
* @param source - The original source code
|
|
11
|
-
* @param importResult - The result from resolveImports
|
|
12
|
-
* @param resolvedPathsMap - Map from import paths to resolved file paths
|
|
13
|
-
* @param storeAt - How to process the imports
|
|
14
|
-
* @returns Object with processed source and extraFiles mapping
|
|
15
|
-
*/
|
|
16
|
-
export declare function processImportsWithStoreAt(source: string, importResult: Record<string, {
|
|
17
|
-
path: string;
|
|
18
|
-
names: string[];
|
|
19
|
-
}>, resolvedPathsMap: Map<string, string>, storeAt: StoreAtMode): ProcessImportsResult;
|