@ni-kismet/sl-webapp-nipkg 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +517 -518
- package/package.json +77 -77
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 National Instruments Corporation
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 National Instruments Corporation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,518 +1,517 @@
|
|
|
1
|
-
# SL WebApp NIPKG
|
|
2
|
-
|
|
3
|
-
[](https://github.com/ni/sl-webapp-nipkg/actions)
|
|
5
|
-
](https://pull.artifacts.ni.com/ui/repos/tree/General/npm-remote-cache/.npm/@ni-kismet/sl-webapp-nipkg)
|
|
4
|
+
[](https://github.com/ni/sl-webapp-nipkg/actions)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
A flexible tool for packaging web applications into SystemLink WebApp `.nipkg` format for National Instruments Package Manager. Works with any web application framework including Node.js (React, Angular, Vue), Python (Pyodide), .NET (Blazor), and static HTML sites.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- 🚀 **Easy Integration**: Works seamlessly with any web application
|
|
12
|
+
- 📦 **Automated Packaging**: Builds and packages your app in one command
|
|
13
|
+
- ⚙️ **Flexible Configuration**: Optional config files - use CLI flags or JSON config
|
|
14
|
+
- 🎯 **TypeScript Support**: Written in TypeScript with full type definitions
|
|
15
|
+
- 🌈 **Beautiful CLI**: Colorful, informative command-line interface
|
|
16
|
+
- 🔧 **CI/CD Ready**: Easy integration with build pipelines
|
|
17
|
+
- 🌍 **Cross-Platform**: Works on Windows, macOS, and Linux without external dependencies
|
|
18
|
+
- 🔌 **Framework Agnostic**: Works with React, Angular, Vue, Blazor, Pyodide, static HTML, and more
|
|
19
|
+
- 🎨 **Zero Config**: No config files required - just point to your build directory
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
- Node.js 16 or higher (only to run the packaging tool)
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
### Global Installation (Recommended)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g @ni-kismet/sl-webapp-nipkg
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Project-specific Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# As a dev dependency in your project
|
|
37
|
+
npm install --save-dev @ni-kismet/sl-webapp-nipkg
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
### Option 1: Minimal Usage (No Config Files)
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Package any web application - just point to the build directory
|
|
46
|
+
sl-webapp-nipkg build --build-dir ./dist --name my-app
|
|
47
|
+
|
|
48
|
+
# With full metadata
|
|
49
|
+
sl-webapp-nipkg build \
|
|
50
|
+
--build-dir ./dist \
|
|
51
|
+
--name "My WebApp" \
|
|
52
|
+
--version "1.0.0" \
|
|
53
|
+
--maintainer "Your Name <name@example.com>"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Option 2: With Configuration File (Recommended for Node.js projects)
|
|
57
|
+
|
|
58
|
+
1. **Navigate to your project**:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
cd my-webapp-project
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. **Initialize configuration** (optional):
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
sl-webapp-nipkg init
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
3. **Edit the generated `nipkg.config.json`** (all fields optional):
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"maintainer": "John Doe <john.doe@company.com>",
|
|
75
|
+
"displayName": "My WebApp",
|
|
76
|
+
"buildDir": "dist",
|
|
77
|
+
"buildCommand": "npm run build",
|
|
78
|
+
"userVisible": true
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Note:** The `name`, `version`, and `description` are auto-detected from your `package.json` if present.
|
|
83
|
+
|
|
84
|
+
4. **Build and package**:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
sl-webapp-nipkg build --build
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## CLI Commands
|
|
91
|
+
|
|
92
|
+
### `sl-webapp-nipkg build`
|
|
93
|
+
|
|
94
|
+
Build and package your web application.
|
|
95
|
+
|
|
96
|
+
#### Options
|
|
97
|
+
|
|
98
|
+
**Core Options:**
|
|
99
|
+
|
|
100
|
+
- `--build-dir <path>` - Build output directory to package (required if not in config)
|
|
101
|
+
- `--name <name>` - Package name (auto-detected from package.json or directory name)
|
|
102
|
+
- `--version <version>` - Package version (auto-detected from package.json or defaults to 1.0.0)
|
|
103
|
+
- `--description <description>` - Package description (optional)
|
|
104
|
+
- `--maintainer <maintainer>` - Maintainer info (defaults to 'Unknown')
|
|
105
|
+
- `--output-dir <path>` - Output directory for nipkg files (default: dist/nipkg)
|
|
106
|
+
|
|
107
|
+
**Build Options:**
|
|
108
|
+
|
|
109
|
+
- `-b, --build [command]` - Run build command before packaging (optionally specify custom command to override config)
|
|
110
|
+
- `-v, --verbose` - Enable verbose output
|
|
111
|
+
- `--skip-cleanup` - Skip cleanup of existing packages
|
|
112
|
+
- `--build-suffix <suffix>` - Add a suffix to the package name (e.g., build ID for CI/CD)
|
|
113
|
+
- `--config <path>` - Custom config file path (default: 'nipkg.config.json')
|
|
114
|
+
|
|
115
|
+
**Note:** CLI options override config file values, which override package.json values.
|
|
116
|
+
|
|
117
|
+
#### Examples
|
|
118
|
+
|
|
119
|
+
**Node.js Projects:**
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Build and package (runs buildCommand from config)
|
|
123
|
+
sl-webapp-nipkg build --build
|
|
124
|
+
|
|
125
|
+
# Build with custom command (overrides config)
|
|
126
|
+
sl-webapp-nipkg build --build "npm run build:production"
|
|
127
|
+
|
|
128
|
+
# Use existing build output (no build step)
|
|
129
|
+
sl-webapp-nipkg build
|
|
130
|
+
|
|
131
|
+
# Build with build ID suffix for CI/CD
|
|
132
|
+
sl-webapp-nipkg build --build --build-suffix "${BUILD_ID}"
|
|
133
|
+
|
|
134
|
+
# Verbose output with custom config
|
|
135
|
+
sl-webapp-nipkg build --build --verbose --config my-nipkg.config.json
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Non-Node.js Projects (Python, Blazor, Static Sites):**
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Python Pyodide webapp
|
|
142
|
+
sl-webapp-nipkg build --build-dir ./public --name my-pyodide-app
|
|
143
|
+
|
|
144
|
+
# .NET Blazor webapp
|
|
145
|
+
sl-webapp-nipkg build \
|
|
146
|
+
--build-dir ./bin/Release/net8.0/publish \
|
|
147
|
+
--name "My Blazor App" \
|
|
148
|
+
--version "2.0.0"
|
|
149
|
+
|
|
150
|
+
# Static HTML site
|
|
151
|
+
sl-webapp-nipkg build --build-dir ./dist --name my-static-site --version 1.0.0
|
|
152
|
+
|
|
153
|
+
# With full metadata
|
|
154
|
+
sl-webapp-nipkg build \
|
|
155
|
+
--build-dir ./output \
|
|
156
|
+
--name "My WebApp" \
|
|
157
|
+
--version "1.5.0" \
|
|
158
|
+
--description "My awesome webapp" \
|
|
159
|
+
--maintainer "Team <team@company.com>"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### `sl-webapp-nipkg init`
|
|
163
|
+
|
|
164
|
+
Initialize a `nipkg.config.json` file in the current directory.
|
|
165
|
+
|
|
166
|
+
## Configuration
|
|
167
|
+
|
|
168
|
+
### Configuration File (`nipkg.config.json`)
|
|
169
|
+
|
|
170
|
+
**All fields are optional.** CLI options override config file values. Config file values override package.json auto-detection.
|
|
171
|
+
|
|
172
|
+
| Property | Type | Required | Description |
|
|
173
|
+
| -------- | ---- | -------- | ----------- |
|
|
174
|
+
| `name` | string | ❌ | Package name (auto-detected from package.json or directory name) |
|
|
175
|
+
| `version` | string | ❌ | Package version (auto-detected from package.json, defaults to 1.0.0) |
|
|
176
|
+
| `description` | string | ❌ | Package description (auto-detected from package.json, defaults to empty) |
|
|
177
|
+
| `maintainer` | string | ❌ | Maintainer information (defaults to 'Unknown') |
|
|
178
|
+
| `architecture` | string | ❌ | Target architecture (default: 'all') |
|
|
179
|
+
| `displayName` | string | ❌ | Display name for the package |
|
|
180
|
+
| `buildDir` | string | ❌* | Build output directory (e.g., 'dist', 'build') - *Required if not provided via CLI |
|
|
181
|
+
| `buildCommand` | string | ❌ | Custom build command (default: 'npm run build') |
|
|
182
|
+
| `outputDir` | string | ❌ | Custom nipkg output directory (default: 'dist/nipkg') |
|
|
183
|
+
| `buildSuffix` | string | ❌ | Optional suffix for package filename (e.g., build ID for CI/CD) |
|
|
184
|
+
| `depends` | string[] | ❌ | Package dependencies |
|
|
185
|
+
| `userVisible` | boolean | ❌ | Whether package is user visible |
|
|
186
|
+
|
|
187
|
+
### Example Configuration
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"name": "my-webapp",
|
|
192
|
+
"version": "1.2.3",
|
|
193
|
+
"description": "A SystemLink WebApp for National Instruments",
|
|
194
|
+
"maintainer": "John Doe <john.doe@company.com>",
|
|
195
|
+
"architecture": "all",
|
|
196
|
+
"displayName": "My WebApp",
|
|
197
|
+
"buildDir": "dist",
|
|
198
|
+
"buildCommand": "npm run build",
|
|
199
|
+
"userVisible": true,
|
|
200
|
+
"depends": [
|
|
201
|
+
"ni-systemlink-server >= 2023.1"
|
|
202
|
+
],
|
|
203
|
+
"outputDir": "packages"
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Framework Examples
|
|
208
|
+
|
|
209
|
+
### Non-Node.js Projects
|
|
210
|
+
|
|
211
|
+
**Python Pyodide:**
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# No config file needed
|
|
215
|
+
sl-webapp-nipkg build \
|
|
216
|
+
--build-dir ./public \
|
|
217
|
+
--name my-pyodide-app \
|
|
218
|
+
--version 1.0.0 \
|
|
219
|
+
--maintainer "Python Team <team@example.com>"
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**.NET Blazor:**
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Package Blazor WebAssembly output
|
|
226
|
+
sl-webapp-nipkg build \
|
|
227
|
+
--build-dir ./bin/Release/net8.0/publish/wwwroot \
|
|
228
|
+
--name my-blazor-app \
|
|
229
|
+
--version 2.0.0
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Static HTML:**
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Package any static web content
|
|
236
|
+
sl-webapp-nipkg build --build-dir ./dist --name my-static-site
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Node.js Projects
|
|
240
|
+
|
|
241
|
+
**React:**
|
|
242
|
+
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"maintainer": "Your Name <your.email@company.com>",
|
|
246
|
+
"buildDir": "build",
|
|
247
|
+
"buildCommand": "npm run build"
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Vue
|
|
252
|
+
|
|
253
|
+
```json
|
|
254
|
+
{
|
|
255
|
+
"maintainer": "Your Name <your.email@company.com>",
|
|
256
|
+
"buildDir": "dist",
|
|
257
|
+
"buildCommand": "npm run build"
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Angular
|
|
262
|
+
|
|
263
|
+
```json
|
|
264
|
+
{
|
|
265
|
+
"maintainer": "Your Name <your.email@company.com>",
|
|
266
|
+
"buildDir": "dist/my-app/browser",
|
|
267
|
+
"buildCommand": "npm run build"
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**Note:** For Angular projects, specify the build configuration in `buildCommand`: `"buildCommand": "ng build --configuration production"` or use an npm script like `"build": "ng build --configuration production"` and let the default `npm run build` work.
|
|
272
|
+
|
|
273
|
+
### Next.js
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
{
|
|
277
|
+
"maintainer": "Your Name <your.email@company.com>",
|
|
278
|
+
"buildDir": "out",
|
|
279
|
+
"buildCommand": "npm run build && npm run export"
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Integration with Node.js Projects
|
|
284
|
+
|
|
285
|
+
### Add to package.json Scripts
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"scripts": {
|
|
290
|
+
"start": "npm run dev",
|
|
291
|
+
"dev": "vite",
|
|
292
|
+
"build": "vite build",
|
|
293
|
+
"build:nipkg": "sl-webapp-nipkg build --build",
|
|
294
|
+
"package:nipkg": "sl-webapp-nipkg build"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Use in npm Scripts
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
# Build and package for production
|
|
303
|
+
npm run build:nipkg
|
|
304
|
+
|
|
305
|
+
# Package existing build
|
|
306
|
+
npm run package:nipkg
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Programmatic Usage
|
|
310
|
+
|
|
311
|
+
```typescript
|
|
312
|
+
import { SystemLinkNipkgBuilder, NipkgConfig, BuildOptions } from '@ni-kismet/sl-webapp-nipkg';
|
|
313
|
+
|
|
314
|
+
const config: NipkgConfig = {
|
|
315
|
+
name: 'my-app',
|
|
316
|
+
version: '1.0.0',
|
|
317
|
+
description: 'My SystemLink WebApp',
|
|
318
|
+
maintainer: 'John Doe <john@example.com>',
|
|
319
|
+
buildDir: 'dist',
|
|
320
|
+
userVisible: true
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
const options: BuildOptions = {
|
|
324
|
+
build: true,
|
|
325
|
+
verbose: true
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
const builder = new SystemLinkNipkgBuilder(config, options);
|
|
329
|
+
await builder.build();
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
## CI/CD Integration
|
|
333
|
+
|
|
334
|
+
The `--build-suffix` option allows you to create unique package names for PR/branch builds while keeping clean names for production releases.
|
|
335
|
+
|
|
336
|
+
**Output examples:**
|
|
337
|
+
|
|
338
|
+
- PR builds: `my-app_1.0.0_12345_all.nipkg` (includes build ID)
|
|
339
|
+
- Main/production: `my-app_1.0.0_all.nipkg` (standard naming)
|
|
340
|
+
|
|
341
|
+
### GitHub Actions
|
|
342
|
+
|
|
343
|
+
```yaml
|
|
344
|
+
name: Build and Package
|
|
345
|
+
|
|
346
|
+
on:
|
|
347
|
+
push:
|
|
348
|
+
branches: [ main ]
|
|
349
|
+
pull_request:
|
|
350
|
+
branches: [ main ]
|
|
351
|
+
|
|
352
|
+
jobs:
|
|
353
|
+
build:
|
|
354
|
+
runs-on: windows-latest
|
|
355
|
+
|
|
356
|
+
steps:
|
|
357
|
+
- uses: actions/checkout@v3
|
|
358
|
+
|
|
359
|
+
- name: Setup Node.js
|
|
360
|
+
uses: actions/setup-node@v3
|
|
361
|
+
with:
|
|
362
|
+
node-version: '18'
|
|
363
|
+
cache: 'npm'
|
|
364
|
+
|
|
365
|
+
- name: Install dependencies
|
|
366
|
+
run: npm ci
|
|
367
|
+
|
|
368
|
+
- name: Build and Package (PR)
|
|
369
|
+
if: github.event_name == 'pull_request'
|
|
370
|
+
run: sl-webapp-nipkg build --build --build-suffix "${{ github.run_number }}"
|
|
371
|
+
|
|
372
|
+
- name: Build and Package (Main)
|
|
373
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
374
|
+
run: sl-webapp-nipkg build --build
|
|
375
|
+
|
|
376
|
+
- name: Upload Package
|
|
377
|
+
uses: actions/upload-artifact@v3
|
|
378
|
+
with:
|
|
379
|
+
name: nipkg-package
|
|
380
|
+
path: dist/nipkg/*.nipkg
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Azure DevOps
|
|
384
|
+
|
|
385
|
+
```yaml
|
|
386
|
+
trigger:
|
|
387
|
+
- main
|
|
388
|
+
|
|
389
|
+
pool:
|
|
390
|
+
vmImage: 'windows-latest'
|
|
391
|
+
|
|
392
|
+
steps:
|
|
393
|
+
- task: NodeTool@0
|
|
394
|
+
inputs:
|
|
395
|
+
versionSpec: '18.x'
|
|
396
|
+
|
|
397
|
+
- script: npm ci
|
|
398
|
+
displayName: 'Install dependencies'
|
|
399
|
+
|
|
400
|
+
- script: |
|
|
401
|
+
if [ "$(Build.SourceBranch)" = "refs/heads/main" ]; then
|
|
402
|
+
npm run build
|
|
403
|
+
sl-webapp-nipkg build
|
|
404
|
+
else
|
|
405
|
+
npm run build
|
|
406
|
+
sl-webapp-nipkg build --build-suffix "$(Build.BuildId)"
|
|
407
|
+
fi
|
|
408
|
+
displayName: 'Build and package'
|
|
409
|
+
|
|
410
|
+
- task: PublishBuildArtifacts@1
|
|
411
|
+
inputs:
|
|
412
|
+
PathtoPublish: 'dist/nipkg'
|
|
413
|
+
ArtifactName: 'nipkg-package'
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
## Package Structure
|
|
417
|
+
|
|
418
|
+
After packaging, your project will have this structure:
|
|
419
|
+
|
|
420
|
+
```text
|
|
421
|
+
your-webapp-project/
|
|
422
|
+
├── dist/ # Your build output
|
|
423
|
+
│ ├── index.html
|
|
424
|
+
│ ├── assets/
|
|
425
|
+
│ └── ...
|
|
426
|
+
├── dist/nipkg/ # NIPKG packaging
|
|
427
|
+
│ ├── your-app_1.0.0_all.nipkg # Final package
|
|
428
|
+
│ └── temp-source/ # Temporary (auto-cleaned)
|
|
429
|
+
├── nipkg.config.json # Package configuration
|
|
430
|
+
└── package.json # NPM scripts
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
## Requirements
|
|
434
|
+
|
|
435
|
+
- Node.js 16+
|
|
436
|
+
- National Instruments Package Manager (nipkg)
|
|
437
|
+
|
|
438
|
+
## Development
|
|
439
|
+
|
|
440
|
+
### Building from Source
|
|
441
|
+
|
|
442
|
+
```bash
|
|
443
|
+
git clone https://github.com/ni/sl-webapp-nipkg.git
|
|
444
|
+
cd sl-webapp-nipkg
|
|
445
|
+
npm install
|
|
446
|
+
npm run build
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
### Running Tests
|
|
450
|
+
|
|
451
|
+
```bash
|
|
452
|
+
# Run all tests
|
|
453
|
+
npm test
|
|
454
|
+
|
|
455
|
+
# Run tests with coverage
|
|
456
|
+
npm run test:coverage
|
|
457
|
+
|
|
458
|
+
# Run tests in watch mode
|
|
459
|
+
npm run test:watch
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### Local Development
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
# Link globally for testing
|
|
466
|
+
npm link
|
|
467
|
+
|
|
468
|
+
# Use in any Node.js project
|
|
469
|
+
cd /path/to/your/project
|
|
470
|
+
sl-webapp-nipkg --help
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
## Troubleshooting
|
|
474
|
+
|
|
475
|
+
### Common Issues
|
|
476
|
+
|
|
477
|
+
#### "Build directory not found"
|
|
478
|
+
|
|
479
|
+
- Provide build directory via CLI: `--build-dir ./dist`
|
|
480
|
+
- Or run with `--build` flag to build before packaging
|
|
481
|
+
- Check that your build command runs successfully
|
|
482
|
+
- Verify `buildDir` in nipkg.config.json points to the correct directory
|
|
483
|
+
|
|
484
|
+
#### "buildDir is required"
|
|
485
|
+
|
|
486
|
+
- Provide via CLI: `sl-webapp-nipkg build --build-dir ./dist`
|
|
487
|
+
- Or add to nipkg.config.json: `"buildDir": "dist"`
|
|
488
|
+
|
|
489
|
+
#### Package dependencies missing
|
|
490
|
+
|
|
491
|
+
- Add required NI runtime dependencies to `depends` array in config
|
|
492
|
+
- Example: `"depends": ["ni-systemlink-server >= 2023.1"]`
|
|
493
|
+
|
|
494
|
+
## Contributing
|
|
495
|
+
|
|
496
|
+
1. Fork the repository
|
|
497
|
+
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
498
|
+
3. Make your changes
|
|
499
|
+
4. Add tests for your changes
|
|
500
|
+
5. Ensure tests pass: `npm test`
|
|
501
|
+
6. Commit your changes: `git commit -m 'Add amazing feature'`
|
|
502
|
+
7. Push to the branch: `git push origin feature/amazing-feature`
|
|
503
|
+
8. Submit a pull request
|
|
504
|
+
|
|
505
|
+
## License
|
|
506
|
+
|
|
507
|
+
MIT © National Instruments
|
|
508
|
+
|
|
509
|
+
## Support
|
|
510
|
+
|
|
511
|
+
- 📚 [Documentation](https://github.com/ni/sl-webapp-nipkg/wiki)
|
|
512
|
+
- 🐛 [Report Issues](https://github.com/ni/sl-webapp-nipkg/issues)
|
|
513
|
+
- 💬 [Discussions](https://github.com/ni/sl-webapp-nipkg/discussions)
|
|
514
|
+
|
|
515
|
+
---
|
|
516
|
+
|
|
517
|
+
*Made with ❤️ for the National Instruments community*
|
package/package.json
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ni-kismet/sl-webapp-nipkg",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "Build tool for packaging web applications into SystemLink WebApp .nipkg format. Supports Node.js, Python, .NET Blazor, and static sites.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"exports": {
|
|
7
|
-
"./package.json": "./package.json",
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/esm/index.d.ts",
|
|
10
|
-
"import": "./dist/esm/index.js"
|
|
11
|
-
},
|
|
12
|
-
"./*": {
|
|
13
|
-
"types": "./dist/esm/*.d.ts",
|
|
14
|
-
"import": "./dist/esm/*/index.js"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"typesVersions": {
|
|
18
|
-
"*": {
|
|
19
|
-
"*": [
|
|
20
|
-
"dist/esm/*",
|
|
21
|
-
"dist/esm/*/index.d.ts"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"bin": {
|
|
26
|
-
"sl-webapp-nipkg": "dist/cli.js"
|
|
27
|
-
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "tsc",
|
|
30
|
-
"dev": "tsc --watch",
|
|
31
|
-
"lint": "eslint .",
|
|
32
|
-
"lint:fix": "eslint . --fix",
|
|
33
|
-
"change": "beachball change",
|
|
34
|
-
"check": "beachball check --changehint \"Run 'npm run change' to generate a change file\"",
|
|
35
|
-
"sync": "beachball sync",
|
|
36
|
-
"invoke-publish": "beachball publish --yes --access public --message \"applying package updates [skip ci]\""
|
|
37
|
-
},
|
|
38
|
-
"keywords": [
|
|
39
|
-
"systemlink",
|
|
40
|
-
"nipkg",
|
|
41
|
-
"national-instruments",
|
|
42
|
-
"packaging",
|
|
43
|
-
"webapp",
|
|
44
|
-
"nodejs"
|
|
45
|
-
],
|
|
46
|
-
"repository": {
|
|
47
|
-
"type": "git",
|
|
48
|
-
"url": "git+https://github.com/ni/sl-webapp-nipkg.git"
|
|
49
|
-
},
|
|
50
|
-
"publishConfig": {
|
|
51
|
-
"access": "public"
|
|
52
|
-
},
|
|
53
|
-
"author": {
|
|
54
|
-
"name": "National Instruments"
|
|
55
|
-
},
|
|
56
|
-
"license": "MIT",
|
|
57
|
-
"bugs": {
|
|
58
|
-
"url": "https://github.com/ni/sl-webapp-nipkg/issues"
|
|
59
|
-
},
|
|
60
|
-
"homepage": "https://github.com/ni/sl-webapp-nipkg#readme",
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"chalk": "^5.6.2",
|
|
63
|
-
"commander": "^14.0.3",
|
|
64
|
-
"deboa": "^1.2.0",
|
|
65
|
-
"fs-extra": "^11.3.3"
|
|
66
|
-
},
|
|
67
|
-
"devDependencies": {
|
|
68
|
-
"@ni/eslint-config-javascript": "^5.1.4",
|
|
69
|
-
"@ni/eslint-config-typescript": "^5.0.5",
|
|
70
|
-
"@types/fs-extra": "^11.0.4",
|
|
71
|
-
"@types/node": "^25.
|
|
72
|
-
"beachball": "^2.63.0",
|
|
73
|
-
"eslint": "^9.39.
|
|
74
|
-
"eslint-plugin-tsdoc": "^0.5.0",
|
|
75
|
-
"typescript": "^5.9.3"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@ni-kismet/sl-webapp-nipkg",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Build tool for packaging web applications into SystemLink WebApp .nipkg format. Supports Node.js, Python, .NET Blazor, and static sites.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./package.json": "./package.json",
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/esm/index.d.ts",
|
|
10
|
+
"import": "./dist/esm/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./*": {
|
|
13
|
+
"types": "./dist/esm/*.d.ts",
|
|
14
|
+
"import": "./dist/esm/*/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"typesVersions": {
|
|
18
|
+
"*": {
|
|
19
|
+
"*": [
|
|
20
|
+
"dist/esm/*",
|
|
21
|
+
"dist/esm/*/index.d.ts"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"bin": {
|
|
26
|
+
"sl-webapp-nipkg": "dist/cli.js"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc",
|
|
30
|
+
"dev": "tsc --watch",
|
|
31
|
+
"lint": "eslint .",
|
|
32
|
+
"lint:fix": "eslint . --fix",
|
|
33
|
+
"change": "beachball change",
|
|
34
|
+
"check": "beachball check --changehint \"Run 'npm run change' to generate a change file\"",
|
|
35
|
+
"sync": "beachball sync",
|
|
36
|
+
"invoke-publish": "beachball publish --yes --access public --message \"applying package updates [skip ci]\""
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"systemlink",
|
|
40
|
+
"nipkg",
|
|
41
|
+
"national-instruments",
|
|
42
|
+
"packaging",
|
|
43
|
+
"webapp",
|
|
44
|
+
"nodejs"
|
|
45
|
+
],
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/ni/sl-webapp-nipkg.git"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"author": {
|
|
54
|
+
"name": "National Instruments"
|
|
55
|
+
},
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/ni/sl-webapp-nipkg/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/ni/sl-webapp-nipkg#readme",
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"chalk": "^5.6.2",
|
|
63
|
+
"commander": "^14.0.3",
|
|
64
|
+
"deboa": "^1.2.0",
|
|
65
|
+
"fs-extra": "^11.3.3"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@ni/eslint-config-javascript": "^5.1.4",
|
|
69
|
+
"@ni/eslint-config-typescript": "^5.0.5",
|
|
70
|
+
"@types/fs-extra": "^11.0.4",
|
|
71
|
+
"@types/node": "^25.3.0",
|
|
72
|
+
"beachball": "^2.63.0",
|
|
73
|
+
"eslint": "^9.39.3",
|
|
74
|
+
"eslint-plugin-tsdoc": "^0.5.0",
|
|
75
|
+
"typescript": "^5.9.3"
|
|
76
|
+
}
|
|
77
|
+
}
|