Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3 #767

Merged
merged 57 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
7a6533e
chore: v3 prerelease branch
mdonnalley Aug 21, 2023
80915eb
chore(release): 3.0.0-beta.1 [skip ci]
svc-cli-bot Aug 21, 2023
b9c2da4
feat: ESM support (#759)
mdonnalley Aug 31, 2023
c4d3c57
chore(release): 3.0.0-beta.2 [skip ci]
svc-cli-bot Aug 31, 2023
6affd92
More v3 features (#772)
mdonnalley Aug 31, 2023
1eddb3f
Merge branch 'main' into prerelease/v3
mdonnalley Aug 31, 2023
e5a9d53
chore(release): 3.0.0-beta.3 [skip ci]
svc-cli-bot Aug 31, 2023
b99ff3a
chore(release): 3.0.0-beta.4 [skip ci]
svc-cli-bot Aug 31, 2023
6254f9c
fix: add main to package.json
mdonnalley Aug 31, 2023
e176286
chore(release): 3.0.0-beta.5 [skip ci]
svc-cli-bot Aug 31, 2023
dcb264b
fix: export CustomOptions
mdonnalley Aug 31, 2023
a8b9f1e
chore(release): 3.0.0-beta.6 [skip ci]
svc-cli-bot Aug 31, 2023
e798bcd
fix: interface exports
mdonnalley Aug 31, 2023
da49a7a
chore(release): 3.0.0-beta.7 [skip ci]
svc-cli-bot Aug 31, 2023
979cf86
feat: remove ux and interfaces export
mdonnalley Aug 31, 2023
1f015df
chore(release): 3.0.0-beta.8 [skip ci]
svc-cli-bot Aug 31, 2023
84c9718
fix: revert ux changes
mdonnalley Aug 31, 2023
648a025
chore(release): 3.0.0-beta.9 [skip ci]
svc-cli-bot Aug 31, 2023
27fd3f1
feat: revert exports changes (#776)
mdonnalley Sep 1, 2023
ba0ccd8
chore(release): 3.0.0-beta.10 [skip ci]
svc-cli-bot Sep 1, 2023
cec0ef2
fix: revert styledJSON change
mdonnalley Sep 1, 2023
30acd47
chore(release): 3.0.0-beta.11 [skip ci]
svc-cli-bot Sep 1, 2023
429d42f
Merge branch 'main' into prerelease/v3
mdonnalley Sep 1, 2023
96ca180
fix: update imports in Config
mdonnalley Sep 1, 2023
660ec2c
chore(release): 3.0.0-beta.12 [skip ci]
svc-cli-bot Sep 1, 2023
299df21
feat: skip ts-node register for ESM plugins (#778)
mdonnalley Sep 6, 2023
c1423d5
chore(release): 3.0.0-beta.13 [skip ci]
svc-cli-bot Sep 6, 2023
bd2461b
feat: final v3 features (#779)
mdonnalley Sep 22, 2023
090f675
chore(release): 3.0.0-beta.14 [skip ci]
svc-cli-bot Sep 22, 2023
878da23
fix: allow undefined from flag parser
mdonnalley Sep 22, 2023
29cdf73
chore(release): 3.0.0-beta.15 [skip ci]
svc-cli-bot Sep 22, 2023
7103fa5
feat: set spinner style
mdonnalley Sep 22, 2023
8413a86
chore(release): 3.0.0-beta.16 [skip ci]
svc-cli-bot Sep 22, 2023
e1632db
test: unset config vars after setting them
mdonnalley Sep 22, 2023
a4cb2cb
feat: remove ts-node (#794)
mdonnalley Sep 25, 2023
6702a53
chore(release): 3.0.0-beta.17 [skip ci]
svc-cli-bot Sep 25, 2023
2a3b084
fix: use ES2022 (#793)
mdonnalley Sep 28, 2023
b38f222
chore(release): 3.0.0-beta.18 [skip ci]
svc-cli-bot Sep 28, 2023
2a8770b
chore: use prettier and lint-staged (#798)
mdonnalley Sep 29, 2023
99f9ea2
fix: update util import
mdonnalley Sep 29, 2023
5bc68f3
chore(release): 3.0.0-beta.19 [skip ci]
svc-cli-bot Sep 29, 2023
5c9eeac
chore: remove util/index.ts (#802)
mdonnalley Oct 2, 2023
60f1e30
fix: remove tsPath export
mdonnalley Oct 2, 2023
6696ff1
fix: move @types/cli-progress to devDeps
mdonnalley Oct 2, 2023
3468f18
chore(release): 3.0.0-beta.20 [skip ci]
svc-cli-bot Oct 2, 2023
fd0ca86
fix: force release
mdonnalley Oct 2, 2023
c970ad7
chore(release): 3.0.0-beta.21 [skip ci]
svc-cli-bot Oct 2, 2023
2848e26
fix: move styledJson to index
mdonnalley Oct 2, 2023
c696a24
chore(release): 3.0.0-beta.22 [skip ci]
svc-cli-bot Oct 2, 2023
2076445
feat: collect perf results from outside oclif (#797)
mshanemc Oct 2, 2023
892bf4b
chore(release): 3.0.0-beta.23 [skip ci]
svc-cli-bot Oct 2, 2023
aece19a
fix: remove OCLIF_NEXT_VERSION
mdonnalley Oct 3, 2023
778455f
chore: add prepare for husky install
mdonnalley Oct 3, 2023
9c2f29c
test: try false for ignoreScripts
svc-cli-bot Oct 3, 2023
ee6fe50
chore(release): 3.0.0-beta.25 [skip ci]
svc-cli-bot Oct 3, 2023
bcba56e
test: ignore scripts for external nuts
mdonnalley Oct 3, 2023
5ec8425
chore: use eslint-plugin-perfectionist (#807)
mdonnalley Oct 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
11 changes: 0 additions & 11 deletions .editorconfig

This file was deleted.

19 changes: 0 additions & 19 deletions .eslintrc

This file was deleted.

10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": ["oclif", "oclif-typescript", "prettier", "plugin:perfectionist/recommended-natural"],
"rules": {
"unicorn/prefer-module": "off",
"unicorn/no-array-reduce": "off",
"no-useless-constructor": "off",
"perfectionist/sort-object-types": "off",
"perfectionist/sort-union-types": "off"
}
}
7 changes: 4 additions & 3 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: automerge
on:
workflow_dispatch:
schedule:
- cron: '17 2,5,8,11 * * *'
- cron: "17 2,5,8,11 * * *"

jobs:
automerge:
uses: oclif/github-workflows/.github/workflows/automerge.yml@main
secrets: inherit
uses: salesforcecli/github-workflows/.github/workflows/automerge.yml@main
secrets:
SVC_CLI_BOT_GITHUB_TOKEN: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
# However, if this is a manual release (workflow_dispatch), then we want to disable skip-on-empty
# This helps recover from forgetting to add semantic commits ('fix:', 'feat:', etc.)
skip-on-empty: ${{ github.event_name == 'push' }}
generate-readme: false
# docs:
# # Most repos won't use this
# # Depends on the 'release' job to avoid git collisions, not for any functionality reason
Expand Down
69 changes: 56 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ jobs:
windows-unit-tests:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main
node14:
e2e:
needs: linux-unit-tests
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
node_version: [14.x]
os: [ubuntu-latest, windows-latest]
node_version: [lts/*, latest]
exclude:
- os: windows-latest
node_version: lts/*
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -27,38 +30,77 @@ jobs:
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- run: yarn install
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- run: yarn test
e2e:
- if: runner.os == 'Windows'
run: yarn mocha --forbid-only "test/**/*.e2e.ts" --exclude "test/integration/sf.e2e.ts" --parallel --timeout 1200000
- if: runner.os == 'Linux'
run: yarn test:e2e
windows-sf-e2e:
# For whatever reason the windows-latest runner doesn't like it when you shell yarn commands in the sf repo
# which is an integral part of the setup for the tests. Instead, we replicate the setup here.
needs: linux-unit-tests
strategy:
fail-fast: false
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: latest
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- run: yarn link
- run: New-Item -Path D:\a -Name "e2e" -ItemType "directory"
- run: New-Item -Path D:\a\e2e -Name "sf.e2e.ts" -ItemType "directory"
- run: |
git clone https://github.com/salesforcecli/cli.git --branch mdonnalley/esm
cd cli

$Json = Get-Content package.json | ConvertFrom-Json
$Json.dependencies | Add-Member -Force -MemberType NoteProperty -Name "@oclif/core" -Value "file:D:\a\core\core"
$Json.resolutions | Add-Member -MemberType NoteProperty -Name "@oclif/core" -Value "D:\a\core\core"
$Json | ConvertTo-Json -Depth 9 | Out-File package.json

yarn install --network-timeout 600000
yarn link @oclif/core
yarn build
working-directory: D:\a\e2e\sf.e2e.ts
- run: yarn mocha --forbid-only "test/integration/sf.e2e.ts" --parallel --timeout 1200000
env:
OCLIF_CORE_E2E_SKIP_SETUP: true
OCLIF_CORE_E2E_TEST_DIR: D:\a\e2e
DEBUG: e2e:*
esm-cjs-interop:
needs: linux-unit-tests
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
node_version: [lts/-1, lts/*, latest]
os: [ubuntu-latest, windows-latest]
node_version: [lts/*, latest]
test: [esm, cjs, precore, coreV1, coreV2]
exclude:
- os: windows-latest
node_version: lts/*
- os: windows-latest
node_version: lts/-1
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 75
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- run: yarn install --network-timeout 600000
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- run: yarn test:e2e
- run: yarn test:esm-cjs --test=${{ matrix.test }}
nuts:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/externalNut.yml@main
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
os: [ubuntu-latest, windows-latest]
externalProjectGitUrl:
- https://github.com/salesforcecli/plugin-auth
- https://github.com/salesforcecli/plugin-data
Expand All @@ -73,6 +115,7 @@ jobs:
useCache: false
preSwapCommands: "npx yarn-deduplicate; yarn install"
preExternalBuildCommands: "shx rm -rf node_modules/@salesforce/sf-plugins-core/node_modules/@oclif/core"
ignoreScripts: true
secrets:
TESTKIT_AUTH_URL: ${{ secrets.TESTKIT_AUTH_URL }}
TESTKIT_HUB_USERNAME: ${{ secrets.TESTKIT_HUB_USERNAME }}
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged --concurrent false
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.json": ["prettier --write"],
"*.md": ["prettier --write"],
"+(src|test)/**/*.+(ts|js)": ["eslint --fix", "prettier --write"]
}
3 changes: 1 addition & 2 deletions .mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"reporter": "spec",
"require": [
"test/helpers/init.js",
"ts-node/register",
"source-map-support/register"
"ts-node/register"
],
"timeout": 60000,
"watch-extensions": [
Expand Down
11 changes: 11 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"check-coverage": true,
"lines": 80,
"statements": 70,
"functions": 70,
"branches": 60,
"reporter": ["lcov", "text"],
"extension": [".ts"],
"include": ["**/*.ts"],
"exclude": ["**/*.d.ts", "test/**"]
}
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@oclif/prettier-config"
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ base library for oclif CLIs
Migrating
=====

See the [migration guide](./MIGRATION.md) for an overview of breaking changes that occurred between v1 and v2.
See the [v3 migration guide](./guides/V3_MIGRATION.md) for an overview of breaking changes that occurred between v2 and v3.

See the [v2 migration guide](./guides/V2_MIGRATION.md) for an overview of breaking changes that occurred between v1 and v2.

Migrating from `@oclif/config` and `@oclif/command`? See the [v1 migration guide](./guides/PRE_CORE_MIGRATION.md).

CLI UX
=====
Expand All @@ -28,7 +32,7 @@ You can, however, use `@oclif/core` in a standalone script like this:
#!/usr/bin/env ts-node

import * as fs from 'fs'
import {Command, Flags} from '@oclif/core'
import {Command, Flags, flush, handle} from '@oclif/core'

class LS extends Command {
static description = 'List the files in a directory.'
Expand All @@ -50,10 +54,10 @@ class LS extends Command {
}
}

LS.run().then(() => {
require('@oclif/core/flush')
}, () => {
require('@oclif/core/handle')
LS.run().then(async () => {
await flush()
}, async (err) => {
await handle(err)
})
```

Expand Down
1 change: 0 additions & 1 deletion commitlint.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion flush.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./lib').flush
module.exports = require('./lib/cli-ux/flush').flush
Loading
Loading