3 Star 3 Fork 2

Gitee 极速下载/Embark

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
.github
dapps
packages
scripts
check-working-tree.js
check-yarn-lock.js
coverage-collect.js
coverage-collector.js
coverage-report.js
coveralls-branch-name.js
coveralls-pr-id.js
fix-versions.js
globalize.js
monorun.js
nightly-release.js
release.js
stable-release.js
site
.editorconfig
.eslintrc.json
.gitattributes
.gitignore
.npmrc
.yarnrc
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
azure-pipelines.yml
babel.config.js
header.jpg
lerna.json
package.json
tsconfig.base.json
tsconfig.json
tslint.json
yarn.lock
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/embark-framework/embark
克隆/下载
fix-versions.js 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
const { execSync } = require('child_process');
const { writeFileSync } = require('fs');
const { join } = require('path');
const semver = require('semver');
const allPackages = JSON.parse(execSync(
'npx lerna ls --all --json',
{cwd: join(__dirname, '..'), stdio: ['pipe', 'pipe', 'ignore']}
).toString().trim());
const allPackagesDict = {};
allPackages.forEach(pkg => {
pkg.json = require(join(pkg.location, 'package.json'));
allPackagesDict[pkg.name] = pkg;
});
allPackages.forEach(pkg => {
function updateMismatched(depKind, [depName, depRange]) {
const dep = allPackagesDict[depName];
if (dep) {
const depVersion = dep.version;
if (!semver.satisfies(depVersion, depRange)) {
pkg.json[depKind][depName] = `^${depVersion}`;
pkg.updated = true;
console.warn([
`range specifier for ${depName} was set to ^${depVersion} in`,
`${join(pkg.location, 'package.json')} based on "version" in`,
`${join(dep.location, 'package.json')}`
].join(' '));
}
}
}
if (pkg.json.dependencies) {
Object.entries(pkg.json.dependencies).forEach(
updateMismatched.bind({}, 'dependencies')
);
}
if (pkg.json.devDependencies) {
Object.entries(pkg.json.devDependencies).forEach(
updateMismatched.bind({}, 'devDependencies')
);
}
});
let updated;
allPackages.forEach(pkg => {
if (pkg.updated) {
updated = true;
writeFileSync(
join(pkg.location, 'package.json'),
JSON.stringify(pkg.json, null, 2)
);
}
});
if (updated) {
execSync(
'yarn reboot:full && yarn cylock',
{cwd: join(__dirname, '..'), stdio: 'inherit'}
);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/Embark.git
git@gitee.com:mirrors/Embark.git
mirrors
Embark
Embark
master

搜索帮助