Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support override scripts config #185

Merged
merged 1 commit into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,13 @@
"5.3.4": {
"version": "5.3.3",
"reason": "https://github.com/styled-components/styled-components/issues/3706"
},
"5.3.5": {
"version": "5.3.5",
"scripts": {
"postinstall": ""
},
"reason": "https://github.com/styled-components/styled-components/commit/ba9d732ca7da53f2a095e35450ecffd592c6f5ba"
}
}
}
Expand All @@ -902,6 +909,7 @@
"find-duplicated-property-keys": "^1.2.7",
"git-contributor": "^1.0.10",
"husky": "^4.2.5",
"node-core-test": "^1.1.0",
"semantic-release": "^17.3.9"
},
"ci": {
Expand Down
59 changes: 33 additions & 26 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
'use strict';

const assert = require('assert');
const test = require('node-core-test')
const bugVersions = require('.');

let pkgCount = 0;
let versionCount = 0;
for (const name in bugVersions) {
pkgCount++;
const versions = bugVersions[name];
assert(versions);
for (const version in versions) {
versionCount++;
const item = versions[version];
assert(item);
assert(item.version || item.dependencies);
if (item.version) {
assert(typeof item.version === 'string');
} else if (item.dependencies) {
assert(typeof item.dependencies === 'object');
assert(Object.keys(item.dependencies).length > 0);
}
test('should get bug-versions', () => {
let pkgCount = 0;
let versionCount = 0;
for (const name in bugVersions) {
pkgCount++;
const versions = bugVersions[name];
assert(versions);
for (const version in versions) {
versionCount++;
const item = versions[version];
assert(item);
assert(item.version || item.dependencies);
if (item.version) {
assert(typeof item.version === 'string');
} else if (item.dependencies) {
assert(typeof item.dependencies === 'object');
assert(Object.keys(item.dependencies).length > 0);
}

assert(item.reason)
assert(typeof item.reason === 'string');
assert(item.reason)
assert(typeof item.reason === 'string');
}
}
}

console.log('Total: %d bug pkgs and %d bug versions', pkgCount, versionCount);
console.log('');
console.log('Total: %d bug pkgs and %d bug versions', pkgCount, versionCount);
assert(pkgCount > 0);
assert(versionCount > 0);
});

const pkg = require('./package');
console.log('unsafe-node-versions: %s', JSON.stringify(pkg.config['unsafe-node-versions'], null, 2));
console.log('');
console.log('unsafe-alinode-versions: %s', JSON.stringify(pkg.config['unsafe-alinode-versions'], null, 2));
test('should get "config" field from package.json', () => {
const pkg = require('./package');
assert(pkg.config['unsafe-node-versions']);
// console.log('unsafe-node-versions: %s', JSON.stringify(pkg.config['unsafe-node-versions'], null, 2));
assert(pkg.config['unsafe-alinode-versions']);
// console.log('unsafe-alinode-versions: %s', JSON.stringify(pkg.config['unsafe-alinode-versions'], null, 2));
});