Skip to content

Commit b0e3496

Browse files
authored
Merge branch 'main' into dependabot-npm_and_yarn-npm_and_yarn-ba6a9eed42
2 parents 42b996f + cd02a9c commit b0e3496

File tree

5 files changed

+1011
-1437
lines changed

5 files changed

+1011
-1437
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# [2.3.0](https://github.com/salesforcecli/plugin-lightning-dev/compare/2.2.3...2.3.0) (2024-11-19)
2+
3+
### Features
4+
5+
- add setup / port env variables ([#257](https://github.com/salesforcecli/plugin-lightning-dev/issues/257)) ([b753b42](https://github.com/salesforcecli/plugin-lightning-dev/commit/b753b4289148c937ba6a12db54c27c243705d3c4))
6+
17
## [2.2.3](https://github.com/salesforcecli/plugin-lightning-dev/compare/2.2.2...2.2.3) (2024-11-06)
28

39
### Bug Fixes

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ EXAMPLES
200200
$ sf lightning dev app --target-org myOrg --device-type ios --device-id "iPhone 15 Pro Max"
201201
```
202202

203-
_See code: [src/commands/lightning/dev/app.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/2.2.3/src/commands/lightning/dev/app.ts)_
203+
_See code: [src/commands/lightning/dev/app.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/2.3.0/src/commands/lightning/dev/app.ts)_
204204

205205
## `sf lightning dev site`
206206

@@ -244,6 +244,6 @@ EXAMPLES
244244
$ sf lightning dev site --name "Partner Central" --target-org myOrg
245245
```
246246

247-
_See code: [src/commands/lightning/dev/site.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/2.2.3/src/commands/lightning/dev/site.ts)_
247+
_See code: [src/commands/lightning/dev/site.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/2.3.0/src/commands/lightning/dev/site.ts)_
248248

249249
<!-- commandsstop -->

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"name": "@salesforce/plugin-lightning-dev",
33
"description": "Lightning development tools for LEX, Mobile, and Experience Sites",
4-
"version": "2.2.3",
4+
"version": "2.3.0",
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
8-
"@lwrjs/api": "0.15.0-alpha.44",
8+
"@inquirer/prompts": "^5.3.8",
9+
"@inquirer/select": "^2.4.7",
910
"@lwc/lwc-dev-server": "^10.7.4",
1011
"@lwc/sfdc-lwc-compiler": "^10.7.4",
12+
"@lwrjs/api": "0.15.0-alpha.44",
1113
"@oclif/core": "^4.0.30",
1214
"@salesforce/core": "^8.6.2",
1315
"@salesforce/kit": "^3.1.6",
1416
"@salesforce/lwc-dev-mobile-core": "4.0.0-alpha.9",
1517
"@salesforce/sf-plugins-core": "^11.2.4",
16-
"@inquirer/select": "^2.4.7",
17-
"@inquirer/prompts": "^5.3.8",
1818
"axios": "^1.7.7",
1919
"glob": "^10.4.5",
2020
"lwc": "^8.2.0",
@@ -24,12 +24,12 @@
2424
"devDependencies": {
2525
"@oclif/plugin-command-snapshot": "^5.2.19",
2626
"@salesforce/cli-plugins-testkit": "^5.3.25",
27-
"@salesforce/dev-scripts": "^10.2.7",
27+
"@salesforce/dev-scripts": "^10.2.10",
2828
"@salesforce/plugin-command-reference": "^3.1.13",
2929
"@types/node-fetch": "^2.6.11",
3030
"eslint-plugin-sf-plugin": "^1.20.1",
3131
"esmock": "^2.6.7",
32-
"oclif": "^4.14.12",
32+
"oclif": "^4.15.28",
3333
"ts-node": "^10.9.2",
3434
"typescript": "^5.5.4"
3535
},

src/commands/lightning/dev/site.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import fs from 'node:fs';
88
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
99
import { Messages } from '@salesforce/core';
10-
import { expDev } from '@lwrjs/api';
10+
import { expDev, setupDev } from '@lwrjs/api';
1111
import { OrgUtils } from '../../../shared/orgUtils.js';
1212
import { PromptUtils } from '../../../shared/promptUtils.js';
1313
import { ExperienceSite } from '../../../shared/experience/expSite.js';
@@ -79,15 +79,24 @@ export default class LightningDevSite extends SfCommand<void> {
7979
const authToken = await selectedSite.setupAuth();
8080

8181
// Start the dev server
82-
await expDev({
82+
const port = parseInt(process.env.PORT ?? '3000', 10);
83+
const startupParams = {
84+
sfCli: true,
8385
authToken,
8486
open: true,
85-
port: 3000,
87+
port,
8688
logLevel: 'error',
8789
mode: 'dev',
8890
siteZip,
8991
siteDir: selectedSite.getSiteDirectory(),
90-
});
92+
};
93+
94+
// Environment variable used to setup the site rather than setup & start server
95+
if (process.env.SETUP_ONLY === 'true') {
96+
await setupDev(startupParams);
97+
} else {
98+
await expDev(startupParams);
99+
}
91100
} catch (e) {
92101
this.log('Local Development setup failed', e);
93102
}

0 commit comments

Comments
 (0)