Skip to content

Commit

Permalink
Merge pull request #550 from salesforcecli/mdonnalley/esm
Browse files Browse the repository at this point in the history
feat!: migrate to ESM
  • Loading branch information
mdonnalley authored Nov 6, 2023
2 parents 070fc3a + a370c5f commit 75b2b4f
Show file tree
Hide file tree
Showing 36 changed files with 818 additions and 709 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.cjs
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ node_modules
.idea

oclif.manifest.json

oclif.lock
3 changes: 3 additions & 0 deletions .lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'**/*.{js,json,md}?(x)': () => 'npm run reformat',
};
3 changes: 0 additions & 3 deletions .lintstagedrc.js

This file was deleted.

5 changes: 3 additions & 2 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"require": "ts-node/register,source-map-support/register",
"require": ["ts-node/register"],
"watch-extensions": "ts",
"recursive": true,
"reporter": "spec",
"timeout": 20000
"timeout": 20000,
"node-option": ["loader=ts-node/esm"]
}
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ sfdx plugins

<!-- commands -->

- [`sfdx doctor`](#sfdx-doctor)
- [`sfdx info:releasenotes:display`](#sfdx-inforeleasenotesdisplay)
- [`sf doctor`](#sf-doctor)
- [`sf info releasenotes display`](#sf-info-releasenotes-display)

## `sfdx doctor`
## `sf doctor`

Gather CLI configuration data and run diagnostic tests to discover and report potential problems in your environment.

```
USAGE
$ sfdx doctor [--json] [-c <value>] [-p <value>] [-d <value>] [-i]
$ sf doctor [--json] [-c <value>] [-p <value>] [-d <value>] [-i]
FLAGS
-c, --command=<value> Command to run in debug mode; results are written to a log file.
Expand Down Expand Up @@ -113,26 +113,26 @@ DESCRIPTION
EXAMPLES
Run CLI doctor diagnostics:
$ sfdx doctor
$ sf doctor
Run CLI doctor diagnostics and the specified command, and write the debug output to a file:
$ sfdx doctor --command "force:org:list --all"
$ sf doctor --command "force:org:list --all"
Run CLI doctor diagnostics for a specific plugin:
$ sfdx doctor --plugin @salesforce/plugin-source
$ sf doctor --plugin @salesforce/plugin-source
```

_See code: [src/commands/doctor.ts](https://github.com/salesforcecli/plugin-info/blob/2.6.51/src/commands/doctor.ts)_
_See code: [src/commands/doctor.ts](https://github.com/salesforcecli/plugin-info/blob/2.6.52-dev.0/src/commands/doctor.ts)_

## `sfdx info:releasenotes:display`
## `sf info releasenotes display`

Display Salesforce CLI release notes on the command line.

```
USAGE
$ sfdx info:releasenotes:display [--json] [-v <value>]
$ sf info releasenotes display [--json] [-v <value>]
FLAGS
-v, --version=<value> CLI version or tag for which to display release notes.
Expand All @@ -147,22 +147,22 @@ DESCRIPTION
--version flag to view release notes for a different release.
ALIASES
$ sfdx whatsnew
$ sf whatsnew
EXAMPLES
Display release notes for the currently installed CLI version:
$ sfdx info:releasenotes:display stable, stable-rc, latest, latest-rc, rc
$ sf info releasenotes display stable, stable-rc, latest, latest-rc, rc
Display release notes for CLI version 7.120.0:
$ sfdx info:releasenotes:display --version 7.120.0 stable, stable-rc, latest, latest-rc, rc
$ sf info releasenotes display --version 7.120.0 stable, stable-rc, latest, latest-rc, rc
Display release notes for the CLI version that corresponds to a tag (stable, stable-rc, latest, latest-rc, rc):
$ sfdx info:releasenotes:display --version latest
$ sf info releasenotes display --version latest
```

_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/2.6.51/src/commands/info/releasenotes/display.ts)_
_See code: [src/commands/info/releasenotes/display.ts](https://github.com/salesforcecli/plugin-info/blob/2.6.52-dev.0/src/commands/info/releasenotes/display.ts)_

<!-- commandsstop -->
21 changes: 0 additions & 21 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();
3 changes: 0 additions & 3 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();
File renamed without changes.
4 changes: 0 additions & 4 deletions messages/doctor.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ Check http://status.salesforce.com for general Salesforce availability and perfo

Must first initialize a new SfDoctor.

# doctorAlreadyInitializedError

SfDoctor has already been initialized.

# pluginNotInstalledError

Specified plugin [%s] isn't installed. Install it, correct the name, or choose another plugin.
66 changes: 32 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,76 +1,70 @@
{
"name": "@salesforce/plugin-info",
"description": "Plugin for accessing cli info from the command line",
"version": "2.6.51",
"version": "2.6.52-dev.0",
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"main": "lib/index.js",
"dependencies": {
"@oclif/core": "^2.15.0",
"@oclif/core": "^3.7.1",
"@salesforce/core": "^5.3.1",
"@salesforce/kit": "^3.0.14",
"@salesforce/sf-plugins-core": "^3.1.28",
"got": "^11.8.6",
"@salesforce/sf-plugins-core": "^4",
"got": "^13.0.0",
"marked": "^4.3.0",
"marked-terminal": "^4.2.0",
"open": "^8.4.2",
"proxy-agent": "^6.3.1",
"semver": "^7.5.4",
"tslib": "^2"
"semver": "^7.5.4"
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^4.0.16",
"@salesforce/cli-plugins-testkit": "^4.4.10",
"@salesforce/dev-scripts": "^6.0.3",
"@salesforce/plugin-command-reference": "^3.0.45",
"@salesforce/ts-sinon": "^1.4.19",
"@swc/core": "1.3.39",
"@oclif/plugin-command-snapshot": "^5",
"@salesforce/cli-plugins-testkit": "^5",
"@salesforce/dev-scripts": "^6.0.1",
"@salesforce/plugin-command-reference": "^3.0.33",
"@salesforce/ts-sinon": "^1.4.18",
"@types/fs-extra": "^9.0.13",
"@types/marked": "^4.0.8",
"@types/marked-terminal": "^3.1.3",
"@types/semver": "^7.5.4",
"@types/sinon-chai": "^3.2.11",
"eslint-plugin-sf-plugin": "^1.16.13",
"oclif": "^3.17.2",
"eslint-plugin-sf-plugin": "^1.16.10",
"oclif": "^4.0.3",
"shx": "0.3.4",
"sinon-chai": "^3.7.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"config": {},
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
},
"files": [
"/lib",
"/messages",
"/oclif.manifest.json"
"/oclif.manifest.json",
"/oclif.lock"
],
"homepage": "https://github.com/salesforcecli/plugin-info",
"keywords": [
"force",
"salesforce",
"sfdx",
"salesforcedx",
"sfdx-plugin"
"sf-plugin",
"sf",
"sfdx-plugin",
"sfdx"
],
"license": "BSD-3-Clause",
"oclif": {
"commands": "./lib/commands",
"additionalHelpFlags": [
"-h"
],
"bin": "sfdx",
"bin": "sf",
"devPlugins": [
"@oclif/plugin-help",
"@oclif/plugin-command-snapshot",
"@salesforce/plugin-command-reference"
],
"hooks": {
"init": [
"./lib/hooks/init/init_doctor.js"
]
},
"topics": {
"info": {
"description": "Access Salesforce CLI information from the command line.",
Expand All @@ -83,25 +77,27 @@
"doctor": {
"description": "Tools for diagnosing problems with Salesforce CLI."
}
}
},
"flexibleTaxonomy": true,
"topicSeparator": " "
},
"repository": "salesforcecli/plugin-info",
"scripts": {
"build": "wireit",
"clean": "sf-clean",
"clean-all": "sf-clean all",
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json oclif.lock",
"compile": "wireit",
"docs": "sf-docs",
"format": "wireit",
"lint": "wireit",
"postpack": "shx rm -f oclif.manifest.json",
"postpack": "shx rm -f oclif.manifest.json oclif.lock",
"prepack": "sf-prepack",
"prepare": "sf-install",
"test": "wireit",
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
"test:only": "wireit",
"version": "oclif-dev readme"
"version": "oclif readme"
},
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -182,7 +178,7 @@
"output": []
},
"test:command-reference": {
"command": "\"./bin/dev\" commandreference:generate --erroronwarnings",
"command": "ts-node \"./bin/dev.js\" commandreference:generate --erroronwarnings",
"files": [
"src/**/*.ts",
"messages/**",
Expand All @@ -193,7 +189,7 @@
]
},
"test:deprecation-policy": {
"command": "\"./bin/dev\" snapshot:compare",
"command": "ts-node \"./bin/dev.js\" snapshot:compare",
"files": [
"src/**/*.ts"
],
Expand All @@ -203,12 +199,14 @@
]
},
"test:json-schema": {
"command": "\"./bin/dev\" schema:compare",
"command": "ts-node \"./bin/dev.js\" schema:compare",
"files": [
"src/**/*.ts",
"schemas"
],
"output": []
}
}
},
"exports": "./lib/index.js",
"type": "module"
}
Loading

0 comments on commit 75b2b4f

Please sign in to comment.