-
Notifications
You must be signed in to change notification settings - Fork 0
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 #413
Changes from 20 commits
1953d7c
51b65a8
0e570ac
4b27582
3b84c22
ebc1887
7463e92
b0a3325
11d60a8
c682a4b
bfcf471
1b2dde8
4be59eb
8cbe833
b1c8152
69ec42c
7fe8ff2
2c22da3
4adc6cb
2fd4829
bc32540
1a4d47b
5eaa129
b47b8bc
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
*.cjs |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,9 @@ node_modules | |
.idea | ||
|
||
oclif.manifest.json | ||
|
||
oclif.lock | ||
|
||
oclif.lock | ||
|
||
oclif.lock |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
'**/*.{js,json,md}?(x)': () => 'npm run reformat', | ||
}; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
{ | ||
"require": "ts-node/register,source-map-support/register", | ||
"require": ["ts-node/register"], | ||
"watch-extensions": "ts", | ||
"recursive": true, | ||
"reporter": "spec", | ||
"timeout": 10000, | ||
"exclude": "node_modules/**/*" | ||
"exclude": "node_modules/**/*", | ||
"node-option": ["loader=ts-node/esm"] | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@echo off | ||
set NODE_ENV=development | ||
node "%~dp0\dev" %* | ||
|
||
node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %* |
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(); |
This file was deleted.
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(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,15 @@ | |
"author": "Salesforce", | ||
"bugs": "https://github.com/forcedotcom/cli/issues", | ||
"dependencies": { | ||
"@oclif/core": "^2.15.0", | ||
"@oclif/core": "^3.9.0", | ||
"@salesforce/core": "^5.3.14", | ||
"@salesforce/sf-plugins-core": "^3.1.25", | ||
"fast-levenshtein": "^3.0.0", | ||
"tslib": "^2" | ||
"@salesforce/sf-plugins-core": "^4.0.0", | ||
"fast-levenshtein": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@oclif/plugin-command-snapshot": "^4.0.14", | ||
"@oclif/test": "^2.5.6", | ||
"@salesforce/cli-plugins-testkit": "^4.4.7", | ||
"@oclif/plugin-command-snapshot": "^5.0.1", | ||
"@oclif/test": "^3.0.3", | ||
"@salesforce/cli-plugins-testkit": "^5.0.0-dev.1", | ||
"@salesforce/dev-config": "^4.1.0", | ||
"@salesforce/dev-scripts": "^5.12.2", | ||
"@salesforce/kit": "^3.0.11", | ||
|
@@ -23,7 +22,6 @@ | |
"@salesforce/prettier-config": "^0.0.3", | ||
"@salesforce/ts-sinon": "^1.4.17", | ||
"@salesforce/ts-types": "^2.0.9", | ||
"@swc/core": "^1.3.27", | ||
"@types/fast-levenshtein": "^0.0.3", | ||
"@types/fs-extra": "^9.0.13", | ||
"@types/shelljs": "^0.8.14", | ||
|
@@ -43,7 +41,7 @@ | |
"husky": "^7.0.4", | ||
"mocha": "^9.2.2", | ||
"nyc": "^15.1.0", | ||
"oclif": "^3.17.2", | ||
"oclif": "^4.0.3", | ||
"prettier": "^2.8.8", | ||
"pretty-quick": "^3.1.3", | ||
"shelljs": "^0.8.5", | ||
|
@@ -55,13 +53,15 @@ | |
}, | ||
"config": {}, | ||
"engines": { | ||
"node": ">=16.0.0" | ||
"node": ">=18.0.0" | ||
}, | ||
"files": [ | ||
"/lib", | ||
"/messages", | ||
"/oclif.manifest.json", | ||
"/schemas" | ||
"/schemas", | ||
"/oclif.lock", | ||
"/oclif.lock" | ||
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. multiple |
||
], | ||
"homepage": "https://github.com/salesforcecli/plugin-settings", | ||
"keywords": [ | ||
|
@@ -74,7 +74,6 @@ | |
"sf" | ||
], | ||
"license": "BSD-3-Clause", | ||
"main": "lib/index.js", | ||
"oclif": { | ||
"commands": "./lib/commands", | ||
"bin": "sf", | ||
|
@@ -97,7 +96,8 @@ | |
"alias": { | ||
"description": "Use the alias commands to manage your aliases." | ||
} | ||
} | ||
}, | ||
"flexibleTaxonomy": true | ||
}, | ||
"repository": "salesforcecli/plugin-settings", | ||
"scripts": { | ||
|
@@ -198,7 +198,7 @@ | |
"output": [] | ||
}, | ||
"test:command-reference": { | ||
"command": "\"./bin/dev\" commandreference:generate --erroronwarnings", | ||
"command": "ts-node \"./bin/dev.js\" commandreference:generate --erroronwarnings", | ||
"files": [ | ||
"src/**/*.ts", | ||
"messages/**", | ||
|
@@ -209,7 +209,7 @@ | |
] | ||
}, | ||
"test:deprecation-policy": { | ||
"command": "\"./bin/dev\" snapshot:compare", | ||
"command": "ts-node \"./bin/dev.js\" snapshot:compare", | ||
"files": [ | ||
"src/**/*.ts" | ||
], | ||
|
@@ -219,12 +219,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" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,14 @@ | |
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
|
||
import { fileURLToPath } from 'node:url'; | ||
import { dirname } from 'node:path'; | ||
import { parseVarArgs, Flags, loglevel, Ux, SfCommand } from '@salesforce/sf-plugins-core'; | ||
import { Config, Messages, Org, SfError, OrgConfigProperties } from '@salesforce/core'; | ||
import { CONFIG_HELP_SECTION, Msg, buildFailureMsg, calculateSuggestion, output } from '../../config'; | ||
import { HelpSection } from '@oclif/core'; | ||
import { CONFIG_HELP_SECTION, Msg, buildFailureMsg, calculateSuggestion, output } from '../../config.js'; | ||
|
||
Messages.importMessagesDirectory(__dirname); | ||
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); | ||
const messages = Messages.loadMessages('@salesforce/plugin-settings', 'config.set'); | ||
|
||
export type SetOrUnsetConfigCommandResult = { successes: Msg[]; failures: Msg[] }; | ||
|
@@ -29,7 +32,7 @@ export class Set extends SfCommand<SetOrUnsetConfigCommandResult> { | |
}), | ||
}; | ||
|
||
public static configurationVariablesSection = CONFIG_HELP_SECTION; | ||
public static configurationVariablesSection: HelpSection = CONFIG_HELP_SECTION; | ||
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 this needed? I removed it locally and typescript didn't mind |
||
|
||
public async run(): Promise<SetOrUnsetConfigCommandResult> { | ||
const { args, argv, flags } = await this.parse(Set); | ||
|
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.
multiple
oclif.lock
s here