Skip to content

Commit d7eb2b2

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/bundler-config
2 parents e502c0b + a1c39f6 commit d7eb2b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4797
-6961
lines changed

.github/dependabot.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
8+
- package-ecosystem: npm
9+
directory: /
10+
schedule:
11+
interval: monthly
12+
time: "23:00"
13+
open-pull-requests-limit: 10
14+
ignore:
15+
- dependency-name: "*"
16+
update-types: ["version-update:semver-major"]
17+
18+
- package-ecosystem: npm
19+
directory: /packages/doctor
20+
schedule:
21+
interval: monthly
22+
time: "23:00"
23+
open-pull-requests-limit: 10
24+
ignore:
25+
- dependency-name: "*"
26+
update-types: ["version-update:semver-major"]
27+
28+
- package-ecosystem: npm
29+
directory: /packages/nativescript-envinfo
30+
schedule:
31+
interval: monthly
32+
time: "23:00"
33+
open-pull-requests-limit: 10
34+
ignore:
35+
- dependency-name: "*"
36+
update-types: ["version-update:semver-major"]
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: [ "main", "release" ]
17+
pull_request:
18+
branches: [ "main", "release" ]
19+
schedule:
20+
- cron: '21 2 * * 1'
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
analyze:
27+
name: Analyze (${{ matrix.language }})
28+
# Runner size impacts CodeQL analysis time. To learn more, please see:
29+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
30+
# - https://gh.io/supported-runners-and-hardware-resources
31+
# - https://gh.io/using-larger-runners (GitHub.com only)
32+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
33+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
34+
permissions:
35+
# required for all workflows
36+
security-events: write
37+
38+
# required to fetch internal or private CodeQL packs
39+
packages: read
40+
41+
# only required for workflows in private repositories
42+
actions: read
43+
contents: read
44+
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
include:
49+
- language: actions
50+
build-mode: none
51+
- language: javascript-typescript
52+
build-mode: none
53+
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
54+
# Use `c-cpp` to analyze code written in C, C++ or both
55+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
56+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
57+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
58+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
59+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
60+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
64+
65+
# Add any setup steps before running the `github/codeql-action/init` action.
66+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
67+
# or others). This is typically only required for manual builds.
68+
# - name: Setup runtime (example)
69+
# uses: actions/setup-example@v1
70+
71+
# Initializes the CodeQL tools for scanning.
72+
- name: Initialize CodeQL
73+
uses: github/codeql-action/init@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3.30.2
74+
with:
75+
languages: ${{ matrix.language }}
76+
build-mode: ${{ matrix.build-mode }}
77+
# If you wish to specify custom queries, you can do so here or in a config file.
78+
# By default, queries listed here will override any specified in a config file.
79+
# Prefix the list here with "+" to use these queries and those in the config file.
80+
81+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
82+
# queries: security-extended,security-and-quality
83+
84+
# If the analyze step fails for one of the languages you are analyzing with
85+
# "We were unable to automatically build your code", modify the matrix above
86+
# to set the build mode to "manual" for that language. Then modify this step
87+
# to build your code.
88+
# ℹ️ Command-line programs to run using the OS shell.
89+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
90+
- if: matrix.build-mode == 'manual'
91+
shell: bash
92+
run: |
93+
echo 'If you are using a "manual" build mode for one or more of the' \
94+
'languages you are analyzing, replace this with the commands to build' \
95+
'your code, for example:'
96+
echo ' make bootstrap'
97+
echo ' make release'
98+
exit 1
99+
100+
- name: Perform CodeQL Analysis
101+
uses: github/codeql-action/analyze@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3.30.2
102+
with:
103+
category: "/language:${{matrix.language}}"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: 'Dependency Review'
10+
on: [pull_request]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
dependency-review:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: 'Checkout Repository'
20+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.3.0
21+
- name: 'Dependency Review'
22+
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3

.github/workflows/npm_release_cli.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,23 @@ on:
1010
env:
1111
NPM_TAG: 'next'
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
release:
1518
runs-on: macos-latest
1619

1720
steps:
18-
- uses: actions/checkout@v2
21+
22+
- name: Harden the runner (Audit all outbound calls)
23+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
24+
with:
25+
egress-policy: audit
26+
27+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
1928

20-
- uses: actions/setup-node@v3
29+
- uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1
2130
with:
2231
node-version: 22.14.0
2332

.github/workflows/npm_release_doctor.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,21 @@ defaults:
1414
env:
1515
NPM_TAG: 'next'
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
release:
1922
runs-on: ubuntu-latest
2023

2124
steps:
22-
- uses: actions/checkout@v2
25+
26+
- name: Harden the runner (Audit all outbound calls)
27+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
28+
with:
29+
egress-policy: audit
30+
31+
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
2332

2433
- name: Setup
2534
run: npm install

.github/workflows/scorecard.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
8+
schedule:
9+
- cron: '20 7 * * 2'
10+
push:
11+
branches: ["main"]
12+
13+
# Declare default permissions as read only.
14+
permissions: read-all
15+
16+
jobs:
17+
analysis:
18+
name: Scorecard analysis
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# Needed to upload the results to code-scanning dashboard.
22+
security-events: write
23+
# Needed to publish results and get a badge (see publish_results below).
24+
id-token: write
25+
contents: read
26+
actions: read
27+
# To allow GraphQL ListCommits to work
28+
issues: read
29+
pull-requests: read
30+
# To detect SAST tools
31+
checks: read
32+
33+
steps:
34+
35+
- name: "Checkout code"
36+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.3.0
37+
with:
38+
persist-credentials: false
39+
40+
- name: "Run analysis"
41+
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
42+
with:
43+
results_file: results.sarif
44+
results_format: sarif
45+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
46+
# - you want to enable the Branch-Protection check on a *public* repository, or
47+
# - you are installing Scorecards on a *private* repository
48+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
49+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
50+
51+
# Public repositories:
52+
# - Publish results to OpenSSF REST API for easy access by consumers
53+
# - Allows the repository to include the Scorecard badge.
54+
# - See https://github.com/ossf/scorecard-action#publishing-results.
55+
# For private repositories:
56+
# - `publish_results` will always be set to `false`, regardless
57+
# of the value entered here.
58+
publish_results: true
59+
60+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
61+
# format to the repository Actions tab.
62+
- name: "Upload artifact"
63+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
64+
with:
65+
name: SARIF file
66+
path: results.sarif
67+
retention-days: 5
68+
69+
# Upload the results to GitHub's code scanning dashboard.
70+
- name: "Upload to code-scanning"
71+
uses: github/codeql-action/upload-sarif@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.30.0
72+
with:
73+
sarif_file: results.sarif

Gruntfile.js

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const childProcess = require("child_process");
22
const EOL = require("os").EOL;
33
const path = require("path");
44
const now = new Date().toISOString();
5-
const latestVersion = require('latest-version').default;
5+
const manifest = require('pacote').manifest;
66

77

88
const ENVIRONMENTS = {
@@ -248,15 +248,38 @@ function registerTestingDependenciesTasks(grunt) {
248248
const generatedVersionFilePath = path.join(configsBasePath, "test-deps-versions-generated.json");
249249

250250
grunt.registerTask("generate_unit_testing_dependencies", async function () {
251-
var done = this.async();
251+
const done = this.async();
252+
252253
const dependenciesVersions = {};
253-
const testDependencies = grunt.file.readJSON(path.join(configsBasePath, "test-dependencies.json"));
254-
for (var dependency of testDependencies) {
255-
const dependencyVersion = dependency.version || await latestVersion(dependency.name);
256-
dependenciesVersions[dependency.name] = dependencyVersion;
254+
let testDependencies;
255+
256+
try {
257+
testDependencies = grunt.file.readJSON(path.join(configsBasePath, "test-dependencies.json"));
258+
} catch (err) {
259+
grunt.log.error("Could not read test-dependencies.json:", err);
260+
return done(false);
257261
}
258-
grunt.file.write(generatedVersionFilePath, JSON.stringify(dependenciesVersions));
259-
done();
262+
263+
(async () => {
264+
try {
265+
for (const dep of testDependencies) {
266+
if (dep.version) {
267+
dependenciesVersions[dep.name] = dep.version;
268+
} else {
269+
dependenciesVersions[dep.name] = await latestVersion(dep.name);
270+
}
271+
}
272+
grunt.file.write(
273+
generatedVersionFilePath,
274+
JSON.stringify(dependenciesVersions, null, 2)
275+
);
276+
grunt.log.writeln("Wrote", generatedVersionFilePath);
277+
done();
278+
} catch (err) {
279+
grunt.log.error(err);
280+
done(false);
281+
}
282+
})();
260283
});
261284

262285
grunt.registerTask("verify_unit_testing_dependencies", function () {
@@ -266,3 +289,9 @@ function registerTestingDependenciesTasks(grunt) {
266289
});
267290
}
268291

292+
async function latestVersion(name) {
293+
// only fetches the package.json for the latest dist-tag
294+
const { version } = await manifest(name.toLowerCase(), { fullMetadata: false });
295+
return version;
296+
}
297+

0 commit comments

Comments
 (0)