Skip to content
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
1 change: 0 additions & 1 deletion cppjswasm/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Makefile linguist-documentation
*.html text=auto eol=lf
*.js text=auto eol=lf
*.json text=auto eol=lf
*.less text=auto eol=lf
*.md text=auto eol=lf
*.py text=auto eol=lf
*.toml text=auto eol=lf
Expand Down
41 changes: 19 additions & 22 deletions cppjswasm/js/build.mjs.jinja
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { NodeModulesExternal } from "@finos/perspective-esbuild-plugin/external.js";
import { build } from "@finos/perspective-esbuild-plugin/build.js";
import { BuildCss } from "@prospective.co/procss/target/cjs/procss.js";
import { transform } from "lightningcss";
import { getarg } from "./tools/getarg.mjs";
import fs from "fs";
import cpy from "cpy";
import path_mod from "path";

const DEBUG = getarg("--debug");

Expand Down Expand Up @@ -40,31 +39,29 @@ const BUILD = [

async function compile_css() {
const process_path = (path) => {
const outpath = path.replace("src/less", "dist/css");
const outpath = path.replace("src/css", "dist/css");
fs.mkdirSync(outpath, { recursive: true });

fs.readdirSync(path).forEach((file_or_folder) => {
if (file_or_folder.endsWith(".less")) {
const outfile = file_or_folder.replace(".less", ".css");
const builder = new BuildCss("");
builder.add(
`${path}/${file_or_folder}`,
fs
.readFileSync(path_mod.join(`${path}/${file_or_folder}`))
.toString(),
);
fs.writeFileSync(
`${path.replace("src/less", "dist/css")}/${outfile}`,
builder.compile().get(outfile),
);
} else {
process_path(`${path}/${file_or_folder}`);
fs.readdirSync(path, { withFileTypes: true }).forEach((entry) => {
const input = `${path}/${entry.name}`;
const output = `${outpath}/${entry.name}`;

if (entry.isDirectory()) {
process_path(input);
} else if (entry.isFile() && entry.name.endsWith(".css")) {
const source = fs.readFileSync(input);
const { code } = transform({
filename: entry.name,
code: source,
minify: !DEBUG,
sourceMap: false,
});
fs.writeFileSync(output, code);
}
});
};
// recursively process all less files in src/less
process_path("src/less");
cpy("src/css/*", "dist/css/");

process_path("src/css");
}

async function copy_html() {
Expand Down
9 changes: 4 additions & 5 deletions cppjswasm/js/package.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"build": "npm-run-all build:cpp build:prod",
"clean": "rm -rf dist lib playwright-report ../{{module}}/extension",
"dev": "npm-run-all -p start watch",
"lint:js": "prettier --check \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"lint:js": "prettier --check \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"lint:cpp": "clang-format --dry-run -Werror -style=file:../.clang-format src/cpp/*.cpp",
"lint": "npm-run-all lint:*",
"fix:js": "prettier --write \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"fix:js": "prettier --write \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"fix:cpp": "clang-format -i -style=file:../.clang-format src/cpp/*.cpp",
"fix": "npm-run-all fix:*",
"preinstall": "npx only-allow pnpm",
Expand All @@ -44,16 +44,15 @@
"start:tests": "http-server -p 3000 ",
"test:js": "playwright test",
"test": "npm-run-all test:*",
"watch": "nodemon --watch src -e ts,less,html,cpp,hpp --exec \"pnpm build:debug\""
"watch": "nodemon --watch src -e ts,css,html,cpp,hpp --exec \"pnpm build:debug\""
},
"dependencies": {},
"devDependencies": {
"@finos/perspective-esbuild-plugin": "^3.2.1",
"@playwright/test": "^1.56.1",
"@prospective.co/procss": "^0.1.17",
"cpy": "^12.1.0",
"esbuild": "^0.27.2",
"esbuild-plugin-less": "^1.3.35",
"lightningcss": "^1.29.3",
"http-server": "^14.1.1",
"nodemon": "^3.1.10",
"npm-run-all": "^4.1.5",
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion js/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Makefile linguist-documentation
*.html text=auto eol=lf
*.js text=auto eol=lf
*.json text=auto eol=lf
*.less text=auto eol=lf
*.md text=auto eol=lf
*.py text=auto eol=lf
*.toml text=auto eol=lf
Expand Down
41 changes: 19 additions & 22 deletions js/js/build.mjs.jinja
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { NodeModulesExternal } from "@finos/perspective-esbuild-plugin/external.js";
import { build } from "@finos/perspective-esbuild-plugin/build.js";
import { BuildCss } from "@prospective.co/procss/target/cjs/procss.js";
import { transform } from "lightningcss";
import { getarg } from "./tools/getarg.mjs";
import fs from "fs";
import cpy from "cpy";
import path_mod from "path";

const DEBUG = getarg("--debug");

Expand Down Expand Up @@ -40,31 +39,29 @@ const BUILD = [

async function compile_css() {
const process_path = (path) => {
const outpath = path.replace("src/less", "dist/css");
const outpath = path.replace("src/css", "dist/css");
fs.mkdirSync(outpath, { recursive: true });

fs.readdirSync(path).forEach((file_or_folder) => {
if (file_or_folder.endsWith(".less")) {
const outfile = file_or_folder.replace(".less", ".css");
const builder = new BuildCss("");
builder.add(
`${path}/${file_or_folder}`,
fs
.readFileSync(path_mod.join(`${path}/${file_or_folder}`))
.toString(),
);
fs.writeFileSync(
`${path.replace("src/less", "dist/css")}/${outfile}`,
builder.compile().get(outfile),
);
} else {
process_path(`${path}/${file_or_folder}`);
fs.readdirSync(path, { withFileTypes: true }).forEach((entry) => {
const input = `${path}/${entry.name}`;
const output = `${outpath}/${entry.name}`;

if (entry.isDirectory()) {
process_path(input);
} else if (entry.isFile() && entry.name.endsWith(".css")) {
const source = fs.readFileSync(input);
const { code } = transform({
filename: entry.name,
code: source,
minify: !DEBUG,
sourceMap: false,
});
fs.writeFileSync(output, code);
}
});
};
// recursively process all less files in src/less
process_path("src/less");
cpy("src/css/*", "dist/css/");

process_path("src/css");
}

async function copy_html() {
Expand Down
9 changes: 4 additions & 5 deletions js/js/package.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,22 @@
"build": "node build.mjs",
"clean": "rm -rf dist playwright-report ../{{module}}/extension",
"dev": "npm-run-all -p start watch",
"lint": "prettier --check \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"fix": "prettier --write \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"lint": "prettier --check \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"fix": "prettier --write \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"preinstall": "npx only-allow pnpm",
"prepack": "npm run build",
"start": "http-server -p 3000 -o examples/",
"start:tests": "http-server -p 3000 ",
"test": "TZ=UTC playwright test",
"watch": "nodemon --watch src -e ts,less,html --exec \"pnpm build:debug\""
"watch": "nodemon --watch src -e ts,css,html --exec \"pnpm build:debug\""
},
"dependencies": {},
"devDependencies": {
"@finos/perspective-esbuild-plugin": "^3.2.1",
"@playwright/test": "^1.56.1",
"@prospective.co/procss": "^0.1.17",
"cpy": "^12.1.0",
"esbuild": "^0.27.2",
"esbuild-plugin-less": "^1.3.35",
"lightningcss": "^1.29.3",
"http-server": "^14.1.1",
"nodemon": "^3.1.10",
"npm-run-all": "^4.1.5",
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion jupyter/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Makefile linguist-documentation
*.html text=auto eol=lf
*.js text=auto eol=lf
*.json text=auto eol=lf
*.less text=auto eol=lf
*.md text=auto eol=lf
*.py text=auto eol=lf
*.toml text=auto eol=lf
Expand Down
4 changes: 2 additions & 2 deletions jupyter/js/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ const esModules = [
module.exports = {
moduleDirectories: ["node_modules", "src", "tests"],
moduleNameMapper: {
"\\.(css|less|sass|scss)$": "<rootDir>/tests/styleMock.js",
"\\.(css|sass|scss)$": "<rootDir>/tests/styleMock.js",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/tests/fileMock.js",
},
reporters: [ "default", "jest-junit" ],
setupFiles: ["<rootDir>/tests/setup.js"],
testEnvironment: "jsdom",
transform: {
"^.+\\.jsx?$": "babel-jest",
".+\\.(css|styl|less|sass|scss)$": "jest-transform-css",
".+\\.(css|styl|sass|scss)$": "jest-transform-css",
},
transformIgnorePatterns: [`/node_modules/.pnpm/(?!(${esModules}))`],
};
1 change: 0 additions & 1 deletion rustjswasm/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Makefile linguist-documentation
*.html text=auto eol=lf
*.js text=auto eol=lf
*.json text=auto eol=lf
*.less text=auto eol=lf
*.md text=auto eol=lf
*.py text=auto eol=lf
*.rs text=auto eol=lf
Expand Down
41 changes: 19 additions & 22 deletions rustjswasm/js/build.mjs.jinja
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { NodeModulesExternal } from "@finos/perspective-esbuild-plugin/external.js";
import { build } from "@finos/perspective-esbuild-plugin/build.js";
import { BuildCss } from "@prospective.co/procss/target/cjs/procss.js";
import { transform } from "lightningcss";
import { getarg } from "./tools/getarg.mjs";
import fs from "fs";
import cpy from "cpy";
import path_mod from "path";

const DEBUG = getarg("--debug");

Expand Down Expand Up @@ -40,31 +39,29 @@ const BUILD = [

async function compile_css() {
const process_path = (path) => {
const outpath = path.replace("src/less", "dist/css");
const outpath = path.replace("src/css", "dist/css");
fs.mkdirSync(outpath, { recursive: true });

fs.readdirSync(path).forEach((file_or_folder) => {
if (file_or_folder.endsWith(".less")) {
const outfile = file_or_folder.replace(".less", ".css");
const builder = new BuildCss("");
builder.add(
`${path}/${file_or_folder}`,
fs
.readFileSync(path_mod.join(`${path}/${file_or_folder}`))
.toString(),
);
fs.writeFileSync(
`${path.replace("src/less", "dist/css")}/${outfile}`,
builder.compile().get(outfile),
);
} else {
process_path(`${path}/${file_or_folder}`);
fs.readdirSync(path, { withFileTypes: true }).forEach((entry) => {
const input = `${path}/${entry.name}`;
const output = `${outpath}/${entry.name}`;

if (entry.isDirectory()) {
process_path(input);
} else if (entry.isFile() && entry.name.endsWith(".css")) {
const source = fs.readFileSync(input);
const { code } = transform({
filename: entry.name,
code: source,
minify: !DEBUG,
sourceMap: false,
});
fs.writeFileSync(output, code);
}
});
};
// recursively process all less files in src/less
process_path("src/less");
cpy("src/css/*", "dist/css/");

process_path("src/css");
}

async function copy_html() {
Expand Down
9 changes: 4 additions & 5 deletions rustjswasm/js/package.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"build": "npm-run-all build:rust build:wasm-bindgen build:prod",
"clean": "rm -rf dist lib playwright-report ../{{module}}/extension",
"dev": "npm-run-all -p start watch",
"lint:js": "prettier --check \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"lint:js": "prettier --check \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"lint:rust": "cargo clippy --all-features && cargo fmt --all -- --check",
"lint": "npm-run-all lint:*",
"fix:js": "prettier --write \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"fix:js": "prettier --write \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"fix:rust": "cargo fmt --all",
"fix": "npm-run-all fix:*",
"preinstall": "npx only-allow pnpm",
Expand All @@ -47,16 +47,15 @@
"test:js": "playwright test",
"test:rust": "cargo test -- --show-output",
"test": "npm-run-all test:rust test:js",
"watch": "nodemon --watch src -e ts,less,html --exec \"pnpm build:debug\""
"watch": "nodemon --watch src -e ts,css,html --exec \"pnpm build:debug\""
},
"dependencies": {},
"devDependencies": {
"@finos/perspective-esbuild-plugin": "^3.2.1",
"@playwright/test": "^1.56.1",
"@prospective.co/procss": "^0.1.17",
"cpy": "^12.1.0",
"esbuild": "^0.27.2",
"esbuild-plugin-less": "^1.3.35",
"lightningcss": "^1.29.3",
"http-server": "^14.1.1",
"nodemon": "^3.1.10",
"npm-run-all": "^4.1.5",
Expand Down
File renamed without changes.
Loading