зеркало из https://github.com/microsoft/lage.git
Add types so the lage.config.js can be typed! (#148)
* bump deps and add types as output * bump beachball * Change files * add more ignored stuff * adding more to ignore * lage main should expose types, but bin to use the cli.js instead * let yarn figure out where to find lage * okay use cli instead of index
This commit is contained in:
Родитель
846b3f78f7
Коммит
c8eded2255
|
@ -1,2 +1,7 @@
|
|||
src
|
||||
change
|
||||
scripts
|
||||
decks
|
||||
docs
|
||||
tests
|
||||
.github
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
require("../lib/index.js");
|
||||
require("../lib/cli.js");
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "minor",
|
||||
"comment": "bump deps and add types as output",
|
||||
"packageName": "lage",
|
||||
"email": "kchau@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
},
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"bin": {
|
||||
"lage": "bin/lage.js"
|
||||
},
|
||||
|
@ -29,9 +30,9 @@
|
|||
"watchpack": "1.6.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@microsoft/task-scheduler": "^2.7.0",
|
||||
"@microsoft/task-scheduler": "^2.7.1",
|
||||
"abort-controller": "^3.0.0",
|
||||
"backfill": "^6.1.5",
|
||||
"backfill": "^6.1.6",
|
||||
"backfill-config": "^6.1.3",
|
||||
"backfill-logger": "^5.1.3",
|
||||
"chalk": "^4.0.0",
|
||||
|
@ -41,7 +42,7 @@
|
|||
"git-url-parse": "^11.1.2",
|
||||
"npmlog": "^4.1.2",
|
||||
"p-profiler": "^0.2.1",
|
||||
"workspace-tools": "^0.15.0",
|
||||
"workspace-tools": "^0.16.2",
|
||||
"yargs-parser": "^18.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -55,7 +56,7 @@
|
|||
"@types/npmlog": "^4.1.2",
|
||||
"@types/p-queue": "^3.2.1",
|
||||
"@types/yargs-parser": "^15.0.0",
|
||||
"beachball": "^2.2.0",
|
||||
"beachball": "^2.6.1",
|
||||
"gh-pages": "^2.2.0",
|
||||
"jasmine": "^3.5.0",
|
||||
"renovate": "^23.42.2",
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
import { getConfig } from "./config/getConfig";
|
||||
import { init } from "./command/init";
|
||||
import { run } from "./command/run";
|
||||
import { showHelp } from "./showHelp";
|
||||
import { logger } from "./logger";
|
||||
import { info } from "./command/info";
|
||||
import { initReporters } from "./logger/initReporters";
|
||||
import { version } from "./command/version";
|
||||
import { cache } from "./command/cache";
|
||||
|
||||
// Parse CLI args
|
||||
const cwd = process.cwd();
|
||||
try {
|
||||
const config = getConfig(cwd);
|
||||
const reporters = initReporters(config);
|
||||
|
||||
switch (config.command[0]) {
|
||||
case "cache":
|
||||
cache(cwd, config);
|
||||
break;
|
||||
|
||||
case "init":
|
||||
init(cwd);
|
||||
break;
|
||||
|
||||
case "info":
|
||||
info(cwd, config);
|
||||
break;
|
||||
|
||||
case "version":
|
||||
version();
|
||||
break;
|
||||
|
||||
default:
|
||||
logger.info(`Lage task runner - let's make it`);
|
||||
run(cwd, config, reporters);
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
showHelp(e.message);
|
||||
}
|
42
src/index.ts
42
src/index.ts
|
@ -1,41 +1 @@
|
|||
import { getConfig } from "./config/getConfig";
|
||||
import { init } from "./command/init";
|
||||
import { run } from "./command/run";
|
||||
import { showHelp } from "./showHelp";
|
||||
import { logger } from "./logger";
|
||||
import { info } from "./command/info";
|
||||
import { initReporters } from "./logger/initReporters";
|
||||
import { version } from "./command/version";
|
||||
import { cache } from "./command/cache";
|
||||
|
||||
// Parse CLI args
|
||||
const cwd = process.cwd();
|
||||
try {
|
||||
const config = getConfig(cwd);
|
||||
const reporters = initReporters(config);
|
||||
|
||||
switch (config.command[0]) {
|
||||
case "cache":
|
||||
cache(cwd, config);
|
||||
break;
|
||||
|
||||
case "init":
|
||||
init(cwd);
|
||||
break;
|
||||
|
||||
case "info":
|
||||
info(cwd, config);
|
||||
break;
|
||||
|
||||
case "version":
|
||||
version();
|
||||
break;
|
||||
|
||||
default:
|
||||
logger.info(`Lage task runner - let's make it`);
|
||||
run(cwd, config, reporters);
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
showHelp(e.message);
|
||||
}
|
||||
export type { ConfigOptions } from "./types/ConfigOptions";
|
||||
|
|
|
@ -78,7 +78,7 @@ export class Monorepo {
|
|||
}
|
||||
|
||||
generateRepoFiles() {
|
||||
const lagePath = path.join(this.nodeModulesPath, "lage/lib/index");
|
||||
const lagePath = path.join(this.nodeModulesPath, "lage/lib/cli");
|
||||
|
||||
this.commitFiles({
|
||||
"package.json": {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
"target": "ES2017",
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "Node",
|
||||
"declaration": true,
|
||||
"lib": ["ES2017"],
|
||||
"allowJs": true,
|
||||
"outDir": "./lib",
|
||||
|
|
50
yarn.lock
50
yarn.lock
|
@ -975,7 +975,7 @@
|
|||
markdown-it-front-matter "^0.2.1"
|
||||
postcss "^7.0.32"
|
||||
|
||||
"@microsoft/task-scheduler@^2.7.0":
|
||||
"@microsoft/task-scheduler@^2.7.1":
|
||||
version "2.7.1"
|
||||
resolved "https://registry.yarnpkg.com/@microsoft/task-scheduler/-/task-scheduler-2.7.1.tgz#de2ebe6edb7ed882511051301f0e6f81732d7564"
|
||||
integrity sha512-xSmX7xgLTtf3LwVOW5HCEL4qrSWYCmPsVzpJ7PTBayN0KA9acScgsLYaDE6tE26N//DtDEW6mi4RteWU4XSrjA==
|
||||
|
@ -2263,15 +2263,17 @@ babel-plugin-dynamic-import-node@^2.3.0, babel-plugin-dynamic-import-node@^2.3.3
|
|||
dependencies:
|
||||
object.assign "^4.1.0"
|
||||
|
||||
backfill-cache@^5.2.3:
|
||||
version "5.2.3"
|
||||
resolved "https://registry.yarnpkg.com/backfill-cache/-/backfill-cache-5.2.3.tgz#826d1089f47c2147d1ae2ccb857ce5ee5f38706e"
|
||||
integrity sha512-r5up3vTTgwazit0rd0aBNc2invV6SvftchSB/HZ0rhvcITy/63PNCMiWUKc6exGmm9b6XANfD67/tIh+SfYujA==
|
||||
backfill-cache@^5.2.4:
|
||||
version "5.2.4"
|
||||
resolved "https://registry.yarnpkg.com/backfill-cache/-/backfill-cache-5.2.4.tgz#4354933df98fc878aa38e137dcdcdbe78b5bdf38"
|
||||
integrity sha512-5Kbm8lU1BbImlgVV53fgaxEhHnaKRjWe9KCy47e2VLP7Fy2ZYCiRLD9H7YBYTws1AfDn5QRA/y/3924j6/Cnzg==
|
||||
dependencies:
|
||||
"@azure/storage-blob" "12.1.2"
|
||||
"@rushstack/package-deps-hash" "^2.4.48"
|
||||
backfill-config "^6.1.3"
|
||||
backfill-logger "^5.1.3"
|
||||
execa "^4.0.0"
|
||||
find-up "^5.0.0"
|
||||
fs-extra "^8.1.0"
|
||||
globby "^11.0.0"
|
||||
tar-fs "^2.1.0"
|
||||
|
@ -2315,13 +2317,13 @@ backfill-utils-dotenv@^5.1.1:
|
|||
dotenv "^8.1.0"
|
||||
find-up "^5.0.0"
|
||||
|
||||
backfill@^6.1.5:
|
||||
version "6.1.5"
|
||||
resolved "https://registry.yarnpkg.com/backfill/-/backfill-6.1.5.tgz#02e72fce0a667dfd2ab2360160efb53dca595919"
|
||||
integrity sha512-RT5Y8IzZqB0rdUgVViABZwl8ksi4S5g4bmQcsMKxtL/GHk4XZI+aducWPNXNj8Fn+5umVN/qkRw2XbylaTQXmQ==
|
||||
backfill@^6.1.6:
|
||||
version "6.1.6"
|
||||
resolved "https://registry.yarnpkg.com/backfill/-/backfill-6.1.6.tgz#52e2f8f80b1cd33b5bdb0f18202c11dcb54011e3"
|
||||
integrity sha512-JbYlY6OkWpLFDUdGuiR4vqab/3MCzy9Pi0olN6h2wZFOn87ZG3LjN2ot26CMEezIYTbC+UonjQm/wrU163CyVg==
|
||||
dependencies:
|
||||
anymatch "^3.0.3"
|
||||
backfill-cache "^5.2.3"
|
||||
backfill-cache "^5.2.4"
|
||||
backfill-config "^6.1.3"
|
||||
backfill-hasher "^6.2.4"
|
||||
backfill-logger "^5.1.3"
|
||||
|
@ -2377,10 +2379,10 @@ bcrypt-pbkdf@^1.0.0:
|
|||
dependencies:
|
||||
tweetnacl "^0.14.3"
|
||||
|
||||
beachball@^2.2.0:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/beachball/-/beachball-2.2.0.tgz#5b74cc1a01097a24a4f683f3608368b26f6a2174"
|
||||
integrity sha512-2cell9HViD9navg+txbnOybmL7hbpdZBRcx930Gv/92ZyqAmIr7gHTsyZv90tzkeYvUh+xDZGbEBGddLF1QOUg==
|
||||
beachball@^2.6.1:
|
||||
version "2.6.1"
|
||||
resolved "https://registry.yarnpkg.com/beachball/-/beachball-2.6.1.tgz#0f48a08fbeb965a643c3b5c3c224d08c6d67ce84"
|
||||
integrity sha512-+vUTrIPGpSUVHCl2WbNP9+cOG6UAFlm15Nbvu1onuob0DqqLvCF4nzPTR3ZFFsq+mkbS3NG4iIk8YiYSo+wiIQ==
|
||||
dependencies:
|
||||
cosmiconfig "^6.0.0"
|
||||
execa "^4.0.3"
|
||||
|
@ -2394,7 +2396,7 @@ beachball@^2.2.0:
|
|||
semver "^6.1.1"
|
||||
toposort "^2.0.2"
|
||||
uuid "^8.3.1"
|
||||
workspace-tools "^0.14.0"
|
||||
workspace-tools "^0.16.2"
|
||||
yargs-parser "^20.2.4"
|
||||
|
||||
big.js@^3.1.3:
|
||||
|
@ -12153,10 +12155,10 @@ worker-farm@^1.7.0:
|
|||
dependencies:
|
||||
errno "~0.1.7"
|
||||
|
||||
workspace-tools@^0.14.0:
|
||||
version "0.14.1"
|
||||
resolved "https://registry.yarnpkg.com/workspace-tools/-/workspace-tools-0.14.1.tgz#db65c5e01d93021520634a0f4501b95457a9a436"
|
||||
integrity sha512-39eUegRij7gXmlxo9S/x8p1Bv5MDjCJmj/1ERwD8epQM5DM3kWZFJhpuq9m5kcL1qT6ny02GgRbIyr4whsX+kQ==
|
||||
workspace-tools@^0.15.0:
|
||||
version "0.15.0"
|
||||
resolved "https://registry.yarnpkg.com/workspace-tools/-/workspace-tools-0.15.0.tgz#8710f6151b21ab4382a5230d752e8b822ea24d16"
|
||||
integrity sha512-KYSEKdqRJC3moABdCho03nSK4H9oqb6KtvGusGi5giR5oV1LilCRqem7STLRsZlnTJVTATv4nHnnioB+wSleDA==
|
||||
dependencies:
|
||||
"@pnpm/lockfile-file" "^3.0.7"
|
||||
"@pnpm/logger" "^3.2.2"
|
||||
|
@ -12170,13 +12172,11 @@ workspace-tools@^0.14.0:
|
|||
multimatch "^4.0.0"
|
||||
read-yaml-file "^2.0.0"
|
||||
|
||||
workspace-tools@^0.15.0:
|
||||
version "0.15.0"
|
||||
resolved "https://registry.yarnpkg.com/workspace-tools/-/workspace-tools-0.15.0.tgz#8710f6151b21ab4382a5230d752e8b822ea24d16"
|
||||
integrity sha512-KYSEKdqRJC3moABdCho03nSK4H9oqb6KtvGusGi5giR5oV1LilCRqem7STLRsZlnTJVTATv4nHnnioB+wSleDA==
|
||||
workspace-tools@^0.16.2:
|
||||
version "0.16.2"
|
||||
resolved "https://registry.yarnpkg.com/workspace-tools/-/workspace-tools-0.16.2.tgz#b7355c811dcda648d12e92ceb89f8fccacca3901"
|
||||
integrity sha512-Z/NHo4t39DUd50MdWiPfxICyVaCjWZc/xwZxE4a/n2nAQGgeYeg6GWBY1juULPi/BGSrjSVaDQfDCj/Y80033A==
|
||||
dependencies:
|
||||
"@pnpm/lockfile-file" "^3.0.7"
|
||||
"@pnpm/logger" "^3.2.2"
|
||||
"@yarnpkg/lockfile" "^1.1.0"
|
||||
find-up "^4.1.0"
|
||||
find-yarn-workspace-root "^1.2.1"
|
||||
|
|
Загрузка…
Ссылка в новой задаче