Skip to content

Commit 25c57d6

Browse files
committed
resolve conflicts and issues
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
1 parent 3792738 commit 25c57d6

34 files changed

Lines changed: 425 additions & 447 deletions
Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,11 @@
11
---
2-
<<<<<<< before updating
3-
name: Bug report
4-
about: Create a report to help us improve
5-
title: ''
6-
labels: bug
7-
=======
82
name: Bug Report
93
about: Report a bug to help us improve
104
title: '[BUG] '
115
labels: 'type: bug'
12-
>>>>>>> after updating
136
assignees: ''
147
---
158

16-
<<<<<<< before updating
17-
<!--
18-
Thank you for taking the time to file a bug report. Before creating a
19-
new issue, please take a few minutes to search the issue tracker for an
20-
existing issues about the bug you would like to report.
21-
-->
22-
23-
**Describe the bug**
24-
<!-- A clear and concise description of what the bug is. -->
25-
26-
**To Reproduce**
27-
<!-- A short code example that reproduces the problem. It should be
28-
self-contained, i.e., can be copy-pasted into the Python interpreter or
29-
run as-is via `python myproblem.py`. If this is a problem with the C++
30-
interface, it should link to a buildable C++ project that demonstrates
31-
the issue.
32-
33-
```python
34-
35-
```
36-
-->
37-
38-
39-
40-
**Expected behavior**
41-
<!-- A clear and concise description of what you expected to happen. -->
42-
43-
**Error Message**
44-
<!-- Please include the full error message you see,if any, including the
45-
full traceback -->
46-
47-
**Runtime Environment**
48-
<!-- Output from
49-
50-
`import sys, csp; print(csp.__version__); print(sys.version); print(sys.platform)`.
51-
-->
52-
53-
**Additional context**
54-
<!-- Explain how this issue affects your work or why it should be
55-
prioritized. If there are additional details that don't fit elsewhere,
56-
include them here. -->
57-
=======
589
**Description**
5910
A clear and concise description of the bug.
6011

@@ -78,4 +29,3 @@ What actually happened. Include full error messages or tracebacks if available.
7829

7930
**Additional Context**
8031
Add any other relevant context, logs, or screenshots.
81-
>>>>>>> after updating

.github/workflows/build.yaml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ jobs:
5555
- name: Make dist
5656
run: make dist
5757

58+
- uses: actions-ext/python/test-wheel@main
59+
with:
60+
module: csp_gateway
61+
62+
- uses: actions-ext/python/test-sdist@main
63+
with:
64+
module: csp_gateway
65+
5866
- uses: actions/upload-artifact@v7
5967
with:
6068
name: dist
@@ -92,7 +100,7 @@ jobs:
92100
name: dist
93101

94102
- name: Install wheels
95-
run: uv pip install `ls csp_gateway-*.whl`[develop]
103+
run: uv pip install `ls csp_gateway-*.whl`[develop] --target .
96104

97105
- name: Test
98106
run: make coverage
@@ -123,26 +131,8 @@ jobs:
123131
matrix:
124132
wheel: ["", "client"]
125133

126-
<<<<<<< before updating
127134
steps:
128135
- uses: actions/checkout@v6
129-
=======
130-
- uses: actions-ext/python/test-wheel@main
131-
with:
132-
module: csp_gateway
133-
if: matrix.os == 'ubuntu-latest'
134-
135-
- uses: actions-ext/python/test-sdist@main
136-
with:
137-
module: csp_gateway
138-
if: matrix.os == 'ubuntu-latest'
139-
140-
- uses: actions/upload-artifact@v7
141-
with:
142-
name: dist-${{matrix.os}}
143-
path: dist
144-
if: matrix.os == 'ubuntu-latest'
145-
>>>>>>> after updating
146136

147137
- name: Set up Python
148138
uses: actions-ext/python/setup@main

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ index.md
123123
# JS
124124
js/coverage
125125
js/dist
126-
js/lib
127126
js/node_modules
128127
js/test-results
129128
js/playwright-report
@@ -152,3 +151,6 @@ ROADMAP.md
152151
AGENTS.md
153152
.github/hooks/sdlc.json
154153
.superpowers
154+
155+
# JS Artifacts
156+
csp_gateway/server/build

js/build.mjs

Lines changed: 29 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
<<<<<<< before updating
2-
import { NodeModulesExternal } from "@finos/perspective-esbuild-plugin/external.js";
3-
import { build } from "@finos/perspective-esbuild-plugin/build.js";
4-
import { BuildCss } from "@prospective.co/procss/target/cjs/procss.js";
5-
import cpy from "cpy";
1+
import { bundle } from "./tools/bundle.mjs";
2+
import { bundle_css } from "./tools/css.mjs";
3+
import { node_modules_external } from "./tools/externals.mjs";
4+
65
import fs from "fs";
7-
import { createRequire } from "node:module";
6+
import cpy from "cpy";
87
import path from "node:path";
9-
8+
import { createRequire } from "node:module";
109
const require = createRequire(import.meta.url);
1110

1211
// Force all react imports to resolve to the same copy to avoid
@@ -17,177 +16,52 @@ const REACT_ALIAS = {
1716
"react-dom": path.dirname(require.resolve("react-dom/package.json")),
1817
"react/jsx-runtime": require.resolve("react/jsx-runtime"),
1918
};
20-
=======
21-
import { bundle } from "./tools/bundle.mjs";
22-
import { bundle_css } from "./tools/css.mjs";
23-
import { node_modules_external } from "./tools/externals.mjs";
24-
25-
import fs from "fs";
26-
import cpy from "cpy";
27-
>>>>>>> after updating
2819

2920
const BUNDLES = [
3021
{
31-
<<<<<<< before updating
32-
define: {
33-
global: "window",
34-
},
35-
entryPoints: ["src/index.jsx"],
36-
plugins: [NodeModulesExternal()],
37-
format: "esm",
38-
loader: {
39-
".css": "text",
40-
".html": "text",
41-
".jsx": "jsx",
42-
".png": "file",
43-
".ttf": "file",
44-
".wasm": "file",
45-
},
46-
outfile: "./lib/index.js",
22+
entryPoints: ["./src/js/index.jsx"],
23+
plugins: [node_modules_external()],
24+
outfile: "dist/index.js",
25+
alias: REACT_ALIAS,
4726
},
4827
{
49-
define: {
50-
global: "window",
51-
},
52-
entryPoints: ["src/main.jsx"],
53-
bundle: true,
54-
plugins: [],
55-
format: "esm",
56-
alias: REACT_ALIAS,
57-
loader: {
58-
".css": "text",
59-
".html": "text",
60-
".jsx": "jsx",
61-
".png": "file",
62-
".ttf": "file",
63-
".wasm": "file",
64-
},
28+
entryPoints: ["./src/js/main.jsx"],
6529
outfile: "../csp_gateway/server/build/main.js",
66-
publicPath: "/static/",
30+
alias: REACT_ALIAS,
31+
publicPath: "/static",
6732
},
6833
];
6934

70-
function add(builder, path, path2) {
71-
builder.add(path, fs.readFileSync(require.resolve(path2 || path)).toString());
72-
}
73-
74-
async function compile_css() {
75-
const builder1 = new BuildCss("");
76-
add(builder1, "./src/style/index.css");
77-
add(builder1, "./src/style/base.css");
78-
add(builder1, "./src/style/nord.css");
79-
add(builder1, "./src/style/header_footer.css");
80-
add(builder1, "./src/style/perspective.css");
81-
add(builder1, "./src/style/settings.css");
82-
add(
83-
builder1,
84-
"perspective-viewer-pro.css",
85-
"@perspective-dev/viewer/dist/css/pro.css",
86-
);
87-
add(
88-
builder1,
89-
"perspective-viewer-pro-dark.css",
90-
"@perspective-dev/viewer/dist/css/pro-dark.css",
91-
);
92-
add(
93-
builder1,
94-
"perspective-viewer-monokai.css",
95-
"@perspective-dev/viewer/dist/css/monokai.css",
96-
);
97-
add(
98-
builder1,
99-
"perspective-viewer-vaporwave.css",
100-
"@perspective-dev/viewer/dist/css/vaporwave.css",
101-
);
102-
add(
103-
builder1,
104-
"perspective-viewer-dracula.css",
105-
"@perspective-dev/viewer/dist/css/dracula.css",
106-
);
107-
add(
108-
builder1,
109-
"perspective-viewer-gruvbox.css",
110-
"@perspective-dev/viewer/dist/css/gruvbox.css",
111-
);
112-
add(
113-
builder1,
114-
"perspective-viewer-gruvbox-dark.css",
115-
"@perspective-dev/viewer/dist/css/gruvbox-dark.css",
116-
);
117-
add(
118-
builder1,
119-
"perspective-viewer-solarized.css",
120-
"@perspective-dev/viewer/dist/css/solarized.css",
121-
);
122-
add(
123-
builder1,
124-
"perspective-viewer-solarized-dark.css",
125-
"@perspective-dev/viewer/dist/css/solarized-dark.css",
126-
);
127-
add(
128-
builder1,
129-
"react-modern-drawer.css",
130-
"react-modern-drawer/dist/index.css",
131-
);
132-
133-
const css = builder1.compile().get("index.css");
134-
135-
// write to extension
136-
fs.writeFileSync("./lib/index.css", css);
137-
fs.writeFileSync("../csp_gateway/server/build/index.css", css);
138-
}
35+
const WASM_ASSETS = [
36+
"node_modules/@perspective-dev/server/dist/wasm/perspective-server.wasm",
37+
"node_modules/@perspective-dev/viewer/dist/wasm/perspective-viewer.wasm",
38+
];
13939

140-
async function cp_to_paths(path) {
141-
await cpy(path, "../csp_gateway/server/build/", { flat: true });
40+
function copy_wasm_assets(outdir) {
41+
fs.mkdirSync(outdir, { recursive: true });
42+
for (const wasm of WASM_ASSETS) {
43+
fs.copyFileSync(wasm, path.join(outdir, path.basename(wasm)));
44+
}
14245
}
14346

144-
async function build_all() {
145-
/* make directories */
146-
fs.mkdirSync("../csp_gateway/server/build/", { recursive: true });
147-
148-
/* Compile and copy JS */
149-
await Promise.all(BUILD.map(build)).catch(() => process.exit(1));
150-
// await cp_to_paths("./src/style/*.css");
151-
await cp_to_paths("./src/html/*.html");
152-
await cp_to_paths(
153-
"node_modules/@perspective-dev/server/dist/wasm/perspective-server.wasm",
154-
);
155-
await cp_to_paths(
156-
"node_modules/@perspective-dev/viewer/dist/wasm/perspective-viewer.wasm",
157-
);
158-
159-
/* Compile and copy css */
160-
await compile_css();
161-
=======
162-
entryPoints: ["src/ts/index.ts"],
163-
plugins: [node_modules_external()],
164-
outfile: "dist/esm/index.js",
165-
},
166-
{
167-
entryPoints: ["src/ts/index.ts"],
168-
outfile: "dist/cdn/index.js",
169-
},
170-
];
171-
17247
async function build() {
17348
// Bundle css
17449
await bundle_css();
17550

17651
// Copy HTML
177-
cpy("src/html/*", "dist/");
52+
await cpy("src/html/*", "dist/");
17853

17954
// Copy images
180-
fs.mkdirSync("dist/img", { recursive: true });
181-
cpy("src/img/*", "dist/img");
55+
await cpy("src/img/*", "dist/", { flat: true });
56+
57+
// Copy Perspective wasm assets for /static/*.wasm requests.
58+
copy_wasm_assets("dist");
18259

18360
await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1));
18461

18562
// Copy servable assets to python extension (exclude esm/)
186-
fs.mkdirSync("../csp_gateway/extension", { recursive: true });
187-
cpy("dist/**/*", "../csp_gateway/extension", {
188-
filter: (file) => !file.relativePath.startsWith("esm"),
189-
});
190-
>>>>>>> after updating
63+
fs.mkdirSync("../csp_gateway/server/build", { recursive: true });
64+
await cpy("dist/**/*", "../csp_gateway/server/build", { flat: true });
19165
}
19266

19367
build();

0 commit comments

Comments
 (0)