Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/decode-ref.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const dirre = /^(v\d+\.\d+\.\d+(?:-rc\.\d+)?)(?:-((?:next-)?nightly|test|v8-canary)\d{8}(\w+))?$/ // get version or commit from dir name
const dirre = /^(v\d+\.\d+\.\d+(?:-rc\.\d+|-alpha\.\d+\.\d+\.\d+)?)(?:-((?:next-)?nightly|test|v8-canary)\d{8}(\w+))?$/ // get version or commit from dir name

function decodeRef (dir) {
const m = dir.match(dirre)
Expand Down
2 changes: 1 addition & 1 deletion src/transform-filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const types = {
}

function transformFilename (file) {
file = file && file.replace(/^(?:\.\/)?(?:iojs|node)-v\d+\.\d+\.\d+-?((rc\.\d+|(?:(next-)?nightly|test|v8-canary)\d{8}[^-.]+)-?)?\.?/, '')
file = file && file.replace(/^(?:\.\/)?(?:iojs|node)-v\d+\.\d+\.\d+-?((rc\.\d+|alpha\.\d+\.\d+\.\d+|(?:(next-)?nightly|test|v8-canary)\d{8}[^-.]+)-?)?\.?/, '')
.replace(/\.tar\.gz$/, '')

return types[file]
Expand Down
6 changes: 5 additions & 1 deletion test/decode-ref.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ const tests = [
{ dir: 'v2.3.1-next-nightly201506308f6f4280c6', ref: 'node/8f6f4280c6' },
{ dir: 'v3.0.0-rc.1', ref: 'node/v3.0.0-rc.1' },
{ dir: 'v33.22.1-rc.111', ref: 'node/v33.22.1-rc.111' },
{ dir: 'v27.0.0-alpha.0.0.0', ref: 'node/v27.0.0-alpha.0.0.0' },
{ dir: 'v27.0.0-alpha.1.10.2', ref: 'node/v27.0.0-alpha.1.10.2' },
{ dir: 'v0.6.1', ref: 'node/v0.6.1' },
{ dir: 'v0.5.1', ref: 'node/v0.5.1' },
{ dir: 'v6.0.0-test20151107093b0e865c', ref: 'node/093b0e865c' },
{ dir: 'v9.0.0-v8-canary20170609cd40078f1f', ref: 'v8-canary/cd40078f1f' }
{ dir: 'v9.0.0-v8-canary20170609cd40078f1f', ref: 'v8-canary/cd40078f1f' },
{ dir: 'v27.0.0-alpha.0.0', ref: null },
{ dir: 'v27.0.0-alpha', ref: null }
]

describe('decodeRef', () => {
Expand Down
15 changes: 15 additions & 0 deletions test/transform-filename.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ const tests = [
{ file: 'iojs-v3.0.0-rc.1.tar.xz' },
{ file: 'iojs-v3.0.0-rc.1-x64.msi', type: 'win-x64-msi' },
{ file: 'iojs-v3.0.0-rc.1-x86.msi', type: 'win-x86-msi' },
{ file: 'node-v27.0.0-alpha.0.0.0-darwin-arm64.tar.gz', type: 'osx-arm64-tar' },
{ file: 'node-v27.0.0-alpha.0.0.0-darwin-arm64.tar.xz' },
{ file: 'node-v27.0.0-alpha.0.0.0-headers.tar.gz', type: 'headers' },
{ file: 'node-v27.0.0-alpha.0.0.0-headers.tar.xz' },
{ file: 'node-v27.0.0-alpha.0.0.0-linux-x64.tar.gz', type: 'linux-x64' },
{ file: 'node-v27.0.0-alpha.0.0.0-linux-x64.tar.xz' },
{ file: 'node-v27.0.0-alpha.0.0.0-linux-arm64.tar.gz', type: 'linux-arm64' },
{ file: 'node-v27.0.0-alpha.0.0.0-linux-arm64.tar.xz' },
{ file: 'node-v27.0.0-alpha.0.0.0.pkg', type: 'osx-x64-pkg' },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might need a follow up as we dropped x64 macOS builds for Node.js 27 so the pkg is no longer universal and instead arm64 only (the test does match what the indexer will map, but we might need to revisit the mapping for 27 while not disturbing the mapping for earlier releases).

{ file: 'node-v27.0.0-alpha.0.0.0.tar.gz', type: 'src' },
{ file: 'node-v27.0.0-alpha.0.0.0.tar.xz' },
{ file: 'node-v27.0.0-alpha.0.0.0-x64.msi', type: 'win-x64-msi' },
{ file: 'node-v27.0.0-alpha.0.0.0-win-x64.zip', type: 'win-x64-zip' },
{ file: 'node-v27.0.0-alpha.0.0.0-win-x64.7z', type: 'win-x64-7z' },
{ file: 'node-v27.0.0-alpha.1.10.2-linux-x64.tar.gz', type: 'linux-x64' },
{ file: 'SHASUMS256.txt' },
{ file: 'win-x64/iojs.exe', type: 'win-x64-exe' },
{ file: 'win-x86/iojs.exe', type: 'win-x86-exe' },
Expand Down
Loading