-
Notifications
You must be signed in to change notification settings - Fork 70
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
feat: final v3 features #779
Changes from 36 commits
66a69ea
b525246
292b4b1
d64d915
f6291f2
f25c4cb
d3446a2
f02bce2
ef1319f
a28e277
3273513
15f8177
4f1a889
e2f37ce
2618f14
13115a6
15b8f75
eaec901
a89267e
7882ce7
3efa804
0c607e5
7e9505f
e6d5b35
70f07e4
0fdc986
cac1dbd
d05c513
c8d1c61
f13e29c
540fc32
160e6c2
6fcd2a6
86d0ded
970d04b
7a03f8f
3f8c63e
9b949fb
49b7315
c00d998
a75e37c
836d7e7
037e224
9e9b677
023fe3d
9d66bc9
6c2145c
8cb414b
0f65a1c
efbafd9
c579b4f
c62f427
be392d0
a4887b5
11b3ed4
1c9104b
d5fc535
4ff3245
f83d639
24fcc62
748fe7c
91665b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,11 @@ jobs: | |
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] | ||
exclude: | ||
- os: windows-latest | ||
node_version: lts/* | ||
- os: windows-latest | ||
node_version: lts/-1 | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
|
@@ -34,18 +32,56 @@ jobs: | |
cache: yarn | ||
- run: yarn install --network-timeout 600000 | ||
- 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 | ||
- run: yarn install --network-timeout 600000 | ||
- 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is your branch required just temporarily? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. The sf integration tests fail since there are breaking changes. I have a note to switch this back to main once salesforcecli/cli#1094 is merged |
||
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] | ||
exclude: | ||
- os: windows-latest | ||
node_version: lts/* | ||
- os: windows-latest | ||
node_version: lts/-1 | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
|
@@ -64,7 +100,7 @@ jobs: | |
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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import {fileURLToPath} from 'url' | ||
import {fileURLToPath} from 'node:url' | ||
import * as chalk from 'chalk' | ||
import {format, inspect} from 'util' | ||
import {format, inspect} from 'node:util' | ||
import {ux} from './cli-ux' | ||
import {Config} from './config' | ||
import * as Errors from './errors' | ||
import {PrettyPrintableError} from './errors' | ||
import * as Parser from './parser' | ||
import { | ||
BooleanFlagProps, | ||
CompletableFlag, | ||
Deprecation, | ||
Arg as IArg, | ||
ArgInput, | ||
ArgOutput, | ||
ArgProps, | ||
BooleanFlagProps, | ||
Deprecation, | ||
Flag as IFlag, | ||
FlagInput, | ||
FlagOutput, | ||
Input, | ||
ArgProps, | ||
OptionFlagProps, | ||
ParserOutput, | ||
ArgOutput, | ||
} from './interfaces/parser' | ||
import {formatCommandDeprecationWarning, formatFlagDeprecationWarning, toConfiguredId, normalizeArgv} from './help/util' | ||
import {Plugin} from './interfaces/plugin' | ||
|
@@ -315,7 +315,7 @@ export abstract class Command { | |
} | ||
|
||
const deprecateAliases = flagDef?.deprecateAliases | ||
const aliases = (flagDef?.aliases ?? []).map(a => a.length === 1 ? `-${a}` : `--${a}`) | ||
const aliases = ([...flagDef?.aliases ?? [], ...flagDef?.charAliases ?? []]).map(a => a.length === 1 ? `-${a}` : `--${a}`) | ||
if (deprecateAliases && aliases.length > 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it possible to put, for example, also, rather than iterating all these aliases, should we exit early if |
||
const foundAliases = aliases.filter(alias => this.argv.some(a => a.startsWith(alias))) | ||
for (const alias of foundAliases) { | ||
|
@@ -435,9 +435,11 @@ export namespace Command { | |
hasDynamicHelp?: boolean; | ||
permutations?: string[] | ||
aliasPermutations?: string[]; | ||
isESM?: boolean; | ||
relativePath?: string[]; | ||
} | ||
|
||
export type Flag = CompletableFlag<any> | ||
export type Flag = IFlag<any> | ||
|
||
export namespace Flag { | ||
export type Cached = Omit<Flag, 'parse' | 'input'> & (BooleanFlagProps | OptionFlagProps) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here and elsewhere, prefer https://github.com/salesforcecli/github-workflows/blob/main/.github/actions/yarnInstallWithRetries/action.yml
use it like
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main