-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a2377e
commit 858bab3
Showing
26 changed files
with
565 additions
and
694 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,9 @@ docs | |
oclif.manifest.json | ||
|
||
# -- CLEAN ALL | ||
*.tsbuildinfo | ||
.eslintcache | ||
.wireit | ||
node_modules | ||
|
||
# -- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": 5000, | ||
"exclude": "node_modules/**/*" | ||
"exclude": "node_modules/**/*", | ||
"node-option": ["loader=ts-node/esm"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env node | ||
|
||
void (async () => { | ||
const oclif = await import('@oclif/core'); | ||
oclif.settings.performanceEnabled = true; | ||
await oclif.execute({ development: true, dir: import.meta.url }); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env node | ||
|
||
void (async () => { | ||
// Since the CLI is a single process, we can have a larger amount of max listeners since | ||
// the process gets shut down. Don't set it to 0 (no limit) since we should still be aware | ||
// of rouge event listeners | ||
process.setMaxListeners(parseInt(process.env.SF_MAX_EVENT_LISTENERS, 10) || 1000); | ||
|
||
// Don't let other plugins override the CLI specified max listener count | ||
process.setMaxListeners = () => {}; | ||
|
||
// Pre-process/prune flags before creating or running the actual CLI | ||
(await import('../dist/flags.js')).preprocessCliFlags(process); | ||
|
||
const oclif = await import('@oclif/core'); | ||
const { createRequire } = await import('module'); | ||
const pjson = createRequire(import.meta.url)('../package.json'); | ||
|
||
const cli = await import('../dist/cli.js'); | ||
|
||
cli | ||
.create({ version: pjson.version, bin: pjson.oclif.bin, channel: 'stable' }) | ||
.run() | ||
.then(async () => { | ||
await oclif.flush(); | ||
}) | ||
.catch(async (err) => { | ||
await oclif.handle(err); | ||
}); | ||
})(); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,42 @@ | ||
#!/usr/bin/env node | ||
|
||
const { spawn } = require('child_process'); | ||
const { join } = require('path'); | ||
|
||
if (process.env.SF_HIDE_RELEASE_NOTES === 'true') process.exit(0); | ||
|
||
const logAndExit = (msg) => { | ||
console.log('NOTE: This error can be ignored in CI and may be silenced in the future'); | ||
console.log('- Set the SF_HIDE_RELEASE_NOTES env var to "true" to skip this script\n'); | ||
console.log(msg.toString()); | ||
|
||
process.exit(0); | ||
}; | ||
|
||
/* | ||
* NOTE: Please read "Notes about the hook scripts" in this PR before making changes: | ||
* https://github.com/salesforcecli/sfdx-cli/pull/407 | ||
*/ | ||
|
||
var executable = process.platform === 'win32' ? 'run.cmd' : 'run'; | ||
|
||
var cmd = spawn(join(__dirname, '..', 'bin', executable), ['whatsnew', '--hook'], { | ||
stdio: ['ignore', 'inherit', 'pipe'], | ||
timeout: 10000, | ||
}); | ||
|
||
cmd.stderr.on('data', (error) => { | ||
logAndExit(error); | ||
}); | ||
|
||
cmd.on('error', (error) => { | ||
logAndExit(error); | ||
}); | ||
|
||
// 'exit' fires whether or not the stream are finished | ||
cmd.on('exit', (code) => { | ||
process.exit(0); | ||
}); | ||
void (async () => { | ||
const { spawn } = await import('node:child_process'); | ||
const { join } = await import('node:path'); | ||
const { fileURLToPath } = await import('node:url'); | ||
|
||
if (process.env.SF_HIDE_RELEASE_NOTES === 'true') process.exit(0); | ||
|
||
const logAndExit = (msg) => { | ||
console.log('NOTE: This error can be ignored in CI and may be silenced in the future'); | ||
console.log('- Set the SF_HIDE_RELEASE_NOTES env var to "true" to skip this script\n'); | ||
console.log(msg.toString()); | ||
|
||
process.exit(0); | ||
}; | ||
|
||
/* | ||
* NOTE: Please read "Notes about the hook scripts" in this PR before making changes: | ||
* https://github.com/salesforcecli/sfdx-cli/pull/407 | ||
*/ | ||
|
||
const executable = process.platform === 'win32' ? 'run.cmd' : 'run.js'; | ||
|
||
const cmd = spawn(join(fileURLToPath(import.meta.url), '..', '..', 'bin', executable), ['whatsnew', '--hook'], { | ||
stdio: ['ignore', 'inherit', 'pipe'], | ||
timeout: 10000, | ||
}); | ||
|
||
cmd.stderr.on('data', (error) => { | ||
logAndExit(error); | ||
}); | ||
|
||
cmd.on('error', (error) => { | ||
logAndExit(error); | ||
}); | ||
|
||
// 'exit' fires whether or not the stream are finished | ||
cmd.on('exit', (code) => { | ||
process.exit(0); | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
const { execSync } = require('child_process'); | ||
|
||
(() => { | ||
void (async () => { | ||
const { execSync } = await import('node:child_process'); | ||
const testCliNotVersion = (cli, version) => { | ||
try { | ||
return execSync(`${cli} --version`).toString('utf-8').includes(version); | ||
|
@@ -11,6 +10,8 @@ const { execSync } = require('child_process'); | |
}; | ||
// test sfdx is installed | ||
if (testCliNotVersion('sfdx', 'sfdx-cli/7.')) { | ||
throw Error('"[email protected]" has a bin alias for "sfdx", please uninstall sfdx-cli first. See https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_move_to_sf_v2.htm for more information'); | ||
throw Error( | ||
'"[email protected]" has a bin alias for "sfdx", please uninstall sfdx-cli first. See https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_move_to_sf_v2.htm for more information' | ||
); | ||
} | ||
})(); |
Oops, something went wrong.