diff --git a/.copier-answers.yaml b/.copier-answers.yaml index d0e0b9a..8f017a7 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: 9be318c +_commit: '1246721' _src_path: https://github.com/python-project-templates/base.git add_docs: true add_extension: rustjswasm diff --git a/.gitattributes b/.gitattributes index e3e8131..f048eda 100644 --- a/.gitattributes +++ b/.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/.github/workflows/build.yaml b/.github/workflows/build.yaml index 84b1386..fa3deef 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -78,7 +78,7 @@ jobs: if: matrix.os == 'ubuntu-latest' - name: Upload coverage - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v6 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/js/Cargo.toml b/js/Cargo.toml index 8b76e97..2134c69 100644 --- a/js/Cargo.toml +++ b/js/Cargo.toml @@ -13,4 +13,4 @@ crate-type = ["cdylib"] [dependencies] python_template_rust = { path = "../rust", version = "*" } -wasm-bindgen = "0.2.114" +wasm-bindgen = "=0.2.115" diff --git a/js/build.mjs b/js/build.mjs index 76e31d1..40e8b47 100644 --- a/js/build.mjs +++ b/js/build.mjs @@ -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/package.json b/js/package.json index c07a2e1..52b7329 100644 --- a/js/package.json +++ b/js/package.json @@ -26,7 +26,7 @@ "access": "public" }, "scripts": { - "setup": "cargo install -f wasm-bindgen-cli --version 0.2.114", + "setup": "cargo install -f wasm-bindgen-cli --version 0.2.115 --locked", "build:debug": "node build.mjs --debug", "build:rust": "cargo build --release --all-features --target wasm32-unknown-unknown", "build:wasm-bindgen": "wasm-bindgen ../target/wasm32-unknown-unknown/release/python_template_rust.wasm --out-dir ./dist/pkg --target web", @@ -34,10 +34,10 @@ "build": "npm-run-all build:rust build:wasm-bindgen build:prod", "clean": "rm -rf dist lib playwright-report ../python_template_rust/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,23 @@ "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", +<<<<<<< before updating "@playwright/test": "^1.58.2", "@prospective.co/procss": "^0.1.18", "cpy": "^13.2.1", "esbuild": "^0.27.2", "esbuild-plugin-less": "^1.3.36", +======= + "@playwright/test": "^1.56.1", + "cpy": "^12.1.0", + "esbuild": "^0.27.2", + "lightningcss": "^1.29.3", +>>>>>>> after updating "http-server": "^14.1.1", "nodemon": "^3.1.14", "npm-run-all": "^4.1.5", diff --git a/js/src/less/index.less b/js/src/css/index.css similarity index 100% rename from js/src/less/index.less rename to js/src/css/index.css diff --git a/rust/Makefile b/rust/Makefile index 9e184ae..91a7013 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -5,7 +5,7 @@ requirements: ## install required dev dependencies rustup component add clippy cargo install -f cargo-nextest --locked cargo install -f cargo-llvm-cov - cargo install -f wasm-bindgen-cli --version 0.2.114 + cargo install -f wasm-bindgen-cli --version 0.2.115 --locked rustup target add wasm32-unknown-unknown develop: requirements ## install required dev dependencies