@mui/internal-docs-infra 0.3.1-canary.0 → 0.3.1-canary.1

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.
Files changed (26) hide show
  1. package/esm/pipeline/loadCodeVariant/loadCodeVariant.js +19 -6
  2. package/esm/pipeline/loadPrecomputedCodeHighlighter/loadPrecomputedCodeHighlighter.js +10 -5
  3. package/esm/pipeline/loadPrecomputedCodeHighlighter/parseCreateFactoryCall.js +3 -3
  4. package/esm/pipeline/loadPrecomputedCodeHighlighterClient/loadPrecomputedCodeHighlighterClient.js +17 -7
  5. package/esm/pipeline/loadPrecomputedSitemap/loadPrecomputedSitemap.js +10 -3
  6. package/esm/pipeline/loadServerCodeMeta/loadServerCodeMeta.js +5 -3
  7. package/esm/pipeline/loadServerCodeMeta/resolveModulePathWithFs.d.ts +2 -2
  8. package/esm/pipeline/loadServerCodeMeta/resolveModulePathWithFs.js +13 -7
  9. package/esm/pipeline/loadServerPageIndex/loadServerPageIndex.js +4 -2
  10. package/esm/pipeline/loadServerSitemap/loadServerSitemap.js +4 -2
  11. package/esm/pipeline/loadServerSource/loadServerSource.js +17 -14
  12. package/esm/pipeline/loaderUtils/extractNameAndSlugFromUrl.d.ts +0 -9
  13. package/esm/pipeline/loaderUtils/extractNameAndSlugFromUrl.js +7 -7
  14. package/esm/pipeline/loaderUtils/fileUrlToPortablePath.d.ts +44 -0
  15. package/esm/pipeline/loaderUtils/fileUrlToPortablePath.js +80 -0
  16. package/esm/pipeline/loaderUtils/index.d.ts +2 -1
  17. package/esm/pipeline/loaderUtils/index.js +2 -1
  18. package/esm/pipeline/loaderUtils/parseImportsAndComments.d.ts +10 -6
  19. package/esm/pipeline/loaderUtils/parseImportsAndComments.js +17 -12
  20. package/esm/pipeline/loaderUtils/processRelativeImports.d.ts +1 -1
  21. package/esm/pipeline/loaderUtils/processRelativeImports.js +28 -24
  22. package/esm/pipeline/loaderUtils/resolveModulePath.d.ts +5 -5
  23. package/esm/pipeline/loaderUtils/resolveModulePath.js +40 -37
  24. package/esm/pipeline/transformMarkdownRelativePaths/transformMarkdownRelativePaths.js +7 -4
  25. package/esm/withDocsInfra/withDocsInfra.js +16 -8
  26. package/package.json +2 -2
@@ -163,7 +163,7 @@ export function withDocsInfra() {
163
163
 
164
164
  // Add loader for demo index files
165
165
  webpackConfig.module.rules.push({
166
- test: new RegExp('/demos/[^/]+/index\\.ts$'),
166
+ test: new RegExp('[/\\\\]demos[/\\\\][^/\\\\]+[/\\\\]index\\.ts$'),
167
167
  use: [defaultLoaders.babel, {
168
168
  loader: '@mui/internal-docs-infra/pipeline/loadPrecomputedCodeHighlighter',
169
169
  options: {
@@ -175,7 +175,7 @@ export function withDocsInfra() {
175
175
 
176
176
  // Client files for live demos - processes externals
177
177
  webpackConfig.module.rules.push({
178
- test: new RegExp('/demos/[^/]+/client\\.ts$'),
178
+ test: new RegExp('[/\\\\]demos[/\\\\][^/\\\\]+[/\\\\]client\\.ts$'),
179
179
  use: [defaultLoaders.babel, {
180
180
  loader: '@mui/internal-docs-infra/pipeline/loadPrecomputedCodeHighlighterClient',
181
181
  options: {
@@ -186,7 +186,7 @@ export function withDocsInfra() {
186
186
 
187
187
  // Sitemap loader
188
188
  webpackConfig.module.rules.push({
189
- test: new RegExp('/sitemap/index\\.ts$'),
189
+ test: new RegExp('[/\\\\]sitemap[/\\\\]index\\.ts$'),
190
190
  use: [defaultLoaders.babel, {
191
191
  loader: '@mui/internal-docs-infra/pipeline/loadPrecomputedSitemap',
192
192
  options: {
@@ -199,11 +199,19 @@ export function withDocsInfra() {
199
199
  if (additionalDemoPatterns.index) {
200
200
  additionalDemoPatterns.index.forEach(function (pattern) {
201
201
  // Convert Turbopack pattern to webpack regex
202
- var regexPattern = pattern.replace(/^\.\//, '/') // Remove leading ./
202
+ // Pattern like './app/**/demos/*/demo-*/index.ts'
203
+ // Should match paths like '/app/components/demos/Button/demo-variant/index.ts'
204
+ // Use placeholders to avoid corrupting character classes during replacement
205
+ var SEP = 'PATH_SEP_PLACEHOLDER';
206
+ var NOT_SEP = 'NOT_PATH_SEP_PLACEHOLDER';
207
+ var regexPattern = pattern.replace(/^\.\//, '') // Remove leading ./
203
208
  .replace(/\*\*\//g, 'DOUBLE_STAR_PLACEHOLDER') // Replace **/ with placeholder
204
- .replace(/\*/g, '[^/]+') // Replace single * with single dir pattern
209
+ .replace(/\*/g, NOT_SEP) // Replace single * with placeholder
205
210
  .replace(/\./g, '\\.') // Escape dots
206
- .replace(/DOUBLE_STAR_PLACEHOLDER/g, '(?:[^/]+/)*'); // Replace placeholder with zero or more directories
211
+ .replace(/DOUBLE_STAR_PLACEHOLDER/g, "(?:".concat(NOT_SEP).concat(SEP, ")*")) // Replace placeholder with zero or more directories
212
+ .replace(/\//g, SEP) // Convert all path separators to placeholder
213
+ .replace(new RegExp(NOT_SEP, 'g'), '[^/\\\\]+') // Replace NOT_SEP with actual pattern
214
+ .replace(new RegExp(SEP, 'g'), '[/\\\\]'); // Replace SEP with actual pattern
207
215
 
208
216
  webpackConfig.module.rules.push({
209
217
  test: new RegExp("".concat(regexPattern, "$")),
@@ -222,9 +230,9 @@ export function withDocsInfra() {
222
230
  // Convert Turbopack pattern to webpack regex
223
231
  var regexPattern = pattern.replace(/^\.\//, '/') // Remove leading ./
224
232
  .replace(/\*\*\//g, 'DOUBLE_STAR_PLACEHOLDER') // Replace **/ with placeholder
225
- .replace(/\*/g, '[^/]+') // Replace single * with single dir pattern
233
+ .replace(/\*/g, '[^/\\\\]+') // Replace single * with single dir pattern
226
234
  .replace(/\./g, '\\.') // Escape dots
227
- .replace(/DOUBLE_STAR_PLACEHOLDER/g, '(?:[^/]+/)*'); // Replace placeholder with zero or more directories
235
+ .replace(/DOUBLE_STAR_PLACEHOLDER/g, '(?:[^/\\\\]+/)*'); // Replace placeholder with zero or more directories
228
236
 
229
237
  webpackConfig.module.rules.push({
230
238
  test: new RegExp("".concat(regexPattern, "$")),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-docs-infra",
3
- "version": "0.3.1-canary.0",
3
+ "version": "0.3.1-canary.1",
4
4
  "author": "MUI Team",
5
5
  "description": "MUI Infra - internal documentation creation tools.",
6
6
  "bin": {
@@ -329,5 +329,5 @@
329
329
  },
330
330
  "./esm": null
331
331
  },
332
- "gitSha": "574e1c4cb0ffb5cdcfb946acb4087fad4ed61f44"
332
+ "gitSha": "04aa71c45b922602c25a926df3a7e17cb3744ac1"
333
333
  }