Skip to content

Commit 75dd54c

Browse files
committed
Merge remote-tracking branch 'nativescript/main'
# Conflicts: # apps/automated/nativescript.config.ts # apps/automated/package.json # apps/toolbox/nativescript.config.ts # apps/toolbox/package.json # apps/toolbox/src/pages/box-shadow.ts # nx.json # package-lock.json # package.json # packages/core/application/application-common.ts # packages/core/application/application-interfaces.ts # packages/core/application/application.android.ts # packages/core/application/application.ios.ts # packages/core/application/helpers.android.ts # packages/core/connectivity/index.android.ts # packages/core/core-types/index.ts # packages/core/core-types/validators.ts # packages/core/data/observable/index.ts # packages/core/image-asset/image-asset-common.ts # packages/core/platforms/android/widgets-release.aar # packages/core/references.d.ts # packages/core/tsconfig.lib.json # packages/core/ui/animation/index.d.ts # packages/core/ui/button/index.android.ts # packages/core/ui/core/view/index.android.ts # packages/core/ui/core/view/index.ios.ts # packages/core/ui/core/view/view-common.ts # packages/core/ui/core/view/view-helper/view-helper-common.ts # packages/core/ui/frame/fragment.transitions.android.ts # packages/core/ui/frame/index.android.ts # packages/core/ui/frame/index.ios.ts # packages/core/ui/label/index.android.ts # packages/core/ui/page/index.android.ts # packages/core/ui/scroll-view/index.ios.ts # packages/core/ui/styling/background-common.ts # packages/core/ui/styling/style-properties.ts # packages/core/ui/tab-view/index.ios.ts # packages/core/ui/text-base/index.android.ts # packages/core/ui/text-base/index.d.ts # packages/core/ui/text-base/text-base-common.ts # packages/types-android/src/lib/android/org.nativescript.widgets.d.ts # packages/ui-mobile-base/android/build.gradle # packages/ui-mobile-base/android/gradle/wrapper/gradle-wrapper.properties # packages/ui-mobile-base/android/widgets/build.gradle # packages/ui-mobile-base/android/widgets/src/main/AndroidManifest.xml # packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/BorderDrawable.java # packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/BoxShadowDrawable.java # packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/LayoutBase.java # packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/Utils.java # packages/webpack5/package-lock.json # packages/webpack5/src/transformers/NativeClass/index.ts
2 parents 18d0f99 + 2f2f948 commit 75dd54c

File tree

314 files changed

+30310
-1577
lines changed

Some content is hidden

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

314 files changed

+30310
-1577
lines changed

.github/workflows/apps_automated_android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2323

2424

25-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
25+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2626
with:
2727
node-version: 23.5.0
2828

.github/workflows/apps_automated_ios.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# - name: ActionDebugger By Warpbuild
2626
# uses: Warpbuilds/[email protected]
2727

28-
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
28+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2929
with:
3030
node-version: 23.5.0
3131

.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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2121
- name: 'Dependency Review'
22-
uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0
22+
uses: actions/dependency-review-action@40c09b7dc99638e5ddb0bfd91c1673effc064d8a # v4.8.1

.github/workflows/ossf-scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6565
# format to the repository Actions tab.
6666
- name: "Upload artifact"
67-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
67+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
6868
with:
6969
name: SARIF file
7070
path: results.sarif
@@ -73,6 +73,6 @@ jobs:
7373
# Upload the results to GitHub's code scanning dashboard (optional).
7474
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7575
- name: "Upload to code-scanning"
76-
uses: github/codeql-action/upload-sarif@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.30.0
76+
uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
7777
with:
7878
sarif_file: results.sarif
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Release Workflow
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dist-tag:
7+
description: "npm dist-tag to use (e.g. latest | next | canary)"
8+
required: false
9+
type: string
10+
default: next
11+
dry-run:
12+
description: "Run release steps without making changes (no git push, no publish)"
13+
required: false
14+
type: boolean
15+
default: false
16+
release-group:
17+
description: "Optional Nx release group or project to scope the release (empty = default behavior)"
18+
required: false
19+
type: string
20+
default: ""
21+
22+
concurrency:
23+
# Avoid overlapping publishes on the same ref/branch
24+
group: nx-release-${{ github.ref }}
25+
cancel-in-progress: false
26+
27+
permissions:
28+
contents: write # needed to push version commits and tags
29+
pull-requests: write # for changelog PRs/comments if Nx uses them
30+
id-token: write # required for npm provenance (OIDC)
31+
32+
jobs:
33+
release:
34+
name: Version and Publish (gated by environment)
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: ${{ inputs['dry-run'] == 'true' && 'npm-publish-dry-run' || 'npm-publish' }}
38+
39+
env:
40+
# Default dist-tag if not provided via workflow_dispatch input
41+
NPM_DIST_TAG: ${{ inputs['dist-tag'] || 'next' }}
42+
# Optional: provide Nx Cloud token if used in this repo
43+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
44+
45+
steps:
46+
- name: Harden the runner (Audit all outbound calls)
47+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
48+
with:
49+
egress-policy: audit
50+
51+
- name: Checkout repository (full history for tagging)
52+
uses: actions/checkout@v4
53+
with:
54+
fetch-depth: 0
55+
56+
- name: Setup Node.js
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: '24'
60+
registry-url: 'https://registry.npmjs.org'
61+
cache: 'npm'
62+
63+
- name: Install dependencies
64+
run: npm ci
65+
66+
- name: Repo setup
67+
run: npm run setup
68+
69+
# Collect a one-time password (OTP) from a reviewer via the environment approval gate.
70+
- id: wait_for_otp
71+
name: Wait for npm OTP (2FA)
72+
if: ${{ inputs['dry-run'] != 'true' }}
73+
uses: step-security/wait-for-secrets@v2
74+
with:
75+
secrets: |
76+
NPM_OTP
77+
timeout-minutes: 30
78+
79+
- name: Configure npm auth
80+
if: ${{ inputs['dry-run'] != 'true' }}
81+
env:
82+
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
83+
run: |
84+
test -n "$NPM_TOKEN" || { echo "NPM_PUBLISH_TOKEN secret is required"; exit 1; }
85+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
86+
87+
- name: Configure git user for automated commits
88+
run: |
89+
git config user.name "github-actions[bot]"
90+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
91+
92+
# VERSION: updates versions, changelogs, creates git tags following nx.json releaseTag pattern.
93+
- name: nx release version
94+
if: ${{ inputs['dry-run'] != 'true' }}
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
NX_GROUP_ARG: ${{ inputs['release-group'] != '' && format('--group {0}', inputs['release-group']) || '' }}
98+
run: |
99+
npx nx release version ${NX_GROUP_ARG} --yes --verbose
100+
101+
- name: nx release version (dry-run)
102+
if: ${{ inputs['dry-run'] == 'true' }}
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
NX_GROUP_ARG: ${{ inputs['release-group'] != '' && format('--group {0}', inputs['release-group']) || '' }}
106+
run: |
107+
npx nx release version ${NX_GROUP_ARG} --yes --verbose --dry-run
108+
109+
# Ensure version commits and tags are pushed if version step created them.
110+
- name: Push version commits and tags
111+
if: ${{ inputs['dry-run'] != 'true' }}
112+
run: |
113+
# Push commits (if any) and tags created by Nx Release
114+
git push --follow-tags || true
115+
116+
# PUBLISH: perform npm publish using Nx Release, with 2FA OTP and provenance.
117+
- name: nx release publish
118+
if: ${{ inputs['dry-run'] != 'true' }}
119+
env:
120+
NPM_CONFIG_OTP: ${{ steps.wait_for_otp.outputs.NPM_OTP }}
121+
# For npm provenance via OIDC
122+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
123+
env:
124+
NX_GROUP_ARG: ${{ inputs['release-group'] != '' && format('--group {0}', inputs['release-group']) || '' }}
125+
run: |
126+
test -n "$NPM_CONFIG_OTP" || { echo "Missing NPM OTP from environment approval"; exit 1; }
127+
# Use Nx Release to publish all changed packages; tag controls npm dist-tag; provenance enables supply chain attestations
128+
npx nx release publish ${NX_GROUP_ARG} --tag "$NPM_DIST_TAG" --provenance --yes --verbose
129+
130+
- name: nx release publish (dry-run)
131+
if: ${{ inputs['dry-run'] == 'true' }}
132+
env:
133+
NX_GROUP_ARG: ${{ inputs['release-group'] != '' && format('--group {0}', inputs['release-group']) || '' }}
134+
run: |
135+
npx nx release publish ${NX_GROUP_ARG} --tag "$NPM_DIST_TAG" --provenance --yes --verbose --dry-run
136+
137+
- name: Summary
138+
if: always()
139+
run: |
140+
echo "Nx Release completed."
141+
echo "- dist-tag: $NPM_DIST_TAG"
142+
echo "- release-group: '${{ inputs['release-group'] }}'"
143+
echo "- dry-run: ${{ inputs['dry-run'] }}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/dist
55
/tmp
66
/out-tsc
7+
.ns-vite-build
78

89
# dependencies
910
**/node_modules

apps/automated/nativescript.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ export default {
77
android: {
88
v8Flags: '--expose_gc',
99
},
10+
cli: {
11+
packageManager: 'yarn',
12+
additionalPathsToClean: ['.ns-vite-build'],
13+
},
14+
// bundler: 'vite',
15+
// bundlerConfigPath: 'vite.config.ts',
1016
} as NativeScriptConfig;

apps/automated/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@nativescript/android": "*",
1515
"@nativescript/ios": "*",
1616
"@nativescript/visionos": "*",
17+
"@nativescript/vite": "*",
1718
"@nativescript/webpack": "*",
1819
"circular-dependency-plugin": "^5.2.2",
1920
"typescript": "~5.8.0"

apps/automated/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@
7373
}
7474
}
7575
},
76-
"implicitDependencies": ["webpack5"]
76+
"implicitDependencies": ["webpack5", "vite"]
7777
}

apps/automated/src/app-root.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Application, Frame, Page } from '@nativescript/core';
2+
3+
export function onLoaded(args) {
4+
try {
5+
console.log('[automated] app-root onLoaded');
6+
const rootPage = args.object as Page;
7+
// Create a Frame and navigate to main-page to ensure code-behind is bound
8+
const frame = new Frame();
9+
try {
10+
frame.navigate('main-page');
11+
} catch (e) {
12+
try {
13+
console.error('[automated] app-root onLoaded: navigate to main-page failed', e);
14+
} catch {}
15+
}
16+
// Replace the temporary Page root with the Frame containing the page
17+
try {
18+
if ((Application as any).resetRootView) {
19+
(Application as any).resetRootView({ create: () => frame });
20+
}
21+
} catch (e) {
22+
try {
23+
console.error('[automated] app-root onLoaded: resetRootView failed', e);
24+
} catch {}
25+
}
26+
} catch (e) {
27+
try {
28+
console.error('[automated] app-root onLoaded failed', e);
29+
} catch {}
30+
}
31+
}

0 commit comments

Comments
 (0)