Skip to content

Commit 5b10bc2

Browse files
authored
[FIX] Fix demo packaging (#459)
* update tj-actions/changed-files version * update .dockerignore to allow certain files in demo/**/data and demo/**/public dirs * fix spatial demo runtime import error * update yarn.lock * fix hybrid CJS/ESM module loading edge cases, enable skipped tests * properly clean up glfw window callbacks to fix the segfault on shutdown
1 parent 72bb9d5 commit 5b10bc2

File tree

25 files changed

+751
-682
lines changed

25 files changed

+751
-682
lines changed

.dockerignore

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
**/*.tar.gz
1515
**/*.tar.xz
1616
**/*.zip
17-
18-
!**/modules/demo/**/*.png
19-
!**/modules/demo/**/*.jpg
20-
!**/modules/demo/**/*.gif
21-
!**/modules/demo/**/*.las
22-
!**/modules/demo/**/*.laz
17+
**/*.pyc
2318

2419
**/lerna-debug.log
2520
**/docker-compose*.yml
@@ -28,19 +23,20 @@
2823

2924
**/z-*
3025
**/out/
26+
**/.logs/
3127
**/.next/
3228
**/_next/
33-
**/build
34-
**/.cache
35-
**/.ccache
36-
**/.clangd
37-
**/.github
38-
**/.vscode
39-
**/.cmake-js
40-
**/node_modules
41-
**/modules/**/doc
42-
**/modules/**/lib
43-
**/modules/**/data
29+
**/build/
30+
**/.cache/
31+
**/.ccache/
32+
**/.clangd/
33+
**/.github/
34+
**/.vscode/
35+
**/.cmake-js/
36+
**/node_modules/
37+
**/modules/**/doc/*
38+
**/modules/**/lib/*
39+
**/modules/**/data/*
4440

4541
**/modules/*/include/napi.h
4642
**/modules/*/include/napi-inl.h
@@ -59,3 +55,16 @@ dev/dockerfiles
5955
.gitignore
6056
.clang-format
6157
.dockerignore
58+
59+
!**/modules/demo/**/data/*.png
60+
!**/modules/demo/**/data/*.jpg
61+
!**/modules/demo/**/data/*.gif
62+
!**/modules/demo/**/data/*.las
63+
!**/modules/demo/**/data/*.laz
64+
!**/modules/demo/**/data/*.arrow
65+
!**/modules/demo/**/public/*.png
66+
!**/modules/demo/**/public/*.jpg
67+
!**/modules/demo/**/public/*.gif
68+
!**/modules/demo/**/public/*.las
69+
!**/modules/demo/**/public/*.laz
70+
!**/modules/demo/**/public/*.arrow

.github/workflows/build-and-push-image-ssh.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
- name: Check if files changed
109109
id: files_changed
110110
if: ${{ ! inputs.manual-build }}
111-
uses: tj-actions/changed-files@v23.1
111+
uses: tj-actions/changed-files@v35.4.4
112112
with:
113113
base_sha: ${{ steps.last_main_commit.outputs.commit_hash }}
114114
files: |

.github/workflows/build-and-push-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
- name: Check if files changed
100100
id: files_changed
101101
if: ${{ ! inputs.manual-build }}
102-
uses: tj-actions/changed-files@v23.1
102+
uses: tj-actions/changed-files@v35.4.4
103103
with:
104104
base_sha: ${{ steps.last_main_commit.outputs.commit_hash }}
105105
files: |

.github/workflows/main.pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: Check if source files changed
6262
id: src_changed
63-
uses: tj-actions/changed-files@v23.1
63+
uses: tj-actions/changed-files@v35.4.4
6464
with:
6565
path: node
6666
base_sha: ${{ steps.last_main_commit.outputs.commit_hash }}
@@ -84,7 +84,7 @@ jobs:
8484
8585
- name: Check if GitHub Actions or devel main Dockerfile changed
8686
id: dev_changed
87-
uses: tj-actions/changed-files@v23.1
87+
uses: tj-actions/changed-files@v35.4.4
8888
with:
8989
path: node
9090
base_sha: ${{ steps.last_main_commit.outputs.commit_hash }}

modules/demo/deck/arc/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
// Copyright (c) 2020-2022, NVIDIA CORPORATION.
3+
// Copyright (c) 2020-2023, NVIDIA CORPORATION.
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License");
66
// you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ module.exports = (glfwOptions = {
2424
module: {path: __dirname},
2525
});
2626
return Object.assign(jsdom, {
27-
loaded: jsdom.window.evalFn(async () => await import('./app.js')),
27+
loaded: jsdom.loaded.then(() => jsdom.window.evalFn(async () => await import('./app.js'))),
2828
});
2929
};
3030

modules/demo/spatial/data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ const https = require('https');
1717
const {writeFile} = require('fs/promises');
1818
const {finished} = require('stream/promises');
1919

20-
module.exports = loadSpatialDataset;
20+
module.exports.loadSpatialDataset = loadSpatialDataset;
2121

2222
if (require.main === module) { //
23-
module.exports().catch((e) => console.error(e) || process.exit(1));
23+
loadSpatialDataset().catch((e) => console.error(e) || process.exit(1));
2424
}
2525

2626
async function loadSpatialDataset() {

modules/demo/spatial/util.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {existsSync} from 'fs';
2828
import {readFile as fsReadFile} from 'fs/promises';
2929
import * as Path from 'path';
3030

31-
import * as loadSpatialDataset from './data';
31+
import {loadSpatialDataset} from './data';
3232

3333
/**
3434
* @param {Map<number, [number, number, number, number]>} colorMap
@@ -148,8 +148,7 @@ export async function loadPoints() {
148148
return table;
149149
} catch (e) {
150150
if (loadDatasetIfNotFound) {
151-
console.error(e);
152-
console.log('dataset not found, now downloading...');
151+
console.log('Point data not found, downloading now...');
153152
return await loadSpatialDataset().then(() => loadPointsTable(false))
154153
}
155154
console.error(`

modules/glfw/src/callbacks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020-2021, NVIDIA CORPORATION.
1+
// Copyright (c) 2020-2023, NVIDIA CORPORATION.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -277,7 +277,7 @@ void GLFWdrop_cb(GLFWwindow* window, int count, const char** paths) {
277277

278278
}; // namespace
279279

280-
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
280+
// GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
281281
void glfwSetErrorCallback(Napi::CallbackInfo const& info) {
282282
auto env = info.Env();
283283
if (info[0].IsFunction()) {

modules/glfw/src/glfw.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020-2022, NVIDIA CORPORATION.
1+
// Copyright (c) 2020-2023, NVIDIA CORPORATION.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -19,6 +19,9 @@ export const GLFW: any =
1919
require('bindings')(isHeadless ? 'rapidsai_glfw_eglheadless.node' : 'rapidsai_glfw_x11.node')
2020
.init(CORE);
2121

22+
process?.on && process?.on('exit', () => GLFW.terminate());
23+
process?.on && process?.on('beforeExit', () => GLFW.terminate());
24+
2225
export default GLFW;
2326

2427
export type GLFWmonitor = number;

modules/jsdom/.vscode/launch.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"program": "${workspaceFolder}/node_modules/.bin/jest",
1515
"skipFiles": [
1616
// "<node_internals>/**",
17+
"<node_internals>/**/fs/utils",
1718
// "${workspaceFolder}/node_modules/**"
1819
],
1920
"env": {
@@ -38,6 +39,7 @@
3839
"program": "test/test-import.js",
3940
"skipFiles": [
4041
// "<node_internals>/**",
42+
"<node_internals>/**/fs/utils",
4143
// "${workspaceFolder}/node_modules/**"
4244
],
4345
"env": {

0 commit comments

Comments
 (0)