GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: npm run setup 和 npm run start 命令适配 win 系统 (#574) · XNEOM/lowcode-engine@ac88114

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • package.json
  • scripts
    • setup.js
    • start.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"pub:premajor": "npm run watchdog:build && lerna publish premajor --force-publish --exact --dist-tag beta --preid beta --no-changelog",
2323
"pub:prepatch": "npm run watchdog:build && lerna publish prepatch --force-publish --exact --dist-tag beta --preid beta --no-changelog",
2424
"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",
2626
"setup:test": "./scripts/setup-for-test.sh",
2727
"setup:skip-build": "./scripts/setup-skip-build.sh",
28-
"start": "./scripts/start.sh",
28+
"start": "node ./scripts/start.js",
2929
"test": "lerna run test --stream",
3030
"test:snapshot": "lerna run test:snapshot",
3131
"watchdog:build": "node ./scripts/watchdog.js",
@@ -38,7 +38,10 @@
3838
}
3939
},
4040
"devDependencies": {
41+
"del": "^6.1.1",
42+
"execa": "^5.1.1",
4143
"f2elint": "^2.0.1",
44+
"gulp": "^4.0.2",
4245
"husky": "^7.0.4",
4346
"lerna": "^4.0.0",
4447
"typescript": "^4.5.5",
Collapse file

‎scripts/setup.js‎

Copy file name to clipboard
+26Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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

‎scripts/start.js‎

Copy file name to clipboard
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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' });

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.