Skip to content

Commit 0499545

Browse files
committed
v1.0.0: make it so
0 parents  commit 0499545

File tree

10 files changed

+922
-0
lines changed

10 files changed

+922
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Contributing to nodejs-dist-indexer
2+
3+
## Code Contributions
4+
5+
The nodejs-dist-indexer project is managed under the governance of the
6+
[Build Working Group](https://github.com/nodejs/build).
7+
8+
## Developer's Certificate of Origin 1.1
9+
10+
By making a contribution to this project, I certify that:
11+
12+
* (a) The contribution was created in whole or in part by me and I
13+
have the right to submit it under the open source license
14+
indicated in the file; or
15+
16+
* (b) The contribution is based upon previous work that, to the best
17+
of my knowledge, is covered under an appropriate open source
18+
license and I have the right under that license to submit that
19+
work with modifications, whether created in whole or in part
20+
by me, under the same open source license (unless I am
21+
permitted to submit under a different license), as indicated
22+
in the file; or
23+
24+
* (c) The contribution was provided directly to me by some other
25+
person who certified (a), (b) or (c) and I have not modified
26+
it.
27+
28+
* (d) I understand and agree that this project and the contribution
29+
are public and that a record of the contribution (including all
30+
personal information I submit with it, including my sign-off) is
31+
maintained indefinitely and may be redistributed consistent with
32+
this project or the open source license(s) involved.
33+

GOVERNANCE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Governance
2+
3+
The nodejs-dist-indexer project is managed under the governance of the
4+
[Build Working Group](https://github.com/nodejs/build).

LICENSE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
The MIT License (MIT)
2+
=====================
3+
4+
Copyright (c) 2016 Node.js Foundation
5+
-------------------------------------
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
9+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# nodejs-dist-indexer
2+
3+
**An application to create [nodejs.org](https://nodejs.org) distribution index files: index.json and index.tab**
4+
5+
Output can be seen at:
6+
7+
* https://nodejs.org/download/release/index.tab
8+
* https://nodejs.org/download/release/index.json
9+
* https://iojs.org/download/release/index.tab
10+
* https://iojs.org/download/release/index.json
11+
12+
And all subdirectories of https://nodejs.org/download/ and https://iojs.org/download/ containing downloadable tarballs and installers.
13+
14+
## Data
15+
16+
For the purpose of cataloguing files within each versioned subdirectory, nodejs-dist-indexer is able to:
17+
18+
* Determine the specific version of each directory (just the directory name!)
19+
* Determine the date the distributables were built
20+
* Decode filenames to determine the OS / architecture / packaging available
21+
* Determine the version of dependencies bundled with Node.js, including:
22+
- npm
23+
- V8
24+
- libuv
25+
- zlib
26+
- OpenSSL
27+
* Determine the `NODE_MODULES_VERSION` for compiled add-on compatibility
28+
* Determine whether the version is an LTS or not
29+
30+
All of this data is made available in JSON and tab-separated format.
31+
32+
OS / architecture / packaging specifiers used in the listings include:
33+
34+
* **aix-ppc64**: normally .tar.gz and .tar.xz
35+
* **headers**: normally .tar.gz and .tar.xz, downloaded by [node-gyp](https://github.com/nodejs/node-gyp/)
36+
* **linux-arm64**: normally .tar.gz and .tar.xz (also known as AArch64 or ARMv8)
37+
* **linux-armv6l**: normally .tar.gz and .tar.xz
38+
* **linux-armv7l**: normally .tar.gz and .tar.xz
39+
* **linux-ppc64le**: normally .tar.gz and .tar.xz
40+
* **linux-x64**: normally .tar.gz and .tar.xz
41+
* **linux-x86**: normally .tar.gz and .tar.xz
42+
* **osx-x64-pkg**: OSX .pkg installer (64-bit only since io.js v1)
43+
* **osx-x64-tar**: normally .tar.gz and .tar.xz
44+
* **src**: normally .tar.gz and .tar.xz, full source used to build the distribution
45+
* **sunos-x64**: normally .tar.gz and .tar.xz
46+
* **sunos-x86**: normally .tar.gz and .tar.xz
47+
* **win-x64-msi**: Windows 64-bit .msi installer
48+
* **win-x86-msi**: Windows 32-bit .msi installer
49+
* **win-x64-exe**: Windows 64-bit bare node.exe, within a win-x64 directory
50+
* **win-x86-exe**: Windows 32-bit bare node.exe, within a win-x86 directory
51+
52+
## Usage:
53+
54+
Create an index.json and index.tab from a given distribution directory that contains subdirectories that contain distributable files:
55+
56+
```text
57+
nodejs-dist-indexer \
58+
--dist /path/to/dist/directory/
59+
--indexjson /path/to/dist/directory/index.json
60+
--indextab /path/to/dist/directory/index.tab
61+
```
62+
63+
List the type of distributable files contained within given directories:
64+
65+
```text
66+
nodejs-ls-types [-d] <directory>[ <directory> [<directory> ...]]
67+
```
68+
69+
The `-d` argument is supplied if it is to only count files that have a corresponding `.done` file; this is used for promoting staged releases where the `.done` file indicates that an upload from a build server is complete.
70+
71+
Output looks like:
72+
73+
```text
74+
$ nodejs-ls-types latest*
75+
latest: aix-ppc64 headers linux-arm64 linux-armv6l linux-armv7l linux-ppc64le linux-x64 linux-x86 osx-x64-pkg osx-x64-tar src sunos-x64 sunos-x86 win-x64-msi win-x86-msi
76+
latest-argon: headers linux-arm64 linux-armv6l linux-armv7l linux-ppc64le linux-x64 linux-x86 osx-x64-pkg osx-x64-tar src sunos-x64 sunos-x86 win-x64-msi win-x86-msi
77+
latest-v0.10.x: headers linux-x64 linux-x86 osx-x64-pkg osx-x64-tar osx-x86-tar src sunos-x64 sunos-x86 win-x86-exe win-x86-msi
78+
latest-v0.12.x: headers linux-x64 linux-x86 osx-x64-pkg osx-x64-tar osx-x86-tar src sunos-x64 sunos-x86 win-x86-exe win-x86-msi
79+
latest-v4.x: headers linux-arm64 linux-armv6l linux-armv7l linux-ppc64le linux-x64 linux-x86 osx-x64-pkg osx-x64-tar src sunos-x64 sunos-x86 win-x64-msi win-x86-msi
80+
latest-v5.x: headers linux-arm64 linux-armv6l linux-armv7l linux-ppc64le linux-x64 linux-x86 osx-x64-pkg osx-x64-tar src sunos-x64 sunos-x86 win-x64-msi win-x86-msi
81+
latest-v6.x: aix-ppc64 headers linux-arm64 linux-armv6l linux-armv7l linux-ppc64le linux-x64 linux-x86 osx-x64-pkg osx-x64-tar src sunos-x64 sunos-x86 win-x64-msi win-x86-msi
82+
```
83+
84+
-----------------------------------
85+
86+
Managed under the governance of the Node.js [Build Working Group](https://github.com/nodejs/build).
87+
88+
Copyright (c) 2016 Node.js Foundation. All rights reserved.
89+
90+
Licensed under MIT, see the LICENSE.md file for details

decode-ref.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const assert = require('assert')
2+
, dirre = /^(v\d+\.\d+\.\d+(?:-rc\.\d+)?)(?:-(?:(?:next-)?nightly|test)\d{8}(\w+))?$/ // get version or commit from dir name
3+
4+
5+
function decodeRef (dir) {
6+
var m = dir.match(dirre)
7+
return m && (m[2] || m[1])
8+
}
9+
10+
11+
module.exports = decodeRef
12+
13+
14+
if (module === require.main) {
15+
var tests = [
16+
{ dir: 'v1.0.0' , ref: 'v1.0.0' }
17+
, { dir: 'v10.11.12' , ref: 'v10.11.12' }
18+
, { dir: 'v2.3.2-nightly20150625dcbb9e1da6' , ref: 'dcbb9e1da6' }
19+
, { dir: 'v2.3.1-next-nightly201506308f6f4280c6' , ref: '8f6f4280c6' }
20+
, { dir: 'v3.0.0-rc.1' , ref: 'v3.0.0-rc.1' }
21+
, { dir: 'v33.22.1-rc.111' , ref: 'v33.22.1-rc.111' }
22+
, { dir: 'v0.6.1' , ref: 'v0.6.1' }
23+
, { dir: 'v0.5.1' , ref: 'v0.5.1' }
24+
, { dir: 'v6.0.0-test20151107093b0e865c' , ref: '093b0e865c' }
25+
]
26+
27+
tests.forEach(function (test) {
28+
console.log(`testing ${test.dir} -> ${test.ref}`)
29+
assert.equal(decodeRef(test.dir), test.ref)
30+
})
31+
}

0 commit comments

Comments
 (0)