Skip to content

Commit

Permalink
Remove MyApp and make update-data-npm Node 23 aware
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Feb 7, 2025
1 parent d843a59 commit 0889f22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion data/npm/legacy-names.json
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,6 @@
"My1ink",
"MyAngularGruntt",
"MyAnimalModule",
"MyApp",
"myappSriniAppala",
"myappUSBankExample",
"myAries",
Expand Down
10 changes: 7 additions & 3 deletions scripts/update-data-npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const npmDataPath = path.join(dataPath, 'npm')
const npmBuiltinNamesJsonPath = path.join(npmDataPath, 'builtin-names.json')
const npmLegacyNamesJsonPath = path.join(npmDataPath, 'legacy-names.json')

const { compare: alphanumericComparator } = new Intl.Collator(undefined, {
const { compare: naturalCompare } = new Intl.Collator(undefined, {
numeric: true,
sensitivity: 'base'
})
Expand Down Expand Up @@ -82,7 +82,11 @@ async function pFilterChunk(chunks, callbackFn, options) {

void (async () => {
const spinner = yoctoSpinner().start()
const builtinNames = Module.builtinModules.toSorted(alphanumericComparator)
const builtinNames = Module.builtinModules
// Node 23 introduces 'node:sea', 'node:sqlite', 'node:test', and
// 'node:test/reporters' that have no unprefixed version so we skip them.
.filter(n => !n.startsWith('node:'))
.toSorted(naturalCompare)
const allThePackageNames = [
...new Set([
// Load the 43.1MB names.json file of '[email protected]'
Expand All @@ -97,7 +101,7 @@ void (async () => {
]
const rawLegacyNames = allThePackageNames
.filter(n => !validateNpmPackageName(n).validForNewPackages)
.sort(alphanumericComparator)
.sort(naturalCompare)
const seenNames = new Set()
const invalidNames = new Set()
const legacyNames =
Expand Down

0 comments on commit 0889f22

Please sign in to comment.