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

feat!: migrate to ESM #538

Merged
merged 7 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.

8 changes: 0 additions & 8 deletions .eslintrc

This file was deleted.

8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": ["oclif", "oclif-typescript", "prettier"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"max-depth": ["warn", 5],
"unicorn/consistent-destructuring": "off"
}
}
7 changes: 5 additions & 2 deletions .git2gus/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"productTag": "a1aB0000000ce2IIAQ",
"defaultBuild": "offcore.tooling.55",
"issueTypeLabels": { "enhancement": "USER STORY", "bug": "BUG P3" },
"defaultBuild": "offcore.tooling.59",
"issueTypeLabels": {
"enhancement": "USER STORY",
"bug": "BUG P3"
},
"hideWorkItemUrl": true,
"statusWhenClosed": "CLOSED"
}
9 changes: 6 additions & 3 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ name: automerge
on:
workflow_dispatch:
schedule:
- cron: '17 2,5,8,11 * * *'
- cron: '42 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 }}
with:
mergeMethod: squash
4 changes: 2 additions & 2 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
# point at specific branches, or a naming convention via wildcard
- prerelease/**
tags-ignore:
- "*"
- '*'
workflow_dispatch:
inputs:
prerelease:
type: string
description: "Name to use for the prerelease: beta, dev, etc. NOTE: If this is already set in the package.json, it does not need to be passed in here."
description: 'Name to use for the prerelease: beta, dev, etc. NOTE: If this is already set in the package.json, it does not need to be passed in here.'

jobs:
release:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ on:
workflow_dispatch:

jobs:
unit-tests:
uses: oclif/github-workflows/.github/workflows/unitTest.yml@main
yarn-lockfile-check:
uses: salesforcecli/github-workflows/.github/workflows/lockFileCheck.yml@main
linux-unit-tests:
needs: yarn-lockfile-check
uses: salesforcecli/github-workflows/.github/workflows/unitTestsLinux.yml@main
windows-unit-tests:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
node_modules
.idea/
.vscode/

oclif.lock
oclif.manifest.json
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname $0)/_/husky.sh"

yarn commitlint --edit $1
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"]
}
13 changes: 4 additions & 9 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{
"require": [
"test/helpers/init.js",
"ts-node/register",
"source-map-support/register"
],
"watch-extensions": [
"ts"
],
"require": ["ts-node/register"],
"watch-extensions": ["ts"],
"recursive": true,
"reporter": "spec",
"timeout": 60000
"timeout": 60000,
"node-option": ["loader=ts-node/esm"]
}
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@oclif/prettier-config"
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@oclif/plugin-autocomplete
==========================
# @oclif/plugin-autocomplete

autocomplete plugin for oclif (bash, zsh and powershell)

Expand All @@ -8,14 +7,18 @@ autocomplete plugin for oclif (bash, zsh and powershell)
[![License](https://img.shields.io/npm/l/@oclif/plugin-autocomplete.svg)](https://github.com/oclif/plugin-autocomplete/blob/main/package.json)

<!-- toc -->
* [Usage](#usage)
* [Commands](#commands)

- [@oclif/plugin-autocomplete](#oclifplugin-autocomplete)
- [Usage](#usage)
- [Commands](#commands)
<!-- tocstop -->

# Usage

Run `<cli> autocomplete` to generate the autocomplete files for your current shell.

## Topic separator

Since oclif v2 it's possible to use spaces as a topic separator in addition to colons.

For bash and zsh each topic separator has different autocomplete implementations, if the CLI supports using a space as the separator, plugin-autocomplete will generate completion for that topic.
Expand All @@ -25,25 +28,27 @@ If you still want to use the colon-separated autocomplete you can set `OCLIF_AUT
Docs: https://oclif.io/docs/topic_separator

# Commands

<!-- commands -->
* [`oclif-example autocomplete [SHELL]`](#oclif-example-autocomplete-shell)

- [`oclif-example autocomplete [SHELL]`](#oclif-example-autocomplete-shell)

## `oclif-example autocomplete [SHELL]`

display autocomplete installation instructions
Display autocomplete installation instructions.

```
USAGE
$ oclif-example autocomplete [SHELL] [-r]

ARGUMENTS
SHELL shell type
SHELL (zsh|bash|powershell) Shell type

FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)

DESCRIPTION
display autocomplete installation instructions
Display autocomplete installation instructions.

EXAMPLES
$ oclif-example autocomplete
Expand All @@ -52,8 +57,11 @@ EXAMPLES

$ oclif-example autocomplete zsh

$ oclif-example autocomplete powershell

$ oclif-example autocomplete --refresh-cache
```

_See code: [src/commands/autocomplete/index.ts](https://github.com/oclif/plugin-autocomplete/blob/v1.2.0/src/commands/autocomplete/index.ts)_
_See code: [src/commands/autocomplete/index.ts](https://github.com/oclif/plugin-autocomplete/blob/2.3.11-dev.1/src/commands/autocomplete/index.ts)_

<!-- commandsstop -->
16 changes: 0 additions & 16 deletions appveyor.yml

This file was deleted.

18 changes: 0 additions & 18 deletions bin/dev

This file was deleted.

2 changes: 1 addition & 1 deletion bin/dev.cmd
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off

node "%~dp0\dev" %*
node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
8 changes: 8 additions & 0 deletions bin/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
// eslint-disable-next-line node/shebang
async function main() {
const {execute} = await import('@oclif/core')
await execute({development: true, dir: import.meta.url})
}

await main()
5 changes: 0 additions & 5 deletions bin/run

This file was deleted.

9 changes: 9 additions & 0 deletions bin/run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env node

// eslint-disable-next-line node/shebang
async function main() {
const {execute} = await import('@oclif/core')
await execute({dir: import.meta.url})
}

await main()
67 changes: 40 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,53 @@
{
"name": "@oclif/plugin-autocomplete",
"description": "autocomplete plugin for oclif",
"version": "2.3.10",
"version": "2.3.11-dev.1",
"author": "Salesforce",
"bugs": "https://github.com/oclif/plugin-autocomplete/issues",
"dependencies": {
"@oclif/core": "^2.15.0",
"chalk": "^4.1.0",
"debug": "^4.3.4"
"@oclif/core": "^3.5.0",
"chalk": "^5.3.0",
"debug": "^4.3.4",
"ejs": "^3.1.9"
},
"devDependencies": {
"@oclif/plugin-help": "^5",
"@oclif/test": "^2.5.6",
"@commitlint/config-conventional": "^18.0.0",
"@oclif/plugin-help": "^6",
"@oclif/prettier-config": "^0.2.1",
"@oclif/test": "^3.0.2",
"@types/chai": "^4",
"@types/chalk": "^2.2.0",
"@types/debug": "^4.1.10",
"@types/ejs": "^3.1.4",
"@types/mocha": "^8",
"@types/mocha": "^10.0.3",
"@types/nock": "^11.1.0",
"@types/node": "^15.14.9",
"@types/node": "^18",
"chai": "^4",
"eslint": "^7.3.1",
"eslint-config-oclif": "^3.1.0",
"eslint-config-oclif-typescript": "^0.2.0",
"commitlint": "^18.0.0",
"eslint": "^8.52.0",
"eslint-config-oclif": "^5.0.0",
"eslint-config-oclif-typescript": "^3.0.8",
"eslint-config-prettier": "^9.0.0",
"globby": "^11",
"mocha": "^8.2.1",
"husky": "^8.0.3",
"lint-staged": "^15.0.2",
"mocha": "^10.2.0",
"nock": "^13.3.6",
"nyc": "^15.1.0",
"oclif": "^3.17.2",
"oclif": "^4.0.3",
"prettier": "^3.0.3",
"shx": "^0.3.3",
"ts-node": "^9.0.0",
"tslib": "^2.6.2",
"typescript": "4.6.3"
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"engines": {
"node": ">=12.0.0"
"node": ">=18.0.0"
},
"exports": "./lib/index.js",
"files": [
"/lib",
"/oclif.manifest.json"
"/oclif.manifest.json",
"/oclif.lock"
],
"homepage": "https://github.com/oclif/plugin-autocomplete",
"keywords": [
Expand All @@ -49,17 +59,20 @@
"bin": "oclif-example",
"devPlugins": [
"@oclif/plugin-help"
]
],
"flexibleTaxonomy": true
},
"repository": "oclif/plugin-autocomplete",
"scripts": {
"lint": "eslint . --ext .ts --config .eslintrc",
"build": "shx rm -rf lib && tsc",
"lint": "eslint . --ext .ts",
"postpack": "shx rm -f oclif.manifest.json oclif.lock",
"posttest": "yarn lint",
"prepack": "shx rm -rf lib && tsc && oclif lock && oclif manifest . && oclif readme",
"prepare": "husky install",
"pretest": "yarn build && tsc -p test",
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
"posttest": "yarn lint",
"prepack": "shx rm -rf lib && tsc && oclif manifest . && oclif readme",
"postpack": "shx rm -f oclif.manifest.json",
"version": "oclif readme && git add README.md",
"build": "shx rm -rf lib && tsc"
}
}
"version": "oclif readme && git add README.md"
},
"type": "module"
}
Loading
Loading