Skip to content

Commit

Permalink
Rename scripts to start and stop Apex Parser server
Browse files Browse the repository at this point in the history
  • Loading branch information
dangmai committed Dec 13, 2018
1 parent 4cab7d2 commit 9a977bd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.0.0-alpha.3

- Fix DML operation having double indents ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/8)).
- Rename scripts to start and stop Apex Parser Server.

## 1.0.0-alpha.2

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,18 @@ you have to evoke it out of band before running Prettier,
as well as specifying a special flag when running Prettier:

```bash
# Start the server
node /path/to/libary/tests_config/set_up.js
# Start the server (if installed globally)
start-apex-server
# Or if installed locally
node /path/to/libary/bin/start-apex-server.js

# In a separate console
prettier --use-standalone-server --write "/path/to/project/**/*.{trigger,cls}"

# After you are done, stop the server
node /path/to/libary/tests_config/tear_down.js
# After you are done, stop the server (if installed globally)
stop-apex-server
# Or if installed locally
node /path/to/libary/bin/stop-apex-server.js
```

## License
Expand Down
1 change: 1 addition & 0 deletions tests_config/set_up.js → bin/start-apex-server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node
const nailgunServer = require("../src/ng-server");

async function setup() {
Expand Down
1 change: 1 addition & 0 deletions tests_config/tear_down.js → bin/stop-apex-server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node
const nailgunServer = require("../src/ng-server");

async function teardown() {
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const defaultConfig = require("./jest.config.standalone");
// This config starts up nailgun by default
module.exports = {
...defaultConfig,
globalSetup: "<rootDir>/tests_config/set_up.js",
globalTeardown: "<rootDir>/tests_config/tear_down.js",
globalSetup: "<rootDir>/bin/start-apex-server.js",
globalTeardown: "<rootDir>/bin/stop-apex-server.js",
};
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"version": "1.0.0-alpha.2",
"description": "Salesforce Apex plugin for Prettier",
"main": "src/index.js",
"bin": {
"start-apex-server": "./bin/start-apex-server.js",
"stop-apex-server": "./bin/stop-apex-server.js"
},
"files": [
"/bin",
"/src",
"/vendor"
],
Expand Down

0 comments on commit 9a977bd

Please sign in to comment.