Skip to content

Commit 6177be2

Browse files
authored
Updates for sf (#34)
* feat: support sf BREAKING CHANGE: only works for sf now * test: update to work with new file structure * refactor: use oclif/core * chore: bump to 2.0.0 * chore: satisfy dev-scripts * chore: code review * chore: regenerate yarn.lock
1 parent 33b0939 commit 6177be2

39 files changed

+4106
-6076
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ workflows:
2020
- lts
2121
- release-management/release-package:
2222
github-release: true
23+
tag: sf
2324
requires:
2425
- release-management/test-package
2526
filters:

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2020, salesforce.com, inc.
3+
* All rights reserved.
4+
* Licensed under the BSD 3-Clause license.
5+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6+
*/
7+
module.exports = {
8+
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license'],
9+
rules: {
10+
'@typescript-eslint/restrict-template-expressions': 'off',
11+
'@typescript-eslint/explicit-function-return-type': 'off',
12+
'@typescript-eslint/no-unsafe-assignment': 'off',
13+
'@typescript-eslint/no-unsafe-member-access': 'off',
14+
'@typescript-eslint/no-unsafe-call': 'off',
15+
'@typescript-eslint/no-unsafe-return': 'off',
16+
'@typescript-eslint/member-ordering': 'off',
17+
'no-underscore-dangle': 'off',
18+
'@typescript-eslint/explicit-module-boundary-types': 'off',
19+
'no-empty': 'off',
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
},
22+
};

.gitignore

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,39 @@
1-
*-debug.log
2-
*-error.log
3-
/.nyc_output
4-
/dist
5-
/lib
6-
/package-lock.json
1+
# -- CLEAN
2+
3+
# use yarn by default, so ignore npm
4+
package-lock.json
5+
6+
# never checkin npm config
7+
.npmrc
8+
9+
# debug logs
10+
npm-error.log
11+
yarn-error.log
12+
lerna-debug.log
13+
14+
# compile source
15+
lib
16+
17+
# test artifacts
18+
*xunit.xml
19+
*checkstyle.xml
20+
*unitcoverage
21+
.nyc_output
22+
coverage
23+
24+
# generated docs
25+
docs
26+
27+
# -- CLEAN ALL
28+
node_modules
29+
30+
# --
31+
# put files here you don't want cleaned with sf-clean
32+
33+
# os specific files
34+
.DS_Store
35+
.idea
36+
737
/tmp
838
/test/tmp
9-
node_modules
1039
oclif.manifest.json

.mocharc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"require": "ts-node/register,source-map-support/register",
3+
"watch-extensions": "ts",
4+
"recursive": true,
5+
"reporter": "spec",
6+
"timeout": 5000
7+
}

.nycrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"nyc": {
33
"extends": "@salesforce/dev-config/nyc"
44
}
5-
}
5+
}

.releaserc.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

.sfdevrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"test": {
3+
"testsPath": "test/**/*.test.ts"
4+
},
5+
"exclude-scripts": ["pretest"]
6+
}

LICENSE renamed to LICENSE.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ Redistribution and use in source and binary forms, with or without modification,
99

1010
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
1111

12-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13-
© 2020 GitHub, Inc.
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

bin/dev

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env node
2+
3+
process.env.NODE_ENV = 'development';
4+
5+
const g = (global.oclif = global.oclif || {});
6+
7+
// In dev mode, always show stack traces
8+
global.oclif.debug = true;
9+
10+
require('ts-node').register();
11+
12+
require('@oclif/core').run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));

bin/dev.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
set NODE_ENV=development
3+
node "%~dp0\dev" %*

bin/run

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/usr/bin/env node
22

3-
require('@oclif/command').run()
4-
.catch(require('@oclif/errors/handle'))
3+
require('@oclif/core').run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));

messages/main.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"pluginFlagDescription": "comma separated list of plugin names to be part of the generation. Defaults to the oclif plugin in the current working directory",
44
"hiddenFlagDescription": "show hidden commands",
55
"outputdirFlagDescription": "output directory to put generated files",
6-
"erroronwarningFlagDescription": "fail the command if there are any warnings"
6+
"erroronwarningFlagDescription": "fail the command if there are any warnings",
7+
"ditamapSuffixFlagDescription": "unique suffix to append to generated ditamap"
78
}

package.json

Lines changed: 59 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,50 @@
11
{
22
"name": "@salesforce/plugin-command-reference",
33
"description": "Generate the Salesforce CLI command reference guide",
4-
"version": "1.3.14",
4+
"version": "2.0.0",
55
"author": "Thomas @amphro",
6-
"bugs": "https://github.com/forcedotcom/plugin-command-reference/issues",
6+
"bugs": "https://github.com/salesforcecli/plugin-command-reference/issues",
77
"dependencies": {
8-
"@oclif/command": "^1.5.19",
9-
"@oclif/config": "^1.14.0",
10-
"@oclif/errors": "^1.2.2",
11-
"@salesforce/command": "^3.0.0",
8+
"@oclif/core": "^0.5.34",
9+
"@salesforce/command": "^4.0.5",
1210
"@salesforce/core": "^2.2.0",
11+
"@salesforce/kit": "^1.5.17",
12+
"@salesforce/ts-types": "^1.5.20",
1313
"chalk": "^3.0.0",
14-
"handlebars": "^4.7.3",
15-
"tslib": "^1"
14+
"handlebars": "^4.7.7",
15+
"tslib": "^2"
1616
},
1717
"devDependencies": {
18-
"@oclif/dev-cli": "^1.22.2",
1918
"@oclif/plugin-help": "^2.2.3",
20-
"@oclif/test": "^1.2.5",
21-
"@salesforce/dev-scripts": "^0.4.2",
22-
"@salesforce/prettier-config": "^0.0.1",
23-
"@semantic-release/changelog": "^5.0.0",
24-
"@semantic-release/git": "^9.0.0",
25-
"husky": "^4.2.3",
26-
"salesforcedx": "48.4.1",
27-
"semantic-release": "^17.0.4"
19+
"@salesforce/dev-config": "^2.1.2",
20+
"@salesforce/dev-scripts": "^0.9.18",
21+
"@salesforce/plugin-login": "^0.0.18",
22+
"@salesforce/prettier-config": "^0.0.2",
23+
"@typescript-eslint/eslint-plugin": "^4.2.0",
24+
"@typescript-eslint/parser": "^4.2.0",
25+
"chai": "^4.2.0",
26+
"eslint": "^6.8.0",
27+
"eslint-config-prettier": "^6.11.0",
28+
"eslint-config-salesforce": "^0.1.6",
29+
"eslint-config-salesforce-license": "^0.1.6",
30+
"eslint-config-salesforce-typescript": "^0.2.7",
31+
"eslint-plugin-header": "^3.0.0",
32+
"eslint-plugin-import": "^2.20.2",
33+
"eslint-plugin-jsdoc": "^27.0.3",
34+
"eslint-plugin-prettier": "^3.1.3",
35+
"husky": "^4.3.8",
36+
"mocha": "^8.4.0",
37+
"nyc": "^15.1.0",
38+
"oclif": "^1.18.1",
39+
"prettier": "^2.0.5",
40+
"pretty-quick": "^3.1.0",
41+
"shx": "^0.3.3",
42+
"sinon": "10.0.0",
43+
"ts-node": "^10.0.0",
44+
"typescript": "^4.1.3"
2845
},
2946
"engines": {
30-
"node": ">=8.4.0"
47+
"node": ">=12.0.0"
3148
},
3249
"files": [
3350
"/lib",
@@ -36,14 +53,15 @@
3653
"/oclif.manifest.json",
3754
"/templates"
3855
],
39-
"homepage": "https://github.com/forcedotcom/plugin-command-reference",
56+
"homepage": "https://github.com/salesforcecli/plugin-command-reference",
4057
"keywords": [
4158
"sfdx-plugin"
4259
],
4360
"license": "BSD-3-Clause",
4461
"oclif": {
4562
"commands": "./lib/commands",
46-
"bin": "sfdx",
63+
"bin": "sf",
64+
"topicSeparator": " ",
4765
"topics": {
4866
"commandreference": {
4967
"description": "generate the Salesforce CLI command reference guide.",
@@ -52,30 +70,33 @@
5270
},
5371
"devPlugins": [
5472
"@oclif/plugin-help",
55-
"salesforcedx"
73+
"@salesforce/plugin-login"
5674
]
5775
},
58-
"repository": "forcedotcom/plugin-command-reference",
76+
"repository": "salesforcecli/plugin-command-reference",
5977
"scripts": {
60-
"build": "yarn sfdx-build",
61-
"clean": "yarn sfdx-clean",
62-
"clean-all": "yarn sfdx-clean all",
63-
"compile": "yarn sfdx-compile",
64-
"docs": "yarn sfdx-docs",
65-
"format": "yarn sfdx-format",
66-
"lint": "yarn sfdx-lint",
67-
"postpack": "rm -f oclif.manifest.json",
68-
"pretest": "./bin/run commandreference:generate --plugins salesforcedx --outputdir test/tmp",
69-
"posttest": "tslint -p test -t stylish",
70-
"prepack": "yarn sfdx-build",
71-
"test": "yarn sfdx-test",
72-
"version": "oclif-dev readme && git add README.md"
78+
"build": "sf-build",
79+
"clean": "sf-clean",
80+
"clean-all": "sf-clean all",
81+
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
82+
"command-reference": "./bin/dev commandreference:generate --plugins login --outputdir test/tmp",
83+
"compile": "sf-compile",
84+
"docs": "sf-docs",
85+
"format": "sf-format",
86+
"lint": "sf-lint",
87+
"postpack": "shx rm -f oclif.manifest.json",
88+
"posttest": "yarn lint",
89+
"prepack": "sf-prepack",
90+
"prepare": "sf-install",
91+
"pretest": "sf-compile-test && yarn command-reference",
92+
"test": "sf-test",
93+
"version": "oclif readme"
7394
},
7495
"husky": {
7596
"hooks": {
76-
"commit-msg": "yarn sfdx-husky-commit-msg",
77-
"pre-commit": "yarn sfdx-husky-pre-commit",
78-
"pre-push": "yarn sfdx-husky-pre-push"
97+
"commit-msg": "sf-husky-commit-msg",
98+
"pre-commit": "sf-husky-pre-commit",
99+
"pre-push": "sf-husky-pre-push"
79100
}
80101
},
81102
"publishConfig": {

0 commit comments

Comments
 (0)