From b860992e35990f383740b07be558125c97faa055 Mon Sep 17 00:00:00 2001 From: Roy Razon Date: Mon, 27 Nov 2023 09:40:57 +0200 Subject: [PATCH] publish patched @oclif/core --- package.json | 9 ++++++--- packages/cli/package.json | 5 +++-- .../cli/patches}/@oclif+core+3.12.0.patch | 0 packages/cli/scripts/validate-tsconfig | 14 ++++++++++++++ packages/cli/tsconfig.json | 4 ++-- packages/cli/validate-tsconfig.js | 0 6 files changed, 25 insertions(+), 7 deletions(-) rename {patches => packages/cli/patches}/@oclif+core+3.12.0.patch (100%) create mode 100755 packages/cli/scripts/validate-tsconfig create mode 100644 packages/cli/validate-tsconfig.js diff --git a/package.json b/package.json index 2287254d..e2ba8ce7 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,11 @@ { "private": true, - "workspaces": [ - "packages/*" - ], + "workspaces": { + "packages": [ + "packages/*" + ], + "nohoist": ["**/@oclif/core"] + }, "devDependencies": { "husky": "^8.0.0", "lerna": "^6.6.2", diff --git a/packages/cli/package.json b/packages/cli/package.json index 531d0cd6..d0c2883a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -102,9 +102,10 @@ "lint": "eslint . --ext .ts --cache", "postpack": "shx rm -f oclif.manifest.json", "posttest": "yarn lint", - "prepack": "yarn build && oclif manifest && oclif readme --dir docs --multi && ./scripts/prepare_and_copy_docs.sh", + "prepack": "yarn build && ./scripts/validate-tsconfig && oclif manifest && oclif readme --dir docs --multi && ./scripts/prepare_and_copy_docs.sh", "cli": "./bin/dev", - "version": "oclif readme && git add README.md" + "version": "oclif readme && git add README.md", + "postinstall": "npx patch-package" }, "engines": { "node": ">=18.0.0" diff --git a/patches/@oclif+core+3.12.0.patch b/packages/cli/patches/@oclif+core+3.12.0.patch similarity index 100% rename from patches/@oclif+core+3.12.0.patch rename to packages/cli/patches/@oclif+core+3.12.0.patch diff --git a/packages/cli/scripts/validate-tsconfig b/packages/cli/scripts/validate-tsconfig new file mode 100755 index 00000000..507b6b0d --- /dev/null +++ b/packages/cli/scripts/validate-tsconfig @@ -0,0 +1,14 @@ +#!/usr/bin/env node +const path = require('path') +const util = require('util') +const fs = require('fs') + +const tsConfig = path.join(__dirname, '..', './tsconfig.json') + +try { + JSON.parse(fs.readFileSync('./tsconfig.json')) +} catch (e) { + console.error('Error parsing %s: oclif expects valid JSON: %j', tsConfig, util.inspect(e)) + process.exit(1) +} + diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 6a6122df..9712537f 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -10,7 +10,7 @@ "lib": ["es2022"], "esModuleInterop": true, "sourceMap": true, - "baseUrl": ".", + "baseUrl": "." }, "include": [ "src/**/*" @@ -25,6 +25,6 @@ { "path": "../driver-gce" }, { "path": "../driver-azure" }, { "path": "../driver-kube-pod" }, - { "path": "../plugin-github" }, + { "path": "../plugin-github" } ] } diff --git a/packages/cli/validate-tsconfig.js b/packages/cli/validate-tsconfig.js new file mode 100644 index 00000000..e69de29b