GeezerVison is showing github.com — chore: npm run setup 和 npm run start 命令适配 win 系统 (#574) · poundhu/lowcode-engine@ac88114
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: package.json +5-2Lines changed: 5 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 22 | 22 | "pub:premajor": "npm run watchdog:build && lerna publish premajor --force-publish --exact --dist-tag beta --preid beta --no-changelog", | 23 | 23 | "pub:prepatch": "npm run watchdog:build && lerna publish prepatch --force-publish --exact --dist-tag beta --preid beta --no-changelog", | 24 | 24 | "pub:prerelease": "npm run watchdog:build && lerna publish prerelease --force-publish --exact --dist-tag beta --preid beta --no-changelog", | 25 | | - "setup": "./scripts/setup.sh", | | 25 | + "setup": "node ./scripts/setup.js", | 26 | 26 | "setup:test": "./scripts/setup-for-test.sh", | 27 | 27 | "setup:skip-build": "./scripts/setup-skip-build.sh", | 28 | | - "start": "./scripts/start.sh", | | 28 | + "start": "node ./scripts/start.js", | 29 | 29 | "test": "lerna run test --stream", | 30 | 30 | "test:snapshot": "lerna run test:snapshot", | 31 | 31 | "watchdog:build": "node ./scripts/watchdog.js", | | 38 | 38 | } | 39 | 39 | }, | 40 | 40 | "devDependencies": { | | 41 | + "del": "^6.1.1", | | 42 | + "execa": "^5.1.1", | 41 | 43 | "f2elint": "^2.0.1", | | 44 | + "gulp": "^4.0.2", | 42 | 45 | "husky": "^7.0.4", | 43 | 46 | "lerna": "^4.0.0", | 44 | 47 | "typescript": "^4.5.5", | |
Collapse file Copy file name to clipboard +26Lines changed: 26 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +#!/usr/bin/env node | | 2 | +const os = require('os'); | | 3 | +const del = require('del'); | | 4 | +const gulp = require('gulp'); | | 5 | +const execa = require('execa'); | | 6 | + | | 7 | +async function deleteRootDirLockFile() { | | 8 | + await del('package-lock.json'); | | 9 | + await del('yarn.lock'); | | 10 | +} | | 11 | + | | 12 | +async function clean() { | | 13 | + await execa.command('lerna clean -y', { stdio: 'inherit', encoding: 'utf-8' }); | | 14 | +} | | 15 | + | | 16 | +async function deletePackagesDirLockFile() { | | 17 | + await del('packages/**/package-lock.json'); | | 18 | +} | | 19 | + | | 20 | +async function bootstrap() { | | 21 | + await execa.command('lerna bootstrap --force-local', { stdio: 'inherit', encoding: 'utf-8' }); | | 22 | +} | | 23 | + | | 24 | +const setup = gulp.series(deleteRootDirLockFile, clean, deletePackagesDirLockFile, bootstrap); | | 25 | + | | 26 | +os.type() === 'Windows_NT' ? setup() : execa.command('scripts/setup.sh', { stdio: 'inherit', encoding: 'utf-8' }); |
Collapse file Copy file name to clipboard +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +#!/usr/bin/env node | | 2 | +const os = require('os'); | | 3 | +const execa = require('execa'); | | 4 | + | | 5 | +async function start() { | | 6 | + const [, , pkgName = '@alilc/lowcode-ignitor'] = process.argv; | | 7 | + await execa.command(`lerna exec --scope ${pkgName} -- npm start`, { stdio: 'inherit', encoding: 'utf-8' }); | | 8 | +} | | 9 | + | | 10 | +os.type() === 'Windows_NT' ? start() : execa.command('scripts/start.sh', { stdio: 'inherit', encoding: 'utf-8' }); |
|