Skip to content

Commit dd68026

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr/5950
2 parents 0170340 + 107e29c commit dd68026

23 files changed

+1859
-1850
lines changed

.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@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
73+
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
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@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
101+
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v4.32.4
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@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
22+
uses: actions/dependency-review-action@05fe4576374b728f0c523d6a13d64c25081e0803 # v4.8.3

.github/workflows/npm_release_cli.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
- 'packages/**'
1111
workflow_dispatch:
1212

13+
permissions: read-all
14+
1315
env:
1416
NPM_TAG: 'next'
1517

@@ -23,7 +25,7 @@ jobs:
2325

2426
steps:
2527
- name: Harden the runner (Audit all outbound calls)
26-
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
28+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
2729
with:
2830
egress-policy: audit
2931

@@ -62,7 +64,7 @@ jobs:
6264
run: npm pack
6365

6466
- name: Upload npm package artifact
65-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
67+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6668
with:
6769
name: npm-package
6870
path: nativescript-${{steps.npm_version_output.outputs.NPM_VERSION}}.tgz
@@ -80,7 +82,7 @@ jobs:
8082
NPM_TAG: ${{needs.build.outputs.npm_tag}}
8183
steps:
8284
- name: Harden the runner (Audit all outbound calls)
83-
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
85+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
8486
with:
8587
egress-policy: audit
8688

@@ -89,7 +91,7 @@ jobs:
8991
node-version: 22.14.0
9092
registry-url: "https://registry.npmjs.org"
9193

92-
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
94+
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
9395
with:
9496
name: npm-package
9597
path: dist
@@ -131,7 +133,7 @@ jobs:
131133
NPM_VERSION: ${{needs.build.outputs.npm_version}}
132134
steps:
133135
- name: Harden the runner (Audit all outbound calls)
134-
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
136+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
135137
with:
136138
egress-policy: audit
137139

@@ -146,17 +148,28 @@ jobs:
146148
- name: Setup
147149
run: npm i --ignore-scripts --legacy-peer-deps --no-package-lock
148150

149-
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
151+
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
150152
with:
151153
name: npm-package
152154
path: dist
153155

156+
- name: Generate provenance statement
157+
run: |
158+
TGZ_PATH=$(ls dist/nativescript-*.tgz | head -n1)
159+
TGZ_NAME=$(basename "$TGZ_PATH")
160+
TGZ_SHA=$(sha256sum "$TGZ_PATH" | awk '{ print $1 }')
161+
PROV_PATH="dist/${TGZ_NAME%.tgz}.intoto.jsonl"
162+
163+
cat > "$PROV_PATH" <<EOF
164+
{"_type":"https://in-toto.io/Statement/v1","subject":[{"name":"$TGZ_NAME","digest":{"sha256":"$TGZ_SHA"}}],"predicateType":"https://slsa.dev/provenance/v1"}
165+
EOF
166+
154167
- name: Partial Changelog
155168
run: npx conventional-changelog -p angular -r2 > body.md
156169

157170
- uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
158171
with:
159-
artifacts: "dist/nativescript-*.tgz"
172+
artifacts: "dist/nativescript-*.tgz,dist/nativescript-*.intoto.jsonl"
160173
bodyFile: "body.md"
161174
prerelease: ${{needs.build.outputs.npm_tag != 'latest'}}
162175
allowUpdates: true

.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@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
27+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
2828
with:
2929
egress-policy: audit
3030

.github/workflows/scorecard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
# - you want to enable the Branch-Protection check on a *public* repository, or
4747
# - you are installing Scorecards on a *private* repository
4848
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
49-
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
49+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
5050

5151
# Public repositories:
5252
# - Publish results to OpenSSF REST API for easy access by consumers
@@ -60,14 +60,14 @@ jobs:
6060
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6161
# format to the repository Actions tab.
6262
- name: "Upload artifact"
63-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
63+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6464
with:
6565
name: SARIF file
6666
path: results.sarif
6767
retention-days: 5
6868

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

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
## [9.0.5](https://github.com/NativeScript/nativescript-cli/compare/v9.0.4...v9.0.5) (2026-03-06)
2+
3+
4+
### Security
5+
6+
* CWE-1333, CWE-78 ([#5976](https://github.com/NativeScript/nativescript-cli/issues/5976)) ([3942566](https://github.com/NativeScript/nativescript-cli/commit/3942566f78d2d21fccae2ec6f313f29cec92ea11))
7+
8+
9+
10+
## [9.0.4](https://github.com/NativeScript/nativescript-cli/compare/v9.0.3...v9.0.4) (2026-02-27)
11+
12+
13+
### Bug Fixes
14+
15+
* file watcher with chokidar ([#5973](https://github.com/NativeScript/nativescript-cli/issues/5973)) ([92ec091](https://github.com/NativeScript/nativescript-cli/commit/92ec091d54d4621e0685ea119527f02111f72056))
16+
* **security:** CVE-2025-13465, CVE-2026-27904, CVE-2026-26996, CVE-2025-59433 ([#5974](https://github.com/NativeScript/nativescript-cli/issues/5974)) ([c4064c9](https://github.com/NativeScript/nativescript-cli/commit/c4064c9d52bbc2b7faff35e2bea8d109b1c170be))
17+
* visionos overrides for build flags ([#5967](https://github.com/NativeScript/nativescript-cli/issues/5967)) ([895ceb8](https://github.com/NativeScript/nativescript-cli/commit/895ceb8567ee139147643c43760487d46882f717))
18+
* **widget:** handle configs with other SPMPackages ([#5972](https://github.com/NativeScript/nativescript-cli/issues/5972)) ([03ff1dc](https://github.com/NativeScript/nativescript-cli/commit/03ff1dcaf98b917cbd65c6739871a7be7a224c4b))
19+
20+
21+
## [9.0.3](https://github.com/NativeScript/nativescript-cli/compare/v9.0.2...v9.0.3) (2026-02-01)
22+
23+
24+
### Bug Fixes
25+
26+
* allow app spm to "override" plugin spm packages ([#5951](https://github.com/NativeScript/nativescript-cli/issues/5951)) ([33d44b5](https://github.com/NativeScript/nativescript-cli/commit/33d44b58af3f267168544b3f80719d4a1c607672))
27+
* **vite:** incremental build file changes ([#5952](https://github.com/NativeScript/nativescript-cli/issues/5952)) ([9013634](https://github.com/NativeScript/nativescript-cli/commit/90136342348e9009d9f71ddab99c05a3d9e86775))
28+
* **workspaces:** duplicate added frameworks ([#5949](https://github.com/NativeScript/nativescript-cli/issues/5949)) ([768a97c](https://github.com/NativeScript/nativescript-cli/commit/768a97cafeefc414a56697d1a4550115cb9cfc51))
29+
30+
31+
132
## [9.0.2](https://github.com/NativeScript/nativescript-cli/compare/v9.0.1...v9.0.2) (2026-01-04)
233

334

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ Get it using: `npm install -g nativescript`
4444
- [Extending the CLI](#extending-the-cli)
4545
- [Troubleshooting](#troubleshooting)
4646
- [How to Contribute](#how-to-contribute)
47+
- [Scorecard Maintenance](#scorecard-maintenance)
48+
- [1) Branch-Protection check (`?`) in Scorecard workflow](#1-branch-protection-check--in-scorecard-workflow)
49+
- [2) Required branch/ruleset settings for higher Branch-Protection and Code-Review](#2-required-branchruleset-settings-for-higher-branch-protection-and-code-review)
50+
- [3) Keep Token-Permissions high](#3-keep-token-permissions-high)
51+
- [4) Signed-Releases check](#4-signed-releases-check)
52+
- [5) Vulnerabilities check](#5-vulnerabilities-check)
4753
- [How to Build](#how-to-build)
4854
- [Get Help](#get-help)
4955
- [License](#license)
@@ -344,6 +350,49 @@ To learn how to contribute to the code base, click [here](https://github.com/Nat
344350

345351
[Back to Top][1]
346352

353+
Scorecard Maintenance
354+
===
355+
356+
This repository tracks OpenSSF Scorecard. Use this checklist when score drops or checks become inconclusive.
357+
358+
### 1) Branch-Protection check (`?`) in Scorecard workflow
359+
360+
- Ensure `.github/workflows/scorecard.yml` uses `repo_token: ${{ secrets.SCORECARD_TOKEN }}`.
361+
- Set `SCORECARD_TOKEN` as a repository Actions secret.
362+
- If using a fine-grained PAT, set expiration to **366 days or less** (NativeScript org policy).
363+
- If Branch-Protection still reports token incompatibility, use a PAT type compatible with Scorecard's Branch-Protection query path.
364+
365+
### 2) Required branch/ruleset settings for higher Branch-Protection and Code-Review
366+
367+
Apply to `main` and release branches:
368+
369+
- Prevent force push and prevent branch deletion.
370+
- Require pull request before merge.
371+
- Require status checks to pass before merge.
372+
- Require at least 2 approvals.
373+
- Require code owner review.
374+
- Dismiss stale approvals when new commits are pushed.
375+
- Include administrators.
376+
377+
### 3) Keep Token-Permissions high
378+
379+
- Set top-level workflow permissions to read-only (for example `permissions: read-all`).
380+
- Grant write permissions only at job level and only when needed (for example publish/release jobs).
381+
- Keep GitHub Actions pinned to full commit SHAs.
382+
383+
### 4) Signed-Releases check
384+
385+
- Publish release assets with provenance/signature files.
386+
- Keep release workflow attaching `*.intoto.jsonl` artifacts alongside release bundles.
387+
388+
### 5) Vulnerabilities check
389+
390+
- Keep runtime dependency vulnerabilities near zero.
391+
- Run `npm audit --omit=dev` before release PRs.
392+
- Update vulnerable dependencies quickly; for non-applicable findings, document and track mitigation clearly.
393+
394+
[Back to Top][1]
395+
347396
How to Build
348397
===
349398
```

lib/commands/widget.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as plist from "plist";
88
import { injector } from "../common/yok";
99
import { capitalizeFirstLetter } from "../common/utils";
1010
import { EOL } from "os";
11-
import { SupportedConfigValues } from "../tools/config-manipulation/config-transformer";
1211

1312
export class WidgetCommand implements ICommand {
1413
public allowedParameters: ICommandParameter[] = [];
@@ -219,10 +218,7 @@ public struct ${capitalizeFirstLetter(name)}Model: ActivityAttributes {
219218
}
220219

221220
configData.ios.SPMPackages = spmPackages;
222-
await this.$projectConfigService.setValue(
223-
"", // root
224-
configData as { [key: string]: SupportedConfigValues },
225-
);
221+
await this.$projectConfigService.setValue("ios.SPMPackages", spmPackages);
226222

227223
if (fs.existsSync(gitIgnorePath)) {
228224
const gitIgnore = fs.readFileSync(gitIgnorePath, {

lib/common/file-system.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { EOL } from "os";
1818
import * as detectNewline from "detect-newline";
1919
import { IFileSystem, IReadFileOptions, IFsStats } from "./declarations";
2020
import { IInjector } from "./definitions/yok";
21-
import { create as createArchiver } from "archiver";
21+
import * as yazl from "yazl";
2222

2323
// TODO: Add .d.ts for mkdirp module (or use it from @types repo).
2424
const mkdirp = require("mkdirp");
@@ -37,28 +37,24 @@ export class FileSystem implements IFileSystem {
3737
): Promise<void> {
3838
//we are resolving it here instead of in the constructor, because config has dependency on file system and config shouldn't require logger
3939
const $logger = this.$injector.resolve("logger");
40-
const zip = createArchiver("zip", {
41-
zlib: {
42-
level: 9,
43-
},
44-
});
40+
const zip = new yazl.ZipFile();
4541
const outFile = fs.createWriteStream(zipFile);
46-
zip.pipe(outFile);
42+
43+
for (const file of files) {
44+
let relativePath = zipPathCallback(file);
45+
relativePath = relativePath.replace(/\\/g, "/");
46+
$logger.trace("zipping as '%s' file '%s'", relativePath, file);
47+
zip.addFile(file, relativePath, { compress: true });
48+
}
49+
zip.end();
4750

4851
return new Promise<void>((resolve, reject) => {
4952
outFile.on("error", (err: Error) => reject(err));
53+
zip.outputStream.on("error", (err: Error) => reject(err));
54+
zip.outputStream.pipe(outFile);
5055
outFile.on("close", () => {
51-
$logger.trace("zip: %d bytes written", zip.pointer());
5256
resolve();
5357
});
54-
55-
for (const file of files) {
56-
let relativePath = zipPathCallback(file);
57-
relativePath = relativePath.replace(/\\/g, "/");
58-
$logger.trace("zipping as '%s' file '%s'", relativePath, file);
59-
zip.append(fs.createReadStream(file), { name: relativePath });
60-
}
61-
zip.finalize();
6258
});
6359
}
6460

0 commit comments

Comments
 (0)