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

[pull] master from amtrack:master #14

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
c16779c
chore(deps): update actions/checkout action to v4
renovate[bot] Sep 4, 2023
154ee88
chore(deps): update dependency @types/mocha to v10.0.2
renovate[bot] Sep 27, 2023
7eef171
chore(deps): update dependency oclif to v3.17.2
renovate[bot] Sep 28, 2023
4db5803
Merge pull request #571 from amtrack/renovate/mocha-10.x
amtrack Sep 30, 2023
7019178
chore(deps): update dependency @types/node to v18.18.1
renovate[bot] Sep 30, 2023
a5e5f69
Merge pull request #563 from amtrack/renovate/node-18.x
amtrack Sep 30, 2023
3c0f20e
Merge pull request #566 from amtrack/renovate/oclif-3.x
amtrack Sep 30, 2023
76fa6d7
use v4 tag
amtrack Sep 30, 2023
35b4618
Merge pull request #570 from amtrack/renovate/actions-checkout-4.x
amtrack Sep 30, 2023
c9f3ee9
chore(deps): update dependency typescript to v5.2.2
renovate[bot] Sep 30, 2023
02addc9
Merge pull request #565 from amtrack/renovate/typescript-5.x
amtrack Sep 30, 2023
e350db5
perf: actively close pages to reduce memory usage
amtrack Oct 8, 2023
1f61878
refactor: remove superfluous ctor parameter
amtrack Oct 1, 2023
214a0ca
no export default
amtrack Oct 1, 2023
181cd56
don't hardcode command name in examples
amtrack Oct 1, 2023
9861c0f
no-return-await
amtrack Oct 1, 2023
0e101cc
test: use strict assertion
amtrack Oct 1, 2023
91364ae
refactor: don't mutate the argument of the function
amtrack Oct 1, 2023
c725182
fix: use more robust variant of clicking elements searched via xpath
amtrack Oct 1, 2023
cf11dc1
fix: retrieving setting for relateContactToMultipleAccounts
amtrack Oct 1, 2023
553c2a4
refactor: throw error on apply instead of retrieve
amtrack Oct 1, 2023
17a6954
test: simplify developing E2E tests
amtrack Oct 1, 2023
17a2088
Merge pull request #573 from amtrack/test/refactor-e2e-tests
amtrack Oct 8, 2023
85529c2
fix: make enabling HighVelocitySales more robust
amtrack Oct 8, 2023
2633b27
add type of plugin in template
amtrack Oct 8, 2023
8dcd216
fix: retry on picklist operation in progress
amtrack Oct 8, 2023
ad892d9
fix: make setting relateContactToMultipleAccounts more robust
amtrack Oct 8, 2023
346fc57
Merge pull request #575 from amtrack/fix/hvs-timeout
amtrack Oct 8, 2023
b49efba
fix: retry every picklist action because of possible ongoing operations
amtrack Oct 9, 2023
8386eaa
fix: allow deleting inactive picklist values
amtrack Oct 9, 2023
00564af
Merge pull request #576 from amtrack/fix/picklist-operations
amtrack Oct 9, 2023
d89deca
fix: try to make setting RelateContactToMultipleAccounts more reliable
amtrack Oct 9, 2023
cbee00c
chore: replace sfdx with sf
amtrack Oct 10, 2023
44547a5
Merge pull request #577 from amtrack/chore/replace-sfdx-with-sf
amtrack Oct 10, 2023
c9d635c
chore(deps): update dependency @types/node to v18.18.4
renovate[bot] Oct 11, 2023
38b55a5
chore(deps): update dependency oclif to v4
renovate[bot] Oct 11, 2023
2e355ab
Merge pull request #574 from amtrack/renovate/oclif-4.x
amtrack Oct 11, 2023
ac33950
Merge pull request #572 from amtrack/renovate/node-18.x
amtrack Oct 11, 2023
60b360b
fixup! test: simplify developing E2E tests
amtrack Oct 11, 2023
bcad3b4
Merge pull request #579 from amtrack/test/refactor-company-informatio…
amtrack Oct 11, 2023
56e7227
fixup! fix: make enabling HighVelocitySales more robust
amtrack Oct 11, 2023
f930f5d
fix: Winter 24 changes in HighVelocitySales UI
amtrack Oct 11, 2023
f595555
Merge pull request #578 from amtrack/fix/winter-24-hvs
amtrack Oct 11, 2023
9e24f29
fixup! test: simplify developing E2E tests
amtrack Oct 11, 2023
cf3b686
Merge pull request #580 from amtrack/test/more-refactoring
amtrack Oct 11, 2023
4a5a6b1
chore(deps): update dependency oclif to v4.0.2
renovate[bot] Oct 11, 2023
a35dce6
Merge pull request #581 from amtrack/renovate/oclif-4.x
amtrack Oct 11, 2023
bb3f024
chore(deps): update dependency @types/node to v18.18.5
renovate[bot] Oct 12, 2023
2ecea05
Merge pull request #582 from amtrack/renovate/node-18.x
amtrack Oct 13, 2023
1074715
chore(deps): update dependency oclif to v4.0.3
renovate[bot] Oct 18, 2023
40f0337
chore(deps): update actions/setup-node action to v4
renovate[bot] Oct 23, 2023
85af19e
chore(deps): update dependency @types/node to v18.18.7
renovate[bot] Oct 25, 2023
89c8ded
Merge pull request #586 from amtrack/renovate/actions-setup-node-4.x
amtrack Oct 26, 2023
77570b0
Merge pull request #585 from amtrack/renovate/node-18.x
amtrack Oct 26, 2023
d501bb6
chore(deps): update dependency @types/mocha to v10.0.3
renovate[bot] Oct 26, 2023
9de9ca8
Merge pull request #583 from amtrack/renovate/oclif-4.x
amtrack Oct 26, 2023
b255d55
Merge pull request #584 from amtrack/renovate/mocha-10.x
amtrack Oct 26, 2023
3425175
refactor: use sf plugin style and rewrite diff mechanism
amtrack Oct 25, 2023
5861381
Merge pull request #588 from amtrack/refactor/sf-plugin-style
amtrack Oct 27, 2023
932edcb
chore(deps): update dependency oclif to v4.0.3 (#591) [skip ci]
renovate[bot] Oct 27, 2023
76237f1
chore(deps): update dependency @types/mocha to v10.0.3 (#589) [skip ci]
renovate[bot] Oct 27, 2023
8c29247
chore(deps): update dependency @types/node to v18.18.7 (#590) [skip ci]
renovate[bot] Oct 27, 2023
66496bc
fix(deps): update dependency @salesforce/sf-plugins-core to v4.1.1
renovate[bot] Nov 10, 2023
48c53ba
chore(CI): resolve Node.js version from .node-version file
amtrack Nov 10, 2023
a04167b
Merge pull request #595 from amtrack/chore/ci-gha-node-version
amtrack Nov 10, 2023
c074401
chore(deps): update dependency node to v20
renovate[bot] Nov 10, 2023
f33beb7
Merge pull request #587 from amtrack/renovate/node-20.x
amtrack Nov 10, 2023
a0634d1
chore(deps): update dependency @types/mocha to v10.0.4
renovate[bot] Nov 10, 2023
63f46d9
Merge pull request #593 from amtrack/renovate/mocha-10.x
amtrack Nov 10, 2023
9d0a257
chore: refactor org login from environment variable
amtrack Nov 12, 2023
2d4cc34
Merge pull request #596 from amtrack/chore/sf-org-login-sfdx-url-from…
amtrack Nov 12, 2023
ae897c3
chore(deps): update dependency prettier to v3.1.0
renovate[bot] Nov 13, 2023
bba0d5a
Merge pull request #597 from amtrack/renovate/prettier-3.x
amtrack Nov 13, 2023
11c697f
Merge pull request #594 from amtrack/renovate/salesforce-sf-plugins-c…
amtrack Nov 13, 2023
57306da
fix: make handling LWC components in iframes more robust
amtrack Nov 13, 2023
d5e4574
fix: handle new enhanced domains
amtrack Nov 14, 2023
2ec89ed
test: add missing await
amtrack Nov 13, 2023
5b69645
test: close page
amtrack Nov 14, 2023
7ac69a2
fix: make clicking in LWC more robust
amtrack Nov 15, 2023
fc4b6b5
fix: further improvements for dealing with iframes
amtrack Nov 15, 2023
b575515
Merge pull request #602 from amtrack/fix/iframes
amtrack Nov 15, 2023
26006aa
fix: upgrade puppeteer to v21 now using "Chrome for Testing"
renovate[bot] Nov 13, 2023
fe69d9d
Merge pull request #598 from amtrack/fix/upgrade-puppeteer
amtrack Nov 15, 2023
6b0c41f
feat: enable/disable LinkedIn Sales Navigator
amtrack Feb 9, 2024
007ac44
fix: make RelateContactToMultipleAccounts more reliable
amtrack Feb 9, 2024
ecaf874
Merge pull request #614 from amtrack/fix/relate-contacts-to-multiple-…
amtrack Feb 9, 2024
bfa2e79
Merge pull request #613 from amtrack/feat/linkedin-sales-navigator
amtrack Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version-file: .node-version
- name: Install dependencies
run: |
yarn install
yarn global add sfdx-cli@7.172.0
yarn global add @salesforce/cli@${SF_CLI_VERSION:-"latest"}
- name: Run unit tests
run: yarn test
- name: Authenticate DevHub and create scratch org
env:
SFDX_AUTH_URL_DEVHUB: ${{ secrets.SFDX_AUTH_URL_DEVHUB }}
run: |
sfdx auth:sfdxurl:store -d -a devhub -f /dev/stdin <<< "${SFDX_AUTH_URL_DEVHUB}"
sf org login sfdx-url -d -a devhub -f <(echo "${SFDX_AUTH_URL_DEVHUB}")
yarn develop
- name: Run end-to-end tests
run: yarn test:e2e
- name: Delete scratch org
if: always()
run: |
sfdx force:org:delete -p
sf org delete scratch -p
- name: Release package
run: npx semantic-release
env:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ jobs:
default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version-file: .node-version
- name: Install dependencies
run: |
yarn install
yarn global add sfdx-cli@7.172.0
yarn global add @salesforce/cli@${SF_CLI_VERSION:-"latest"}
- name: Run unit tests
run: yarn test
- name: Authenticate DevHub and create scratch org
env:
SFDX_AUTH_URL_DEVHUB: ${{ secrets.SFDX_AUTH_URL_DEVHUB }}
run: |
sfdx auth:sfdxurl:store -d -a devhub -f /dev/stdin <<< "${SFDX_AUTH_URL_DEVHUB}"
yarn develop release=preview
sf org login sfdx-url -d -a devhub -f <(echo "${SFDX_AUTH_URL_DEVHUB}")
yarn develop --release preview
- name: Run end-to-end tests
run: yarn test:e2e
- name: Delete scratch org
if: always()
run: |
sfdx force:org:delete -p
sf org delete scratch -p
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
4 changes: 0 additions & 4 deletions .prettierrc.json

This file was deleted.

10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ Bravo 👏, you have just generated a working browserforce plugin!
Create a scratch org and try it yourself:

```console
sfdx force:org:create -f config/project-scratch-def.json -a browserforce-dev -s
BROWSER_DEBUG=true ./bin/run browserforce:apply -f src/plugins/admins-can-log-in-as-any-user/enable.json -u browserforce-dev
BROWSER_DEBUG=true ./bin/run browserforce:apply -f src/plugins/admins-can-log-in-as-any-user/disable.json -u browserforce-dev
sf org create scratch -f config/project-scratch-def.json -a browserforce-dev -d
BROWSER_DEBUG=true ./bin/run browserforce apply -f src/plugins/admins-can-log-in-as-any-user/enable.json -u browserforce-dev
BROWSER_DEBUG=true ./bin/run browserforce apply -f src/plugins/admins-can-log-in-as-any-user/disable.json -u browserforce-dev
```

Now it's your turn!
Expand Down Expand Up @@ -115,7 +115,7 @@ This allows to run multiple actions (from multiple plugins) using a single confi

#### Implementation (`index.ts`)

Plugins are written in [Typescript](https://www.typescriptlang.org), just like `sfdx` and most of the available sfdx plugins.
Plugins are written in [Typescript](https://www.typescriptlang.org), just like `sf` and most of the available sf plugins.

[Puppeteer](https://pptr.dev) is being used as a library for browser automation.
If you need more inspiration regarding Puppeteer, checkout [this curated list](https://github.com/transitive-bullshit/awesome-puppeteer) of awesome Puppeteer resources.
Expand Down Expand Up @@ -167,7 +167,7 @@ To run the **end to end tests**, you might want to create a new **default scratc
> Note: Your default scratch org will be used in the tests!

```console
sfdx force:org:create -f config/project-scratch-def.json --setdefaultusername
sf org create scratch -f config/project-scratch-def.json -d
```

```console
Expand Down
47 changes: 36 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
[![Actions Status](https://github.com/amtrack/sfdx-browserforce-plugin/workflows/Test%20and%20Release/badge.svg)](https://github.com/amtrack/sfdx-browserforce-plugin/actions)

Unlike the [Scratch Org Definition Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file.htm) which can only be used **on the creation of a scratch org** (`sfdx force:org:create -f config/scratch-def.json`),
the _Browserforce Configuration_ allows to "shape" **any org**, (e.g. scratch org, sandbox or production org) with **similar preferences and unofficial preferences** that are not (yet) available in the _Scratch Org Definition Configuration_ or as _Metadata_ (`sfdx browserforce:apply -f config/setup-admin-login-as-any.json -u [email protected]`).
the _Browserforce Configuration_ allows to "shape" **any org**, (e.g. scratch org, sandbox or production org) with **similar preferences and unofficial preferences** that are not (yet) available in the _Scratch Org Definition Configuration_ or as _Metadata_ (`sf browserforce apply -f config/setup-admin-login-as-any.json -u [email protected]`).

Further benefits:

- comfortable configuration using JSON Schema (similar to the [Scratch Org Definition Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs_def_file.htm))
- idempotency of the `apply` command only applies what's necessary and allows re-execution (concept similar to [terraform](https://www.terraform.io/docs/commands/apply.html))
- browser automation powered by [Puppeteer](https://github.com/GoogleChrome/puppeteer) (Chromium)
- browser automation powered by Puppeteer and "Chrome for Testing", [learn more about Puppeteer and Browserforce](#puppeteer)
- implement your own custom preferences (a.k.a. plugins; to be improved)

# Installation

There are several different methods to install `sfdx-browserforce-plugin`:

```console
# as an sfdx plugin globally
sfdx plugins:install sfdx-browserforce-plugin
# as an sf plugin globally
sf plugins install sfdx-browserforce-plugin

# or standalone globally
npm install --global sfdx-browserforce-plugin
Expand All @@ -34,8 +34,8 @@ npm install --save-dev sfdx-browserforce-plugin
Depending on your choice of installation, you can find the `browserforce` namespace:

```console
# globally in the sfdx cli
sfdx browserforce
# globally in the sf cli
sf browserforce

# globally in the sfdx-browserforce-plugin executable
sfdx-browserforce-plugin browserforce
Expand All @@ -49,14 +49,14 @@ $ sfdx-browserforce browserforce -h
browser automation

USAGE
$ sfdx-browserforce-plugin browserforce:COMMAND
$ sfdx-browserforce-plugin browserforce COMMAND

COMMANDS
browserforce:apply apply a plan from a definition file
browserforce:plan retrieve state and generate plan file
browserforce apply apply a plan from a definition file
browserforce plan retrieve state and generate plan file
```

Both the `browserforce:apply` and `browserforce:plan` commands expect a config file and a target username or alias for the org.
Both the `browserforce apply` and `browserforce plan` commands expect a config file and a target username or alias for the org.

# Example

Expand All @@ -80,7 +80,7 @@ Tip: If you use _Visual Studio Code_, you can leverage tab completion to build t
Next apply the config:

```console
$ sfdx browserforce:apply -f ./config/setup-admin-login-as-any.json --targetusername [email protected]
$ sf browserforce apply -f ./config/setup-admin-login-as-any.json --target-org [email protected]
logging in... done
Applying definition file ./config/setup-admin-login-as-any.json to org [email protected]
[Security] retrieving state... done
Expand Down Expand Up @@ -162,6 +162,31 @@ Here is a full blown example showing most of the supported settings in action:
- `BROWSERFORCE_RETRY_MAX_RETRIES`: number of retries on failures opening a page (default: `4`)
- `BROWSERFORCE_RETRY_TIMEOUT_MS`: initial time between retries in exponential mode (default: `4000`)

# Puppeteer

We use [Puppeteer](https://github.com/puppeteer/puppeteer) for browser automation which comes with its own "Chrome for Testing" browser.

The puppeteer [installation doc](https://github.com/puppeteer/puppeteer#installation) describes how this works:

> When you install Puppeteer, it automatically downloads a recent version of
> [Chrome for Testing](https://goo.gle/chrome-for-testing) (~170MB macOS, ~282MB Linux, ~280MB Windows) that is [guaranteed to
> work](https://pptr.dev/faq#q-why-doesnt-puppeteer-vxxx-work-with-chromium-vyyy)
> with Puppeteer. The browser is downloaded to the `$HOME/.cache/puppeteer` folder
> by default (starting with Puppeteer v19.0.0).

In most of the cases this just works! If you still want to skip the download and use another browser installation, you can do this as follows:

```console
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
sf plugins install sfdx-browserforce-plugin
export PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
sf browserforce:apply ...
```

Troubleshooting:

- The installation is triggered via the `postinstall` hook of npm/yarn. If you've disabled running scripts with npm (`--ignore-scripts` or via config file), it will not download the browser.

# Contributing

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for getting started.
Expand Down
71 changes: 22 additions & 49 deletions _templates/plugin/new/index.e2e-spec.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,32 @@
to: src/plugins/<%= h.changeCase.paramCase(name) %>/index.e2e-spec.ts
---
import assert from 'assert';
import * as child from 'child_process';
import * as path from 'path';
import { <%= h.changeCase.pascalCase(name) %> } from '.';
import { type Config, <%= h.changeCase.pascalCase(name) %> } from '.';

describe(<%= h.changeCase.pascalCase(name) %>.name, function() {
this.slow('30s');
this.timeout('2m');
it('should enable', () => {
const enableCmd = child.spawnSync(path.resolve('bin', 'run'), [
'browserforce:apply',
'-f',
path.resolve(path.join(__dirname, 'enable.json'))
]);
assert.deepStrictEqual(enableCmd.status, 0, enableCmd.output.toString());
assert.ok(
/to 'true'/.test(enableCmd.output.toString()),
enableCmd.output.toString()
);
let plugin: <%= h.changeCase.pascalCase(name) %>;
before(() => {
plugin = new <%= h.changeCase.pascalCase(name) %>(global.bf);
});
it('should already be enabled', () => {
const enableCmd = child.spawnSync(path.resolve('bin', 'run'), [
'browserforce:apply',
'-f',
path.join(__dirname, 'enable.json')
]);
assert.deepStrictEqual(enableCmd.status, 0, enableCmd.output.toString());
assert.ok(
/no action necessary/.test(enableCmd.output.toString()),
enableCmd.output.toString()
);

const configEnabled: Config = {
enabled: true
};
const configDisabled: Config = {
enabled: true
};
it('should enable', async () => {
await plugin.run(configEnabled);
});
it('should already be enabled', async () => {
const res = await plugin.run(configEnabled);
assert.deepStrictEqual(res, { message: 'no action necessary' });
});
it('should disable', () => {
const disableCmd = child.spawnSync(path.resolve('bin', 'run'), [
'browserforce:apply',
'-f',
path.resolve(path.join(__dirname, 'disable.json'))
]);
assert.deepStrictEqual(disableCmd.status, 0, disableCmd.output.toString());
assert.ok(
/to 'false'/.test(disableCmd.output.toString()),
disableCmd.output.toString()
);
it('should disable', async () => {
await plugin.run(configDisabled);
});
it('should already be disabled', () => {
const disableCmd = child.spawnSync(path.resolve('bin', 'run'), [
'browserforce:apply',
'-f',
path.join(__dirname, 'disable.json')
]);
assert.deepStrictEqual(disableCmd.status, 0, disableCmd.output.toString());
assert.ok(
/no action necessary/.test(disableCmd.output.toString()),
disableCmd.output.toString()
);
it('should already be disabled', async () => {
const res = await plugin.run(configDisabled);
assert.deepStrictEqual(res, { message: 'no action necessary' });
});
});
4 changes: 3 additions & 1 deletion _templates/plugin/new/index.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const SELECTORS = {
SAVE_BUTTON: 'input[id$=":save"]'
};

type Config = {
export type Config = {
enabled: boolean;
};

Expand All @@ -27,6 +27,7 @@ export class <%= h.changeCase.pascalCase(name) %> extends BrowserforcePlugin {
(el: HTMLInputElement) => el.checked
)
};
await page.close();
return response;
}

Expand All @@ -44,5 +45,6 @@ export class <%= h.changeCase.pascalCase(name) %> extends BrowserforcePlugin {
page.waitForSelector(SELECTORS.CONFIRM_MESSAGE),
page.click(SELECTORS.SAVE_BUTTON)
]);
await page.close();
}
}
24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@
},
"dependencies": {
"@mdapi-issues/listmetadata-standardvalueset": "2.0.3",
"@salesforce/command": "5.2.16",
"json-merge-patch": "1.0.2",
"@salesforce/sf-plugins-core": "4.1.1",
"p-retry": "4.6.2",
"puppeteer": "19.2.0",
"tslib": "2.4.0"
"puppeteer": "21.5.1"
},
"devDependencies": {
"@types/mocha": "10.0.1",
"@types/node": "18.16.8",
"@salesforce/dev-config": "4.1.0",
"@salesforce/prettier-config": "0.0.3",
"@types/mocha": "10.0.4",
"@types/node": "20.9.0",
"mocha": "10.2.0",
"nyc": "15.1.0",
"oclif": "3.9.0",
"oclif": "4.0.3",
"prettier": "3.1.0",
"ts-node": "10.9.1",
"typescript": "5.0.4"
"typescript": "5.2.2"
},
"engines": {
"node": ">=14.0.0"
Expand All @@ -39,7 +40,8 @@
],
"license": "MIT",
"oclif": {
"bin": "sfdx-browserforce-plugin",
"bin": "sf",
"topicSeparator": " ",
"commands": "./lib/commands",
"topics": {
"browserforce": {
Expand All @@ -58,7 +60,7 @@
"generate:plugin": "npx hygen plugin new",
"prepack": "yarn build",
"prepare": "yarn build",
"test": "nyc --reporter=lcov --reporter=text mocha --require ts-node/register \"test/**/*.test.ts\" \"src/**/*.test.ts\"",
"test:e2e": "mocha --require ts-node/register \"test/**/*.e2e-spec.ts\" \"src/**/*.e2e-spec.ts\""
"test": "tsc -p test && nyc --reporter=lcov --reporter=text mocha --require ts-node/register \"test/**/*.test.ts\" \"src/**/*.test.ts\"",
"test:e2e": "tsc -p test && mocha --require ts-node/register --slow 30s --timeout 2m --file test/e2e-setup.ts \"test/**/*.e2e-spec.ts\" \"src/**/*.e2e-spec.ts\""
}
}
6 changes: 6 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const salesforcePrettierConfig = require('@salesforce/prettier-config');

module.exports = {
...salesforcePrettierConfig,
trailingComma: 'none'
};
10 changes: 5 additions & 5 deletions scripts/develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ _help() {
_main() {
alias="${alias:-${DEFAULT_ALIAS}}"
# shellcheck disable=SC2068
sfdx force:org:create -f config/project-scratch-def.json \
sf org create scratch -f config/project-scratch-def.json \
-a "$alias" \
-s \
description="${alias}" ${POSITIONAL_ARGS[@]}
sfdx force:org:display -u "$alias"
sfdx force:source:push -u "$alias"
-d \
${POSITIONAL_ARGS[@]}
sf org display -o "$alias"
sf project deploy start -o "$alias"
}

if [[ "$0" == "${BASH_SOURCE[0]}" ]]; then
Expand Down
Loading