Skip to content

Commit caa0706

Browse files
authored
feat: support override scripts config (#185)
Follow npm/rfcs#488
1 parent 0f335a1 commit caa0706

File tree

2 files changed

+41
-26
lines changed

2 files changed

+41
-26
lines changed

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,13 @@
890890
"5.3.4": {
891891
"version": "5.3.3",
892892
"reason": "https://github.com/styled-components/styled-components/issues/3706"
893+
},
894+
"5.3.5": {
895+
"version": "5.3.5",
896+
"scripts": {
897+
"postinstall": ""
898+
},
899+
"reason": "https://github.com/styled-components/styled-components/commit/ba9d732ca7da53f2a095e35450ecffd592c6f5ba"
893900
}
894901
}
895902
}
@@ -902,6 +909,7 @@
902909
"find-duplicated-property-keys": "^1.2.7",
903910
"git-contributor": "^1.0.10",
904911
"husky": "^4.2.5",
912+
"node-core-test": "^1.1.0",
905913
"semantic-release": "^17.3.9"
906914
},
907915
"ci": {

test.js

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,42 @@
11
'use strict';
22

33
const assert = require('assert');
4+
const test = require('node-core-test')
45
const bugVersions = require('.');
56

6-
let pkgCount = 0;
7-
let versionCount = 0;
8-
for (const name in bugVersions) {
9-
pkgCount++;
10-
const versions = bugVersions[name];
11-
assert(versions);
12-
for (const version in versions) {
13-
versionCount++;
14-
const item = versions[version];
15-
assert(item);
16-
assert(item.version || item.dependencies);
17-
if (item.version) {
18-
assert(typeof item.version === 'string');
19-
} else if (item.dependencies) {
20-
assert(typeof item.dependencies === 'object');
21-
assert(Object.keys(item.dependencies).length > 0);
22-
}
7+
test('should get bug-versions', () => {
8+
let pkgCount = 0;
9+
let versionCount = 0;
10+
for (const name in bugVersions) {
11+
pkgCount++;
12+
const versions = bugVersions[name];
13+
assert(versions);
14+
for (const version in versions) {
15+
versionCount++;
16+
const item = versions[version];
17+
assert(item);
18+
assert(item.version || item.dependencies);
19+
if (item.version) {
20+
assert(typeof item.version === 'string');
21+
} else if (item.dependencies) {
22+
assert(typeof item.dependencies === 'object');
23+
assert(Object.keys(item.dependencies).length > 0);
24+
}
2325

24-
assert(item.reason)
25-
assert(typeof item.reason === 'string');
26+
assert(item.reason)
27+
assert(typeof item.reason === 'string');
28+
}
2629
}
27-
}
2830

29-
console.log('Total: %d bug pkgs and %d bug versions', pkgCount, versionCount);
30-
console.log('');
31+
console.log('Total: %d bug pkgs and %d bug versions', pkgCount, versionCount);
32+
assert(pkgCount > 0);
33+
assert(versionCount > 0);
34+
});
3135

32-
const pkg = require('./package');
33-
console.log('unsafe-node-versions: %s', JSON.stringify(pkg.config['unsafe-node-versions'], null, 2));
34-
console.log('');
35-
console.log('unsafe-alinode-versions: %s', JSON.stringify(pkg.config['unsafe-alinode-versions'], null, 2));
36+
test('should get "config" field from package.json', () => {
37+
const pkg = require('./package');
38+
assert(pkg.config['unsafe-node-versions']);
39+
// console.log('unsafe-node-versions: %s', JSON.stringify(pkg.config['unsafe-node-versions'], null, 2));
40+
assert(pkg.config['unsafe-alinode-versions']);
41+
// console.log('unsafe-alinode-versions: %s', JSON.stringify(pkg.config['unsafe-alinode-versions'], null, 2));
42+
});

0 commit comments

Comments
 (0)