diff --git a/cppjswasm/.gitattributes b/cppjswasm/.gitattributes index df3e022..971a600 100644 --- a/cppjswasm/.gitattributes +++ b/cppjswasm/.gitattributes @@ -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 diff --git a/cppjswasm/js/build.mjs.jinja b/cppjswasm/js/build.mjs.jinja index e8f3e67..ca1555b 100644 --- a/cppjswasm/js/build.mjs.jinja +++ b/cppjswasm/js/build.mjs.jinja @@ -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"); @@ -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() { diff --git a/cppjswasm/js/package.json.jinja b/cppjswasm/js/package.json.jinja index 72edc33..e80314f 100644 --- a/cppjswasm/js/package.json.jinja +++ b/cppjswasm/js/package.json.jinja @@ -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", @@ -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", diff --git a/cppjswasm/js/src/less/index.less b/cppjswasm/js/src/css/index.css similarity index 100% rename from cppjswasm/js/src/less/index.less rename to cppjswasm/js/src/css/index.css diff --git a/js/.gitattributes b/js/.gitattributes index bb7085b..aaf2698 100644 --- a/js/.gitattributes +++ b/js/.gitattributes @@ -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 diff --git a/js/js/build.mjs.jinja b/js/js/build.mjs.jinja index e8f3e67..ca1555b 100644 --- a/js/js/build.mjs.jinja +++ b/js/js/build.mjs.jinja @@ -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"); @@ -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() { diff --git a/js/js/package.json.jinja b/js/js/package.json.jinja index 66ae3ff..9cd6a7b 100644 --- a/js/js/package.json.jinja +++ b/js/js/package.json.jinja @@ -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", diff --git a/js/js/src/less/index.less b/js/js/src/css/index.css similarity index 100% rename from js/js/src/less/index.less rename to js/js/src/css/index.css diff --git a/jupyter/.gitattributes b/jupyter/.gitattributes index bb7085b..aaf2698 100644 --- a/jupyter/.gitattributes +++ b/jupyter/.gitattributes @@ -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 diff --git a/jupyter/js/jest.config.js b/jupyter/js/jest.config.js index 764a009..45f3f7b 100644 --- a/jupyter/js/jest.config.js +++ b/jupyter/js/jest.config.js @@ -18,7 +18,7 @@ const esModules = [ module.exports = { moduleDirectories: ["node_modules", "src", "tests"], moduleNameMapper: { - "\\.(css|less|sass|scss)$": "/tests/styleMock.js", + "\\.(css|sass|scss)$": "/tests/styleMock.js", "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/tests/fileMock.js", }, reporters: [ "default", "jest-junit" ], @@ -26,7 +26,7 @@ module.exports = { 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}))`], }; diff --git a/rustjswasm/.gitattributes b/rustjswasm/.gitattributes index e3e8131..f048eda 100644 --- a/rustjswasm/.gitattributes +++ b/rustjswasm/.gitattributes @@ -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 diff --git a/rustjswasm/js/build.mjs.jinja b/rustjswasm/js/build.mjs.jinja index e8f3e67..ca1555b 100644 --- a/rustjswasm/js/build.mjs.jinja +++ b/rustjswasm/js/build.mjs.jinja @@ -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"); @@ -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() { diff --git a/rustjswasm/js/package.json.jinja b/rustjswasm/js/package.json.jinja index 1d9d44b..977bd40 100644 --- a/rustjswasm/js/package.json.jinja +++ b/rustjswasm/js/package.json.jinja @@ -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", @@ -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", diff --git a/rustjswasm/js/src/less/index.less b/rustjswasm/js/src/css/index.css similarity index 100% rename from rustjswasm/js/src/less/index.less rename to rustjswasm/js/src/css/index.css