@uniweb/build 0.14.40 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/build",
3
- "version": "0.14.40",
3
+ "version": "0.15.0",
4
4
  "description": "Build tooling for the Uniweb Component Web Platform",
5
5
  "type": "module",
6
6
  "exports": {
@@ -64,8 +64,8 @@
64
64
  },
65
65
  "optionalDependencies": {
66
66
  "@uniweb/content-reader": "1.1.14",
67
- "@uniweb/runtime": "0.8.32",
68
- "@uniweb/schemas": "0.2.4"
67
+ "@uniweb/schemas": "0.2.4",
68
+ "@uniweb/runtime": "0.8.32"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
@@ -28,7 +28,6 @@ export {
28
28
  applySort,
29
29
  applyPostProcessing,
30
30
  mergeDataIntoContent,
31
- singularize,
32
31
  } from '../site/data-fetcher.js'
33
32
 
34
33
  // Cross-reference registry moved out of build into kit
@@ -30,7 +30,7 @@ import yaml from 'js-yaml'
30
30
  import { collectSectionAssets, mergeAssetCollections, collectConfigAssets } from './assets.js'
31
31
  import { collectSectionIcons, mergeIconCollections, buildIconManifest } from './icons.js'
32
32
  import { normalizeHideIn, dropUnpublishedPages } from './nav-visibility.js'
33
- import { parseFetchConfig, singularize } from './data-fetcher.js'
33
+ import { parseFetchConfig } from './data-fetcher.js'
34
34
  import { buildTheme, extractFoundationVars } from '../theme/index.js'
35
35
  import { resolveDefaultLocale, resolvePublishableLocales, validateLanguageConfig } from '@uniweb/core'
36
36
 
@@ -504,58 +504,6 @@ export function mergeDataIntoContent(content, fetchedData, schema, merge = false
504
504
  return result
505
505
  }
506
506
 
507
- /**
508
- * Convert a plural schema name to singular
509
- * Used for dynamic routes where the parent has "articles" and
510
- * each child page gets the singular "article" for the current item
511
- *
512
- * @param {string} name - Plural name (e.g., 'articles', 'posts', 'people')
513
- * @returns {string} Singular name (e.g., 'article', 'post', 'person')
514
- *
515
- * @example
516
- * singularize('articles') // 'article'
517
- * singularize('posts') // 'post'
518
- * singularize('people') // 'person'
519
- * singularize('categories') // 'category'
520
- */
521
- export function singularize(name) {
522
- if (!name) return name
523
-
524
- // Handle common irregular plurals
525
- const irregulars = {
526
- people: 'person',
527
- children: 'child',
528
- men: 'man',
529
- women: 'woman',
530
- feet: 'foot',
531
- teeth: 'tooth',
532
- mice: 'mouse',
533
- geese: 'goose',
534
- }
535
-
536
- if (irregulars[name]) return irregulars[name]
537
-
538
- // Standard rules (in order of specificity)
539
- if (name.endsWith('ies')) {
540
- // categories -> category
541
- return name.slice(0, -3) + 'y'
542
- }
543
- if (name.endsWith('ves')) {
544
- // leaves -> leaf
545
- return name.slice(0, -3) + 'f'
546
- }
547
- if (name.endsWith('es') && (name.endsWith('shes') || name.endsWith('ches') || name.endsWith('xes') || name.endsWith('sses') || name.endsWith('zes'))) {
548
- // boxes -> box, watches -> watch
549
- return name.slice(0, -2)
550
- }
551
- if (name.endsWith('s') && !name.endsWith('ss')) {
552
- // articles -> article
553
- return name.slice(0, -1)
554
- }
555
-
556
- return name
557
- }
558
-
559
507
  /**
560
508
  * Execute multiple fetch operations in parallel
561
509
  *
package/src/site/index.js CHANGED
@@ -45,8 +45,7 @@ export {
45
45
  applyFilter,
46
46
  applySort,
47
47
  applyPostProcessing,
48
- mergeDataIntoContent,
49
- singularize
48
+ mergeDataIntoContent
50
49
  } from './data-fetcher.js'
51
50
  export { loadDeployYml, resolveTarget } from './deploy-config.js'
52
51
  export { recordLastDeploy, recordTarget } from './deploy-config-writer.js'