Skip to content

Commit 2c2026b

Browse files
committed
chore: workflow next affected
1 parent 0338d2b commit 2c2026b

File tree

5 files changed

+213
-45
lines changed

5 files changed

+213
-45
lines changed

.github/workflows/secure_nx_release.yml

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ jobs:
251251
fi
252252
253253
# PUBLISH: OIDC trusted publishing (default). Avoid any lingering token auth.
254-
- name: nx release publish (OIDC)
255-
if: ${{ steps.ctx.outputs.mode != 'tag' && steps.ctx.outputs.dry_run != 'true' && vars.USE_NPM_TOKEN != 'true' && (steps.ctx.outputs.mode != 'main' || steps.affected.outputs.count != '0') }}
254+
- name: nx release publish (OIDC, main)
255+
if: ${{ steps.ctx.outputs.mode == 'main' && steps.affected.outputs.count != '0' && vars.USE_NPM_TOKEN != 'true' }}
256256
shell: bash
257257
env:
258258
NPM_CONFIG_PROVENANCE: true
@@ -266,11 +266,39 @@ jobs:
266266
fi
267267
268268
npx nx release publish \
269+
--projects "${{ steps.affected.outputs.projects }}" \
270+
--tag "${{ steps.ctx.outputs.dist_tag }}" \
271+
--access public \
272+
--verbose
273+
274+
- name: nx release publish (OIDC, dispatch)
275+
if: ${{ steps.ctx.outputs.mode == 'dispatch' && steps.ctx.outputs.dry_run != 'true' && vars.USE_NPM_TOKEN != 'true' }}
276+
shell: bash
277+
env:
278+
NPM_CONFIG_PROVENANCE: true
279+
NODE_AUTH_TOKEN: ""
280+
run: |
281+
set -euo pipefail
282+
unset NODE_AUTH_TOKEN
283+
rm -f ~/.npmrc || true
284+
if [[ -n "${NPM_CONFIG_USERCONFIG:-}" ]]; then
285+
rm -f "$NPM_CONFIG_USERCONFIG" || true
286+
fi
287+
288+
scope="${{ steps.ctx.outputs.scope }}"
289+
if [[ -n "$scope" ]]; then
290+
projects_arg="--projects $scope"
291+
else
292+
projects_arg=""
293+
fi
294+
295+
npx nx release publish \
296+
$projects_arg \
269297
--tag "${{ steps.ctx.outputs.dist_tag }}" \
270298
--access public \
271299
--verbose
272300
273-
- name: nx release publish (OIDC, dry-run)
301+
- name: nx release publish (OIDC, dispatch dry-run)
274302
if: ${{ steps.ctx.outputs.mode == 'dispatch' && inputs.dry-run && vars.USE_NPM_TOKEN != 'true' }}
275303
shell: bash
276304
env:
@@ -284,28 +312,60 @@ jobs:
284312
rm -f "$NPM_CONFIG_USERCONFIG" || true
285313
fi
286314
315+
scope="${{ steps.ctx.outputs.scope }}"
316+
if [[ -n "$scope" ]]; then
317+
projects_arg="--projects $scope"
318+
else
319+
projects_arg=""
320+
fi
321+
287322
npx nx release publish \
323+
$projects_arg \
288324
--tag "${{ steps.ctx.outputs.dist_tag }}" \
289325
--access public \
290326
--verbose \
291327
--dry-run
292328
293329
# PUBLISH: token fallback (only when explicitly enabled via repo/environment variable USE_NPM_TOKEN=true).
294-
- name: nx release publish (token)
295-
if: ${{ steps.ctx.outputs.mode != 'tag' && steps.ctx.outputs.dry_run != 'true' && vars.USE_NPM_TOKEN == 'true' && (steps.ctx.outputs.mode != 'main' || steps.affected.outputs.count != '0') }}
330+
- name: nx release publish (token, main)
331+
if: ${{ steps.ctx.outputs.mode == 'main' && steps.affected.outputs.count != '0' && vars.USE_NPM_TOKEN == 'true' }}
332+
env:
333+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
334+
NPM_CONFIG_PROVENANCE: true
335+
run: |
336+
npx nx release publish --projects "${{ steps.affected.outputs.projects }}" --tag "${{ steps.ctx.outputs.dist_tag }}" --access public --verbose
337+
338+
- name: nx release publish (token, dispatch)
339+
if: ${{ steps.ctx.outputs.mode == 'dispatch' && steps.ctx.outputs.dry_run != 'true' && vars.USE_NPM_TOKEN == 'true' }}
340+
shell: bash
296341
env:
297342
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
298343
NPM_CONFIG_PROVENANCE: true
299344
run: |
300-
npx nx release publish --tag "${{ steps.ctx.outputs.dist_tag }}" --access public --verbose
345+
set -euo pipefail
346+
scope="${{ steps.ctx.outputs.scope }}"
347+
if [[ -n "$scope" ]]; then
348+
projects_arg="--projects $scope"
349+
else
350+
projects_arg=""
351+
fi
352+
npx nx release publish $projects_arg --tag "${{ steps.ctx.outputs.dist_tag }}" --access public --verbose
301353
302-
- name: nx release publish (token, dry-run)
354+
- name: nx release publish (token, dispatch dry-run)
303355
if: ${{ steps.ctx.outputs.mode == 'dispatch' && inputs.dry-run && vars.USE_NPM_TOKEN == 'true' }}
356+
shell: bash
304357
env:
305358
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
306359
NPM_CONFIG_PROVENANCE: true
307360
run: |
308-
npx nx release publish --tag "${{ steps.ctx.outputs.dist_tag }}" --access public --verbose --dry-run
361+
set -euo pipefail
362+
scope="${{ steps.ctx.outputs.scope }}"
363+
if [[ -n "$scope" ]]; then
364+
projects_arg="--projects $scope"
365+
else
366+
projects_arg=""
367+
fi
368+
npx nx release publish $projects_arg --tag "${{ steps.ctx.outputs.dist_tag }}" --access public --verbose --dry-run
309369
310370
# Tag-triggered publishing: publish the single package referenced by the tag.
311371
- name: Build project before publish (tag)

packages/vite/README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1-
# @nativescript/vite
2-
3-
Vite bundler integration for NativeScript apps. Provides a minimal setup for fast dev and build.
1+
<p align="center">
2+
<a href="https://nativescript.org">
3+
<img alt="NativeScript" src="https://raw.githubusercontent.com/NativeScript/artwork/main/logo/export/NativeScript_Logo_Dark_Transparent.png" width="100"/>
4+
</a>
5+
</p>
6+
7+
<h1 align="center">@nativescript/vite</h1>
8+
9+
<p align="center">
10+
<b>Vite integration for NativeScript apps.</b>
11+
</p>
12+
13+
<p align="center">
14+
<a href="https://www.npmjs.com/package/@nativescript/vite"><img src="https://img.shields.io/npm/v/@nativescript/vite.svg" alt="npm version"></a>
15+
<a href="https://github.com/NativeScript/NativeScript/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license"></a>
16+
</p>
17+
18+
<p align="center">
19+
<a href="https://docs.nativescript.org/configuration/vite">Documentation</a> ·
20+
<a href="https://docs.nativescript.org/setup/">Environment Setup</a> ·
21+
<a href="https://github.com/NativeScript/NativeScript/blob/main/tools/notes/CONTRIBUTING.md">Contribute</a> ·
22+
<a href="https://nativescript.org/discord">Community</a>
23+
</p>
24+
25+
---
426

527
## Prerequisites
628

packages/webpack5/README.md

Lines changed: 100 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,100 @@
1-
@nativescript/webpack rewrite
2-
3-
The rewrite allows us to simplify things, and introduce some breaking changes.
4-
Listing them here, so we can keep track of them - will be in the merge commit, and the release notes once we are ready.
5-
6-
BREAKING CHANGES:
7-
- `package.json` main should now use a relative path to the package.json instead of the app directory
8-
9-
For example (given we have a `src` directory where our app is):
10-
11-
`"main": "app.js"` becomes `"main": "src/app.js"` **OR** `"main": "src/app.ts"` (whether using JS or TS)
12-
13-
This simplifies things, and will allow ctrl/cmd + clicking on the filename in some editors.
14-
15-
- `postinstall` scripts have been removed.
16-
17-
The configuration will not need to change in the user projects between updates.
18-
19-
For existing projects we will provide an easy upgrade path, through `ns migrate` and a binary in the package.
20-
21-
For new projects `ns create` should create the config file by invoking a binary in the package.
22-
23-
- removed resolutions for short imports - use full imports instead.
24-
25-
For example:
26-
```
27-
import http from 'http'
28-
// becomes
29-
import { http } from '@nativescript/core'
30-
```
1+
<p align="center">
2+
<a href="https://nativescript.org">
3+
<img alt="NativeScript" src="https://raw.githubusercontent.com/NativeScript/artwork/main/logo/export/NativeScript_Logo_Dark_Transparent.png" width="100"/>
4+
</a>
5+
</p>
6+
7+
<h1 align="center">@nativescript/webpack</h1>
8+
9+
<p align="center">
10+
<b>Webpack configuration for NativeScript apps.</b>
11+
</p>
12+
13+
<p align="center">
14+
<a href="https://www.npmjs.com/package/@nativescript/webpack"><img src="https://img.shields.io/npm/v/@nativescript/webpack.svg" alt="npm version"></a>
15+
<a href="https://github.com/NativeScript/NativeScript/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license"></a>
16+
<a href="https://www.npmjs.com/package/@nativescript/webpack"><img src="https://img.shields.io/npm/dm/@nativescript/webpack.svg" alt="downloads"></a>
17+
</p>
18+
19+
<p align="center">
20+
<a href="https://docs.nativescript.org/configuration/webpack">Documentation</a> ·
21+
<a href="https://docs.nativescript.org/setup/">Environment Setup</a> ·
22+
<a href="https://github.com/NativeScript/NativeScript/blob/main/tools/notes/CONTRIBUTING.md">Contribute</a> ·
23+
<a href="https://nativescript.org/discord">Community</a>
24+
</p>
25+
26+
---
27+
28+
All NativeScript applications are bundled using webpack. This package provides the required configuration to build NativeScript apps with flexibility to customize as needed.
29+
30+
## 📦 Installation
31+
32+
```bash
33+
npm install @nativescript/webpack --save-dev
34+
```
35+
36+
## 🚀 Quick Start
37+
38+
All new projects come with a base `webpack.config.js` that's pre-configured:
39+
40+
```js
41+
const webpack = require('@nativescript/webpack')
42+
43+
module.exports = (env) => {
44+
webpack.init(env)
45+
46+
// Learn how to customize:
47+
// https://docs.nativescript.org/webpack
48+
49+
return webpack.resolveConfig()
50+
}
51+
```
52+
53+
## ✨ Features
54+
55+
- **Auto-discovery**: Automatically detects your project type (TypeScript, Angular, Vue, React, Svelte)
56+
- **Hot Module Replacement**: HMR enabled by default for faster development
57+
- **DotEnv Support**: Built-in support for `.env` files to manage environment variables
58+
- **Bundle Analysis**: Generate bundle reports with `--env.report`
59+
- **Production Optimization**: Minification with Terser in production mode
60+
61+
## 🔧 Global Variables
62+
63+
Useful globally available variables in your app:
64+
65+
| Variable | Description |
66+
|----------|-------------|
67+
| `__DEV__` | `true` when building in development mode |
68+
| `global.isAndroid` / `__ANDROID__` | `true` when platform is Android |
69+
| `global.isIOS` / `__IOS__` | `true` when platform is iOS |
70+
| `global.isVisionOS` / `__VISIONOS__` | `true` when platform is visionOS |
71+
| `global.__APPLE__` | `true` when platform is iOS or visionOS |
72+
73+
## 📚 API
74+
75+
### Core Methods
76+
77+
| Method | Description |
78+
|--------|-------------|
79+
| `webpack.init(env)` | Initialize the internal env object (required) |
80+
| `webpack.chainWebpack(chainFn)` | Add chain functions to modify config |
81+
| `webpack.mergeWebpack(obj)` | Merge objects into the final config |
82+
| `webpack.resolveConfig()` | Resolve the final webpack configuration |
83+
84+
## 🎛️ CLI Flags
85+
86+
| Flag | Description |
87+
|------|-------------|
88+
| `--no-hmr` | Disable Hot Module Replacement |
89+
| `--env.production` | Enable production mode with minification |
90+
| `--env.report` | Generate bundle analysis report |
91+
| `--env.verbose` | Print verbose logs and internal config |
92+
| `--env.e2e` | Enable E2E mode (enables `testID` property) |
93+
94+
## 📖 Documentation
95+
96+
For complete documentation including configuration examples, visit the [webpack configuration guide](https://docs.nativescript.org/configuration/webpack).
97+
98+
## 📄 License
99+
100+
[MIT licensed](https://github.com/NativeScript/NativeScript/blob/main/LICENSE).

packages/webpack5/package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@
8585
"url": "https://github.com/NativeScript/NativeScript"
8686
},
8787
"author": {
88-
"name": "NativeScript",
89-
"email": "oss@nativescript.org"
90-
}
91-
}
88+
"name": "Igor Randjelovic",
89+
"email": "rigor789@gmail.com"
90+
},
91+
"contributors": [
92+
{
93+
"name": "NativeScript",
94+
"email": "oss@nativescript.org"
95+
}
96+
]
97+
}

packages/webpack5/project.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
"rootDir": "{projectRoot}/src",
2222
"main": "{projectRoot}/src/index.ts",
2323
"assets": [
24+
{
25+
"input": "{projectRoot}",
26+
"glob": "README.md",
27+
"output": ".."
28+
},
29+
{
30+
"input": "{workspaceRoot}",
31+
"glob": "LICENSE",
32+
"output": ".."
33+
},
2434
{
2535
"input": "{projectRoot}/src/stubs",
2636
"glob": "*.{js,mjs}",

0 commit comments

Comments
 (0)