Skip to content

Commit

Permalink
Update to oclif/core (#263)
Browse files Browse the repository at this point in the history
* feat: update to oclif/core

* fix: remove unneeded code

* fix: unit test & remove more unnecessary stuff

* chore: update build image

* fix: remove topicSeparator

* chore: update to sf-cli standard CI

* chore: don't export oclif help

* fix: unit test

* chore: update oclif/test dep and ci

* chore: fix ci again...
  • Loading branch information
RodEsp committed Aug 6, 2021
1 parent 095b4b4 commit 0b2c0e7
Show file tree
Hide file tree
Showing 26 changed files with 540 additions and 3,086 deletions.
85 changes: 26 additions & 59 deletions .circleci/config.yml
@@ -1,65 +1,32 @@
---
version: 2
jobs:
node-latest: &test
docker:
- image: node:latest
working_directory: ~/cli
steps:
- checkout
- restore_cache: &restore_cache
keys:
- v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
- v1-npm-{{checksum ".circleci/config.yml"}}
- run:
name: Install dependencies
command: yarn
- run:
name: Run tests
command: yarn test
node-12:
<<: *test
docker:
- image: node:12
node-10:
<<: *test
docker:
- image: node:10
release:
<<: *test
steps:
- add_ssh_keys
- checkout
- restore_cache: *restore_cache
- run:
name: Install release dependencies
command: |
yarn global add @oclif/semantic-release@3 semantic-release@17
yarn --frozen-lockfile
- run:
name: Cut release
command: |
export PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH
semantic-release -e @oclif/semantic-release
- save_cache:
key: v1-yarn-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
paths:
- ~/cli/node_modules
- /usr/local/share/.cache/yarn
- /usr/local/share/.config/yarn
version: 2.1

orbs:
release-management: salesforce/npm-release-management@4

workflows:
version: 2
"@oclif/plugin-help":
test-and-release:
jobs:
- node-latest
- node-12
- node-10
- release:
context: org-global
- release-management/test-package:
matrix:
parameters:
os:
- linux
# - windows
node_version:
- latest
- lts
- maintenance
exclude:
- os: windows
node_version: lts
- os: windows
node_version: maintenance
- release-management/release-package:
context: SF-CLI-RELEASE-PROCESS
filters:
branches: {only: master}
branches:
only: main
github-release: true
requires:
- node-latest
- node-12
- node-10
- release-management/test-package
15 changes: 15 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229,
"skipFiles": ["<node_internals>/**"]
},
]
}
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
@oclif/plugin-help
===================

standard help for oclif
A CLI command to invoke the standard help functionality from [oclif/core](https://github.com/oclif/core).

[![Version](https://img.shields.io/npm/v/@oclif/plugin-help.svg)](https://npmjs.org/package/@oclif/plugin-help)
[![CircleCI](https://circleci.com/gh/oclif/plugin-help/tree/master.svg?style=svg)](https://circleci.com/gh/oclif/plugin-help/tree/master)
Expand Down
19 changes: 19 additions & 0 deletions bin/dev
@@ -0,0 +1,19 @@
#!/usr/bin/env node

const oclif = require('@oclif/core');

const path = require('path');
const project = path.join(__dirname, '..', 'tsconfig.json');

// In dev mode -> use ts-node and dev plugins
process.env.NODE_ENV = 'development';

require('ts-node').register({ project });
// oclif.settings.tsconfigPath = project;

// In dev mode, always show stack traces
// Waiting for https://github.com/oclif/core/pull/147
// oclif.settings.debug = true;

// Start the CLI
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));
3 changes: 3 additions & 0 deletions bin/dev.cmd
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\dev" %*
5 changes: 3 additions & 2 deletions bin/run
@@ -1,4 +1,5 @@
#!/usr/bin/env node

require('@oclif/command').run()
.catch(require('@oclif/errors/handle'))
require('@oclif/core').run()
.then(require('@oclif/core/flush'))
.catch(require('@oclif/core/handle'))
38 changes: 10 additions & 28 deletions package.json
Expand Up @@ -5,36 +5,19 @@
"author": "Jeff Dickey @jdxcode",
"bugs": "https://github.com/oclif/plugin-help/issues",
"dependencies": {
"@oclif/command": "^1.5.20",
"@oclif/config": "^1.15.1",
"@oclif/errors": "^1.2.2",
"chalk": "^4.1.0",
"indent-string": "^4.0.0",
"lodash.template": "^4.4.0",
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"widest-line": "^3.1.0",
"wrap-ansi": "^4.0.0"
"@oclif/core": "^0.5.28"
},
"devDependencies": {
"@oclif/dev-cli": "^1.21.0",
"@oclif/plugin-legacy": "^1.1.3",
"@oclif/plugin-plugins": "^1.7.6",
"@oclif/test": "^1.2.2",
"@oclif/test": "core-v1",
"@types/chai": "^4.1.7",
"@types/lodash.template": "^4.4.4",
"@types/mocha": "^8.0.0",
"@types/node": "^14.0.14",
"@types/strip-ansi": "^5.2.1",
"@types/wrap-ansi": "^3.0.0",
"chai": "^4.2.0",
"eslint": "^7.3.1",
"eslint-config-oclif": "^3.1.0",
"eslint-config-oclif-typescript": "^0.2.0",
"globby": "^11.0.1",
"mocha": "^8.2.1",
"nock": "^13.0.0",
"sinon": "^10.0.0",
"shx": "^0.3.3",
"ts-node": "^9.1.1",
"typescript": "3.8.3"
},
Expand All @@ -50,24 +33,23 @@
"oclif-plugin"
],
"license": "MIT",
"main": "./lib/index.js",
"main": "./lib/help.js",
"oclif": {
"commands": "./lib/commands",
"commands": "./lib",
"bin": "oclif",
"devPlugins": [
"@oclif/plugin-plugins",
"@oclif/plugin-legacy"
"@oclif/plugin-plugins"
]
},
"repository": "oclif/plugin-help",
"scripts": {
"build": "rm -rf lib && tsc",
"build": "shx rm -rf lib && tsc",
"lint": "eslint . --ext .ts --config .eslintrc",
"pretest": "yarn build --noEmit && tsc -p test --noEmit",
"pretest": "yarn build && tsc -p test --noEmit",
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
"posttest": "yarn lint",
"prepack": "yarn run build && oclif-dev manifest",
"postpack": "rm oclif.manifest.json"
"postpack": "shx rm oclif.manifest.json"
},
"types": "./lib/index.d.ts"
"types": "./lib/help.d.ts"
}
20 changes: 0 additions & 20 deletions src/_test-help-class.ts

This file was deleted.

0 comments on commit 0b2c0e7

Please sign in to comment.