Skip to content

Commit 32acd6f

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/vite-bundler-improvements
2 parents 2e2d974 + 7d540b6 commit 32acd6f

12 files changed

Lines changed: 106 additions & 71 deletions

.github/workflows/codeql-advanced.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070

7171
# Initializes the CodeQL tools for scanning.
7272
- name: Initialize CodeQL
73-
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
73+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
7474
with:
7575
languages: ${{ matrix.language }}
7676
build-mode: ${{ matrix.build-mode }}
@@ -98,6 +98,6 @@ jobs:
9898
exit 1
9999
100100
- name: Perform CodeQL Analysis
101-
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
101+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
102102
with:
103103
category: "/language:${{matrix.language}}"

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: 'Checkout Repository'
2020
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4.3.0
2121
- name: 'Dependency Review'
22-
uses: actions/dependency-review-action@05fe4576374b728f0c523d6a13d64c25081e0803 # v4.8.3
22+
uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0

.github/workflows/npm_release_cli.yml

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ on:
99
paths-ignore:
1010
- 'packages/**'
1111
workflow_dispatch:
12+
inputs:
13+
release_type:
14+
description: 'Release type. "dev" publishes a -next prerelease without bumping package.json. patch/minor/major/prerelease bump package.json, commit + tag to main, then publish as a stable release.'
15+
type: choice
16+
options:
17+
- dev
18+
- patch
19+
- minor
20+
- major
21+
- prerelease
22+
default: patch
1223

1324
permissions: read-all
1425

@@ -19,19 +30,23 @@ jobs:
1930
build:
2031
name: Build
2132
runs-on: macos-latest
33+
permissions:
34+
contents: write
2235
outputs:
2336
npm_version: ${{ steps.npm_version_output.outputs.NPM_VERSION }}
2437
npm_tag: ${{ steps.npm_version_output.outputs.NPM_TAG }}
38+
is_release: ${{ steps.npm_version_output.outputs.IS_RELEASE }}
2539

2640
steps:
2741
- name: Harden the runner (Audit all outbound calls)
28-
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
42+
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
2943
with:
3044
egress-policy: audit
3145

3246
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3347
with:
3448
fetch-depth: 0
49+
token: ${{ secrets.GITHUB_TOKEN }}
3550

3651
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
3752
with:
@@ -46,8 +61,18 @@ jobs:
4661
NPM_VERSION=$(node -e "console.log(require('./package.json').version);")
4762
echo NPM_VERSION=$NPM_VERSION >> $GITHUB_ENV
4863
64+
- name: Bump, commit and tag stable release (manual dispatch)
65+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_type != 'dev' }}
66+
run: |
67+
git config user.name "github-actions[bot]"
68+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
69+
npm version ${{ inputs.release_type }} -m "chore: release v%s"
70+
NPM_VERSION=$(node -e "console.log(require('./package.json').version);")
71+
echo NPM_VERSION=$NPM_VERSION >> $GITHUB_ENV
72+
git push origin HEAD:${GITHUB_REF_NAME} --follow-tags
73+
4974
- name: Bump version for dev release
50-
if: ${{ !contains(github.ref, 'refs/tags/') }}
75+
if: ${{ !contains(github.ref, 'refs/tags/') && (github.event_name != 'workflow_dispatch' || inputs.release_type == 'dev') }}
5176
run: |
5277
NPM_VERSION=$(node ./scripts/get-next-version.js)
5378
echo NPM_VERSION=$NPM_VERSION >> $GITHUB_ENV
@@ -57,8 +82,14 @@ jobs:
5782
id: npm_version_output
5883
run: |
5984
NPM_TAG=$(node ./scripts/get-npm-tag.js)
85+
if [[ "${GITHUB_REF}" == refs/tags/* ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.release_type }}" != "dev" ]]; then
86+
IS_RELEASE=true
87+
else
88+
IS_RELEASE=false
89+
fi
6090
echo NPM_VERSION=$NPM_VERSION >> $GITHUB_OUTPUT
6191
echo NPM_TAG=$NPM_TAG >> $GITHUB_OUTPUT
92+
echo IS_RELEASE=$IS_RELEASE >> $GITHUB_OUTPUT
6293
6394
- name: Build nativescript
6495
run: npm pack
@@ -82,7 +113,7 @@ jobs:
82113
NPM_TAG: ${{needs.build.outputs.npm_tag}}
83114
steps:
84115
- name: Harden the runner (Audit all outbound calls)
85-
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
116+
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
86117
with:
87118
egress-policy: audit
88119

@@ -91,7 +122,7 @@ jobs:
91122
node-version: 22.14.0
92123
registry-url: "https://registry.npmjs.org"
93124

94-
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
125+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
95126
with:
96127
name: npm-package
97128
path: dist
@@ -123,8 +154,8 @@ jobs:
123154

124155
github-release:
125156
runs-on: ubuntu-latest
126-
# only runs on tagged commits
127-
if: ${{ contains(github.ref, 'refs/tags/') }}
157+
# runs for tag pushes and for manual dispatches that bumped a stable release
158+
if: ${{ needs.build.outputs.is_release == 'true' }}
128159
permissions:
129160
contents: write
130161
needs:
@@ -133,13 +164,14 @@ jobs:
133164
NPM_VERSION: ${{needs.build.outputs.npm_version}}
134165
steps:
135166
- name: Harden the runner (Audit all outbound calls)
136-
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
167+
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
137168
with:
138169
egress-policy: audit
139170

140171
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
141172
with:
142173
fetch-depth: 0
174+
ref: v${{needs.build.outputs.npm_version}}
143175

144176
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
145177
with:
@@ -148,7 +180,7 @@ jobs:
148180
- name: Setup
149181
run: npm i --ignore-scripts --legacy-peer-deps --no-package-lock
150182

151-
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
183+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
152184
with:
153185
name: npm-package
154186
path: dist
@@ -167,8 +199,9 @@ jobs:
167199
- name: Partial Changelog
168200
run: npx conventional-changelog -p angular -r2 > body.md
169201

170-
- uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
202+
- uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
171203
with:
204+
tag: v${{needs.build.outputs.npm_version}}
172205
artifacts: "dist/nativescript-*.tgz,dist/nativescript-*.intoto.jsonl"
173206
bodyFile: "body.md"
174207
prerelease: ${{needs.build.outputs.npm_tag != 'latest'}}

.github/workflows/npm_release_doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525

2626
- name: Harden the runner (Audit all outbound calls)
27-
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
27+
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
2828
with:
2929
egress-policy: audit
3030

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
71+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
7272
with:
7373
sarif_file: results.sarif

lib/common/services/net-service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class Net implements INet {
1818
private $errors: IErrors,
1919
private $childProcess: IChildProcess,
2020
private $logger: ILogger,
21-
private $osInfo: IOsInfo
21+
private $osInfo: IOsInfo,
2222
) {}
2323

2424
public async getFreePort(): Promise<number> {
@@ -82,7 +82,7 @@ export class Net implements INet {
8282

8383
public async getAvailablePortInRange(
8484
startPort: number,
85-
endPort?: number
85+
endPort?: number,
8686
): Promise<number> {
8787
endPort = endPort || 65534;
8888
while (!(await this.isPortAvailable(startPort))) {
@@ -96,7 +96,7 @@ export class Net implements INet {
9696
}
9797

9898
public async waitForPortToListen(
99-
waitForPortListenData: IWaitForPortListenData
99+
waitForPortListenData: IWaitForPortListenData,
100100
): Promise<boolean> {
101101
if (!waitForPortListenData) {
102102
this.$errors.fail("You must pass port and timeout for check.");
@@ -126,8 +126,8 @@ export class Net implements INet {
126126
if (!currentPlatformData) {
127127
this.$errors.fail(
128128
`Unable to check for free ports on ${platform}. Supported platforms are: ${_.keys(
129-
platformData
130-
).join(", ")}`
129+
platformData,
130+
).join(", ")}`,
131131
);
132132
}
133133

lib/device-sockets/ios/app-debug-socket-proxy-factory.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ export class AppDebugSocketProxyFactory
2121
private $lockService: ILockService,
2222
private $options: IOptions,
2323
private $tempService: ITempService,
24-
private $net: INet
24+
private $net: INet,
2525
) {
2626
super();
2727
}
2828

2929
public getTCPSocketProxy(
3030
deviceIdentifier: string,
31-
appId: string
31+
appId: string,
3232
): net.Server {
3333
return this.deviceTcpServers[`${deviceIdentifier}-${appId}`];
3434
}
@@ -37,18 +37,18 @@ export class AppDebugSocketProxyFactory
3737
device: Mobile.IiOSDevice,
3838
appId: string,
3939
projectName: string,
40-
projectDir: string
40+
projectDir: string,
4141
): Promise<net.Server> {
4242
const cacheKey = `${device.deviceInfo.identifier}-${appId}`;
4343
const existingServer = this.deviceTcpServers[cacheKey];
4444
if (existingServer) {
4545
this.$errors.fail(
46-
`TCP socket proxy is already running for device '${device.deviceInfo.identifier}' and app '${appId}'`
46+
`TCP socket proxy is already running for device '${device.deviceInfo.identifier}' and app '${appId}'`,
4747
);
4848
}
4949

5050
this.$logger.info(
51-
"\nSetting up proxy...\nPress Ctrl + C to terminate, or disconnect.\n"
51+
"\nSetting up proxy...\nPress Ctrl + C to terminate, or disconnect.\n",
5252
);
5353

5454
const server = net.createServer({
@@ -69,7 +69,7 @@ export class AppDebugSocketProxyFactory
6969
const appDebugSocket = await device.getDebugSocket(
7070
appId,
7171
projectName,
72-
projectDir
72+
projectDir,
7373
);
7474
this.$logger.info("Backend socket created.");
7575

@@ -112,7 +112,7 @@ export class AppDebugSocketProxyFactory
112112
device: Mobile.IiOSDevice,
113113
appId: string,
114114
projectName: string,
115-
projectDir: string
115+
projectDir: string,
116116
): Promise<ws.Server> {
117117
const existingWebProxy =
118118
this.deviceWebServers[`${device.deviceInfo.identifier}-${appId}`];
@@ -130,22 +130,22 @@ export class AppDebugSocketProxyFactory
130130
device: Mobile.IiOSDevice,
131131
appId: string,
132132
projectName: string,
133-
projectDir: string
133+
projectDir: string,
134134
): Promise<ws.Server> {
135135
let clientConnectionLockRelease: () => void;
136136
const cacheKey = `${device.deviceInfo.identifier}-${appId}`;
137137
const existingServer = this.deviceWebServers[cacheKey];
138138
if (existingServer) {
139139
this.$errors.fail(
140-
`Web socket proxy is already running for device '${device.deviceInfo.identifier}' and app '${appId}'`
140+
`Web socket proxy is already running for device '${device.deviceInfo.identifier}' and app '${appId}'`,
141141
);
142142
}
143143

144144
// NOTE: We will try to provide command line options to select ports, at least on the localhost.
145145
const localPort = await this.$net.getAvailablePortInRange(41000);
146146

147147
this.$logger.info(
148-
"\nSetting up debugger proxy...\nPress Ctrl + C to terminate, or disconnect.\n"
148+
"\nSetting up debugger proxy...\nPress Ctrl + C to terminate, or disconnect.\n",
149149
);
150150

151151
// NB: When the inspector frontend connects we might not have connected to the inspector backend yet.
@@ -159,14 +159,14 @@ export class AppDebugSocketProxyFactory
159159
port: localPort,
160160
verifyClient: async (
161161
info: any,
162-
callback: (res: boolean, code?: number, message?: string) => void
162+
callback: (res: boolean, code?: number, message?: string) => void,
163163
) => {
164164
let acceptHandshake = true;
165165
clientConnectionLockRelease = null;
166166

167167
try {
168168
clientConnectionLockRelease = await this.$lockService.lock(
169-
`debug-connection-${device.deviceInfo.identifier}-${appId}.lock`
169+
`debug-connection-${device.deviceInfo.identifier}-${appId}.lock`,
170170
);
171171

172172
this.$logger.info("Frontend client connected.");
@@ -184,7 +184,7 @@ export class AppDebugSocketProxyFactory
184184
appDebugSocket = await device.getDebugSocket(
185185
appId,
186186
projectName,
187-
projectDir
187+
projectDir,
188188
);
189189
currentAppSocket = appDebugSocket;
190190
this.$logger.info("Backend socket created.");
@@ -198,7 +198,7 @@ export class AppDebugSocketProxyFactory
198198
this.emit(CONNECTION_ERROR_EVENT_NAME, err);
199199
acceptHandshake = false;
200200
this.$logger.warn(
201-
`Cannot connect to device socket. The error message is '${err.message}'.`
201+
`Cannot connect to device socket. The error message is '${err.message}'.`,
202202
);
203203
}
204204

@@ -225,7 +225,7 @@ export class AppDebugSocketProxyFactory
225225
webSocket.send(message);
226226
} else {
227227
this.$logger.trace(
228-
`Received message ${message}, but unable to send it to webSocket as its state is: ${webSocket.readyState}`
228+
`Received message ${message}, but unable to send it to webSocket as its state is: ${webSocket.readyState}`,
229229
);
230230
}
231231
});

0 commit comments

Comments
 (0)