Skip to content

Commit fc2f4db

Browse files
committed
Merge branch 'main' into nrkruk/pocSiteApi
2 parents 1578943 + f65eae4 commit fc2f4db

File tree

11 files changed

+1242
-5891
lines changed

11 files changed

+1242
-5891
lines changed

.github/CI_README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# CI Info
2+
3+
[Github Workflows Readme](https://github.com/salesforcecli/github-workflows)
4+
5+
## Releasing a new version
6+
7+
[Release Workflow](https://github.com/salesforcecli/plugin-lightning-dev/actions/workflows/create-github-release.yml)
8+
9+
## Node Version Configuration
10+
11+
This repository provides flexibility to manage Node.js versions in CI workflows using repository variables.
12+
These variables can be configured at the repository level via the [Actions settings page](https://github.com/salesforcecli/plugin-lightning-dev/settings/variables/actions).
13+
These can also be supplied as arguments to individual workflows directly.
14+
15+
### `UT_DISABLE_NODE_CURRENT`
16+
17+
- Disables the latest Node.js version in GitHub Actions workflows.
18+
19+
### `UT_DISABLE_NODE_PREVIOUS`
20+
21+
- Disables the previous Node.js version in GitHub Actions workflows.
22+
23+
### `NODE_VERSION_OVERRIDE`
24+
25+
- Overrides the full set of Node.js versions used for testing and publishing.
26+
- **Default:** `'lts/*'` and `'lts/-1'`.

.github/workflows/onRelease.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,5 @@ jobs:
4949
sign: true
5050
tag: ${{ needs.getDistTag.outputs.tag || (needs.getMajorVersion.outputs.major == '1') && 'latest' || 'next' }}
5151
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
52-
nodeVersion: 20.18.0
5352

5453
secrets: inherit

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ jobs:
2626
fail-fast: false
2727
with:
2828
os: ${{ matrix.os }}
29-
nodeVersion: 20.18.0

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
## [2.6.2](https://github.com/salesforcecli/plugin-lightning-dev/compare/2.6.1...2.6.2) (2024-12-06)
2+
3+
### Bug Fixes
4+
5+
- **deps:** bump the npm_and_yarn group with 2 updates ([#284](https://github.com/salesforcecli/plugin-lightning-dev/issues/284)) ([c05b45d](https://github.com/salesforcecli/plugin-lightning-dev/commit/c05b45d43fde49bff671a99d6e8c9afccc8ee8c8))
6+
7+
## [2.6.1](https://github.com/salesforcecli/plugin-lightning-dev/compare/2.6.0...2.6.1) (2024-12-06)
8+
9+
### Bug Fixes
10+
11+
- rename CI readme ([f6d0c2c](https://github.com/salesforcecli/plugin-lightning-dev/commit/f6d0c2ca09b02ad7d82b1c2a919fdb617c76b085))
12+
13+
# [2.6.0](https://github.com/salesforcecli/plugin-lightning-dev/compare/2.5.0...2.6.0) (2024-12-06)
14+
15+
### Features
16+
17+
- support node 22+ ([#282](https://github.com/salesforcecli/plugin-lightning-dev/issues/282)) ([ea9b60f](https://github.com/salesforcecli/plugin-lightning-dev/commit/ea9b60f145de5874f53db5cdf78c8c9566dcfeac))
18+
19+
# [2.5.0](https://github.com/salesforcecli/plugin-lightning-dev/compare/2.4.0...2.5.0) (2024-11-25)
20+
21+
### Features
22+
23+
- update lwc dependencies to match 254/patch code line @W-17311538 ([#271](https://github.com/salesforcecli/plugin-lightning-dev/issues/271)) ([89c40b3](https://github.com/salesforcecli/plugin-lightning-dev/commit/89c40b37720014fc591af53c6df9cffc21c58eba))
24+
25+
# [2.4.0](https://github.com/salesforcecli/plugin-lightning-dev/compare/2.3.2...2.4.0) (2024-11-25)
26+
27+
### Features
28+
29+
- add open_browser env var for testing ([#269](https://github.com/salesforcecli/plugin-lightning-dev/issues/269)) ([d4d3778](https://github.com/salesforcecli/plugin-lightning-dev/commit/d4d37782b779867c85d4e8f388a93d5af670da9c))
30+
31+
## [2.3.2](https://github.com/salesforcecli/plugin-lightning-dev/compare/2.3.1...2.3.2) (2024-11-22)
32+
33+
### Bug Fixes
34+
35+
- download site bundle correctly if site name has special chars ([#262](https://github.com/salesforcecli/plugin-lightning-dev/issues/262)) ([fd52cec](https://github.com/salesforcecli/plugin-lightning-dev/commit/fd52cecb73535cd5fdd303bdd4f82321d3848c40))
36+
137
## [2.3.1](https://github.com/salesforcecli/plugin-lightning-dev/compare/2.3.0...2.3.1) (2024-11-21)
238

339
### Bug Fixes

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Comment line immediately above ownership line is reserved for related other information. Please be careful while editing.
22

33
#GUSINFO: Web Application Runtime, Lightning Web Runtime (Container)
4-
* @salesforcecli/lwr
4+
* @salesforcecli/lwr @salesforcecli/lex @salesforcecli/mobile-platform-experience

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.3.2-alpha.0/src/commands/lightning/dev/app.ts)_
203+
_See code: [src/commands/lightning/dev/app.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/2.6.2/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.3.2-alpha.0/src/commands/lightning/dev/site.ts)_
247+
_See code: [src/commands/lightning/dev/site.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/2.6.2/src/commands/lightning/dev/site.ts)_
248248

249249
<!-- commandsstop -->

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
{
22
"name": "@salesforce/plugin-lightning-dev",
33
"description": "Lightning development tools for LEX, Mobile, and Experience Sites",
4-
"version": "2.3.2-alpha.0",
4+
"version": "2.6.2",
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
88
"@inquirer/prompts": "^5.3.8",
99
"@inquirer/select": "^2.4.7",
10-
"@lwc/lwc-dev-server": "^10.7.4",
11-
"@lwc/sfdc-lwc-compiler": "^10.7.4",
12-
"@lwrjs/api": "0.15.0-alpha.44",
10+
"@lwc/lwc-dev-server": "^11.1.0",
11+
"@lwc/sfdc-lwc-compiler": "^11.1.0",
12+
"@lwrjs/api": "0.15.6",
1313
"@oclif/core": "^4.0.30",
1414
"@salesforce/core": "^8.6.2",
1515
"@salesforce/kit": "^3.1.6",
1616
"@salesforce/lwc-dev-mobile-core": "4.0.0-alpha.9",
1717
"@salesforce/sf-plugins-core": "^11.2.4",
1818
"axios": "^1.7.7",
1919
"glob": "^10.4.5",
20-
"lwc": "^8.2.0",
21-
"lwr": "0.15.0-alpha.44",
20+
"lwc": "^8.10.1",
2221
"node-fetch": "^3.3.2"
2322
},
2423
"devDependencies": {
@@ -27,14 +26,14 @@
2726
"@salesforce/dev-scripts": "^10.2.10",
2827
"@salesforce/plugin-command-reference": "^3.1.34",
2928
"@types/node-fetch": "^2.6.11",
30-
"eslint-plugin-sf-plugin": "^1.20.1",
29+
"eslint-plugin-sf-plugin": "^1.20.13",
3130
"esmock": "^2.6.7",
3231
"oclif": "^4.15.28",
3332
"ts-node": "^10.9.2",
3433
"typescript": "^5.5.4"
3534
},
3635
"engines": {
37-
"node": ">=18.0.0 <23"
36+
"node": ">=18.0.0"
3837
},
3938
"files": [
4039
"/lib",
@@ -220,7 +219,7 @@
220219
"comment": "Refer to ApiVersionMetadata in orgUtils.ts for details",
221220
"target": {
222221
"versionNumber": "63.0",
223-
"matchingDevServerVersion": "^10.7.4"
222+
"matchingDevServerVersion": "^11.1.0"
224223
},
225224
"versionToTagMappings": [
226225
{

src/commands/lightning/dev/site.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default class LightningDevSite extends SfCommand<void> {
8383
const startupParams: LocalDevOptions = {
8484
sfCLI: true,
8585
authToken,
86-
open: true,
86+
open: process.env.OPEN_BROWSER === 'false' ? false : true,
8787
port,
8888
logLevel: 'error',
8989
mode: 'dev',

src/shared/experience/expSite.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export class ExperienceSite {
3737
this.org = org;
3838
this.siteDisplayName = siteName.trim();
3939
this.siteName = this.siteDisplayName.replace(' ', '_');
40+
// Replace any special characters in site name with underscore
41+
this.siteName = this.siteName.replace(/[^a-zA-Z0-9]/g, '_');
4042
}
4143

4244
/**

test/spec/expSite.test.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright (c) 2023, 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+
import { expect } from 'chai';
8+
import { Connection, Org } from '@salesforce/core';
9+
import sinon from 'sinon';
10+
import { ExperienceSite } from '../../src/shared/experience/expSite.js';
11+
12+
describe('getRemoteMetadata', () => {
13+
it('should return remote metadata when it exists', async () => {
14+
const org = new Org();
15+
const siteName = 'site@with#special-chars';
16+
const experienceSite = new ExperienceSite(org, siteName);
17+
18+
// Create a mock Connection instance using sinon
19+
const mockConnection = sinon.createStubInstance(Connection);
20+
21+
// Configure the mock to return the desired result when calling query
22+
mockConnection.query.resolves({
23+
done: true,
24+
totalSize: 1,
25+
records: [
26+
{
27+
Name: 'MRT_experience_00DSG00000ECBfZ_0DMSG000001CfA6_site_with_special_chars_10-30_12-47',
28+
LastModifiedDate: '2024-11-12',
29+
},
30+
],
31+
});
32+
33+
// Replace the original connection with the mocked connection
34+
org.getConnection = () => mockConnection;
35+
36+
const remoteMetadata = await experienceSite.getRemoteMetadata();
37+
38+
// Check if the called query matches the expected pattern
39+
const calledQuery = mockConnection.query.args[0][0];
40+
const expectedPattern =
41+
/SELECT Name, LastModifiedDate FROM StaticResource WHERE Name LIKE 'MRT_experience_%_site_with_special_chars/;
42+
expect(calledQuery).to.match(expectedPattern);
43+
44+
expect(remoteMetadata).to.deep.equal({
45+
bundleName: 'MRT_experience_00DSG00000ECBfZ_0DMSG000001CfA6_site_with_special_chars_10-30_12-47',
46+
bundleLastModified: '2024-11-12',
47+
});
48+
});
49+
});

0 commit comments

Comments
 (0)