Skip to content

Commit

Permalink
Sync with TypeScript-Website @ 2df2b8a (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
awxiaoxian2020 authored Aug 4, 2024
2 parents 9491bdb + 3fee598 commit 519bc4b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/ata/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @typescript/ata

## 0.9.7

### Patch Changes

- [#3191](https://github.com/microsoft/TypeScript-Website/pull/3191) [`1d0af97`](https://github.com/microsoft/TypeScript-Website/commit/1d0af97318b79943fe0bfa8871ee6e8c584c9af5) Thanks [@Renegade334](https://github.com/Renegade334)! - Always treat `node:` modules as Node, expand list of known Node modules

## 0.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ata/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript/ata",
"version": "0.9.6",
"version": "0.9.7",
"license": "MIT",
"homepage": "https://github.com/microsoft/TypeScript-Website",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion packages/ata/src/edgeCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const mapModuleNameToModule = (moduleSpecifier: string) => {
"http2",
"https",
"inspector",
"inspector/promises",
"module",
"net",
"os",
Expand Down Expand Up @@ -57,7 +58,7 @@ export const mapModuleNameToModule = (moduleSpecifier: string) => {
"zlib",
]

if (builtInNodeMods.includes(moduleSpecifier.replace("node:", ""))) {
if (moduleSpecifier.indexOf("node:") === 0 || builtInNodeMods.includes(moduleSpecifier)) {
return "node"
}

Expand Down
5 changes: 5 additions & 0 deletions packages/ata/tests/edgeCases.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ describe(mapModuleNameToModule, () => {
expect(mapModuleNameToModule("node:fs")).toEqual("node")
})

it("handles mandatorily-prefixed node: identifiers", () => {
expect(mapModuleNameToModule("node:test")).toEqual("node")
expect(mapModuleNameToModule("test")).toEqual("test")
})

it("strips module filepaths", () => {
expect(mapModuleNameToModule("lodash/identity")).toEqual("lodash")
expect(mapModuleNameToModule("@org/lodash/identity")).toEqual("@org/lodash")
Expand Down
7 changes: 7 additions & 0 deletions packages/sandbox/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @typescript/sandbox

## 0.1.7

### Patch Changes

- Updated dependencies [[`1d0af97`](https://github.com/microsoft/TypeScript-Website/commit/1d0af97318b79943fe0bfa8871ee6e8c584c9af5)]:
- @typescript/ata@0.9.7

## 0.1.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@typescript/sandbox",
"version": "0.1.6",
"version": "0.1.7",
"license": "MIT",
"author": "TypeScript team",
"homepage": "https://github.com/microsoft/TypeScript-Website",
Expand Down

0 comments on commit 519bc4b

Please sign in to comment.