Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
feat: initial oss cli
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Jan 21, 2021
1 parent ee3998d commit ad12027
Show file tree
Hide file tree
Showing 88 changed files with 11,091 additions and 2,058 deletions.
35 changes: 28 additions & 7 deletions .circleci/config.yml
Expand Up @@ -4,23 +4,44 @@ orbs:
release-management: salesforce/npm-release-management@4

workflows:
version: 2
test-and-release:
version: 2.1
test:
jobs:
- release-management/validate-pr:
filters:
branches:
ignore: master
ignore: main
- release-management/test-package:
name: node-latest
node_version: latest
- release-management/test-package:
name: node-12

release:
jobs:
- release-management/test-package:
name: node-latest
node_version: latest
filters:
branches:
only: main
- release-management/test-package:
name: node-12
filters:
branches:
only: main
- approval:
type: approval
requires:
- node-latest
- node-12
- release-management/release-package:
tag: latest-rc
dryrun: true
sign: true
pre-job-steps:
- release-management/pin-dependencies:
tag: latest-rc
github-release: true
requires:
- node-latest
filters:
branches:
only: master
- approval
23 changes: 22 additions & 1 deletion .gitignore
@@ -1,4 +1,25 @@
# -- CLEAN
dist/
*.tgz
*.sig
npm-debug.log
.npm
xunit.xml
tmp
.aws/
.nvm-node

.history
coverage/
checkstyle.xml
.sfdx
.cache
/release/
src/temp
oclif.manifest.json
npm-shrinkwrap.json
/Library/*


# use yarn by default, so ignore npm
package-lock.json
Expand Down Expand Up @@ -32,4 +53,4 @@ node_modules

# os specific files
.DS_Store
.idea
.idea
38 changes: 8 additions & 30 deletions .vscode/launch.json
@@ -1,46 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Suspended",
"type": "node",
"request": "attach",
"name": "Attach",
"port": 9229,
"skipFiles": ["<node_internals>/**"]
"port": 9229
},
{
"name": "Run All Tests",
"name": "mocha tests",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
"protocol": "inspector",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["--inspect", "--no-timeouts", "--colors", "test/**/*.test.ts"],
"env": {
"NODE_ENV": "development",
"SFDX_ENV": "development"
},
"sourceMaps": true,
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Compile"
},
{
"type": "node",
"request": "launch",
"name": "Run Current Test",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["--inspect", "--no-timeouts", "--colors", "${file}"],
"env": {
"NODE_ENV": "development",
"SFDX_ENV": "development"
},
"sourceMaps": true,
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"preLaunchTask": "Compile"
"args": ["--timeout", "999999", "--colors", "--recursive", "dist"],
"runtimeArgs": ["--nolazy"]
}
]
}
15 changes: 1 addition & 14 deletions .vscode/settings.json 100755 → 100644
@@ -1,16 +1,3 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},
"search.exclude": {
"**/lib": true,
"**/bin": true
},
"editor.tabSize": 2,
"editor.formatOnSave": true,
"rewrap.wrappingColumn": 80
"typescript.tsdk": "node_modules/typescript/lib"
}
55 changes: 55 additions & 0 deletions .yarnclean
@@ -0,0 +1,55 @@
# test directories
__tests__
test
tests

powered-test

# assets
docs
website
images

# examples
example
examples

# code coverage directories
coverage
.nyc_output

# build scripts
Makefile
Gulpfile.js
Gruntfile.js

# configs
codeship-services.yml
codeship-steps.yml
wercker.yml
.tern-project
.editorconfig
.npmignore
.gitignore
.jshintrc
.flowconfig
.documentup.json
.yarn-metadata.json
.travis.yml

# editors
.idea

# misc
*.gz

# exceptions

!istanbul/lib/assets
!istanbul-reports/lib/html/assets

# Don't clear files in known source directories
!**/lib/**/*
!**/src/**/*
!**/dist/**/*
!**/templates/**/*
45 changes: 45 additions & 0 deletions DEVELOPER.md
@@ -0,0 +1,45 @@
# Salesforce CLI

This is the `sfdx` CLI application, based on Heroku's
[oclif](https://oclif.io). By default it comes installed with the `salesforcedx` plugin, which contributes all commands in the `force` namespace.

## Installation and Development

### Requirements

To get started, you'll need to install `node` v8.4 or greater, though we recommend using the latest v10 (LTS) for the best experience. While this can be done using an installer from [nodejs.com](nodejs.com) or via an OS-specific package manager, we recommend using [nvm](https://github.com/creationix/nvm) to easily manage multiple `node` versions.

If using `nvm`, be sure that you've selected the appropriate version with something like `nvm use v10.x.y`, where `x` and `y` are specific to the version that you installed. If you want to use this version by default run `nvm alias default node` -- otherwise, when you restart your shell `nvm` will revert to whatever version configured prior to installing the latest.

You'll also need [yarn](https://yarnpkg.com/en/docs/install). If you did decide to use `nvm`, be sure to follow the `nvm`-specific install instructions.

### Up and running as a CLI-only developer

1. From within this repository's root directory, run `yarn` (short for `yarn install`).
1. Run `bin/run` to view the CLI's root help.

When you make changes to this project's `.ts`. sources, you will need to recompile. Use `yarn compile` to rebuild. Linting and tests will run as git hooks before pushing.

### Developer CLI flags

#### `bin/run` flags

The following flags are supported by the `bin/run` script, and can be combined as desired.

- _--dev-debug_: Sets the `SFDX_DEBUG=1`, `SFDX_ENV=development`, and `DEBUG=\*` envars for the CLI's `node` process, which enables full debug output from both `sfdx` and the oclif CLI engine.

#### `bin/run.sh` or `bin\run.cmd` flags

The following flags are supported by the `bin/run.sh` script, which wraps the `bin/run` script referenced in the rest of this document, and can be combined as desired. They are stripped from the args passed to the CLI application itself.

- _--dev-suspend_: Starts the `node` binary with the `--inspect-brk` flag to allow a remote debugger to attach before running. _Does not work with npm-based installs. For this case, you can set the environment variable `NODE_OPTIONS='--inspect-brk'`. You may also need to set the variable `OCLIF_TS_NODE=0` for debugger break points to stop on the correct lines._
- To set other Node executable flags, the use of the `NODE_OPTIONS` environment variable is required.

### Developer notes

- To manually install a specific version of the `salesforcedx` plugin you an run `npm install salesforcedx@<tag | x.y.z>`
- If you are using a locally linked `cli-engine` and making changes, you may want to set up its compile watch with `yarn run watch`.

## Build and release

For more information about how to locally run or modify the build and release scripts, see the [SCRIPTS](SCRIPTS.md) document.

0 comments on commit ad12027

Please sign in to comment.