Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Blocks build script execution #2454

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions examples/blocks/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import * as fs from "fs";
import { get_examples, LOCAL_EXAMPLES } from "./examples.js";
import sh from "@finos/perspective-scripts/sh.mjs";
import * as url from "url";
import * as path from "node:path";

const version = JSON.parse(fs.readFileSync("./package.json")).version;
const __dirname = url.fileURLToPath(new URL(".", import.meta.url)).slice(0, -1);
Expand Down Expand Up @@ -69,16 +70,17 @@ export async function dist_examples(
`${outpath}/${name}/${filename}`,
filecontents
);

if (filename.endsWith("build.mjs")) {
console.log("Building " + name);
const script = `${outpath}/${name}/build.mjs`;
sh`node ${script}`.runSync();
}
} else if (filename !== ".git") {
sh`cp ${__dirname}/src/${name}/${filename} ${outpath}/${name}/${filename}`.runSync();
}
}

// build
if (fs.existsSync(path.join(outpath, name, "build.mjs"))) {
console.log("Building " + name);
const script = `${outpath}/${name}/build.mjs`;
sh`node ${script}`.runSync();
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions examples/blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"@finos/perspective-viewer-openlayers": "^2.7.0",
"@finos/perspective-workspace": "^2.7.0",
"superstore-arrow": "3.0.0"
},
"devDependencies": {
"esbuild": "^0.14.54"
}
}
5 changes: 3 additions & 2 deletions examples/blocks/src/superstore/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Demo of [Perspective](https://github.com/finos/perspective).

This example of a `<perspective-workspace>` dashboard is generated from one
[Apache Arrow]() source dataset, converted originally from this [XLS from a
Tableau presentation](https://community.tableau.com/docs/DOC-1236).
[Apache Arrow](https://arrow.apache.org/) source dataset,
converted originally from this
[XLS from a Tableau presentation](https://community.tableau.com/docs/DOC-1236).
This layout is just an example; you can explore your own visualizations in the Perspective
configuration menu, accessed by clicking the dropdown arrow in each pane's upper
left, or advanced options in the pane's right-click context menu.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import { test } from "@playwright/test";
import {
compareContentsToSnapshot,
compareLightDOMContents,
run_standard_tests,
} from "@finos/perspective-test";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ impl CopyDropDownMenuElement {
borrowed.as_apierror()?.hide()
}

/// Internal Only.
///
/// Set this custom element model's raw pointer.
#[allow(clippy::not_unsafe_ptr_arg_deref)]
pub fn unsafe_set_model(&self, ptr: *const PerspectiveViewerElement) {
let model = unsafe { ptr.as_ref().unwrap() };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ impl ExportDropDownMenuElement {
borrowed.as_apierror()?.hide()
}

/// Internal Only.
///
/// Set this custom element model's raw pointer.
#[allow(clippy::not_unsafe_ptr_arg_deref)]
pub fn unsafe_set_model(&self, ptr: *const PerspectiveViewerElement) {
let model = unsafe { ptr.as_ref().unwrap() };
Expand Down
2 changes: 1 addition & 1 deletion rust/perspective-viewer/src/rust/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl Session {
.create_replace_expression_update(&old_expr, new_expr)
}

/// Validate an expression strin and marshall the results.
/// Validate an expression string and marshall the results.
pub async fn validate_expr(
&self,
expr: &str,
Expand Down
6 changes: 3 additions & 3 deletions tools/perspective-scripts/sh.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ class Command extends Function {
* @returns {string} A command with the missing argument's flags removed.
* @example
* console.assert(
* bash`run -t${1} -u"${undefined}" task`,
* `run -t1 task`
* );s
* sh`run -t${1} -u"${undefined}" task`,
* sh`run -t1 task`
* );
*/
const sh = new Proxy(Command, {
apply(...args) {
Expand Down
Loading