diff --git a/.github/PULL_REQUEST_TEMPLATE/Documentation.md b/.github/PULL_REQUEST_TEMPLATE/Documentation.md index 901684c595..9574b2df55 100644 --- a/.github/PULL_REQUEST_TEMPLATE/Documentation.md +++ b/.github/PULL_REQUEST_TEMPLATE/Documentation.md @@ -12,18 +12,18 @@ about: Improves documentation for the API or on the docs website. - [ ] I have linted, spell-checked, and grammar-checked my documentation additions. -- [ ] I have run `yarn docs` to regenerate the API documentation from source. -- [ ] Within `/docs`, I have run `yarn start` to regenerate the Docusaurus site, and I have validated the changes +- [ ] I have run `pnpm run docs` to regenerate the API documentation from source. +- [ ] Within `/docs`, I have run `pnpm run start` to regenerate the Docusaurus site, and I have validated the changes - [ ] My additions are styled and structured correctly on the Docusaurus site ## Checklist diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 008b23b7f3..d4f37dc9d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # for pull_request so we can do HEAD^2 fetch-depth: 2 @@ -191,7 +191,7 @@ jobs: - ubuntu-22.04 # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md python-version: - 3.9 - node-version: [18.x] + node-version: [20.x] # NOTE: don't fail fast as sometimes npm blocks the burst of fetches from GHA fail-fast: false @@ -203,7 +203,7 @@ jobs: steps: - name: Clean System - uses: AdityaGarg8/remove-unwanted-software@v2 + uses: AdityaGarg8/remove-unwanted-software@v3 if: ${{ runner.os == 'Linux' }} with: remove-android: "true" @@ -212,33 +212,21 @@ jobs: remove-codeql: "true" - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 ########## # Caches # ########## - ################ - # Yarn Cache - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - shell: bash - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} - - name: Setup yarn cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + ################ + # PNPM Cache + - name: Install pnpm + uses: pnpm/action-setup@v3 with: - path: | - ~/.cache/ms-playwright - ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} + version: 9 - name: Setup emsdk cache - uses: actions/cache@v3 + uses: actions/cache@v4 id: emsdk-cache with: path: .emsdk @@ -250,7 +238,7 @@ jobs: ################ # Pip Cache - name: Setup pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} @@ -261,7 +249,7 @@ jobs: ################ # Cargo Cache - name: Setup cargo cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/bin/ @@ -284,17 +272,17 @@ jobs: # Language and Compiler Setup # ############################### - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml - name: Install latest nightly rust uses: dtolnay/rust-toolchain@nightly @@ -307,23 +295,21 @@ jobs: # Dependencies # ################ ################ + # Install LLVM - also adds .llvm/bin to the PATH - name: Install LLVM 17 - uses: KyleMayes/install-llvm-action@v1 + uses: KyleMayes/install-llvm-action@v2 with: version: "17" directory: "./.llvm" # JS - - name: Install yarn - run: npm install -g yarn - - name: Install js dependencies - run: yarn + run: pnpm install ################ # Python - name: Install python dependencies - run: yarn _requires_python + run: pnpm run _requires_python ################ # Linux @@ -342,15 +328,15 @@ jobs: ############### - name: WebAssembly Build - run: yarn build_js --ci + run: pnpm run build_js --ci env: PSP_USE_CCACHE: 1 # - name: Docs Build - # run: yarn docs + # run: pnpm run docs - name: Lint - run: yarn lint + run: pnpm run lint env: PSP_PROJECT: "js" @@ -361,65 +347,65 @@ jobs: # Upload built JS artifacts for tests # # (listed here in the same order they appear in the directory) - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-dist path: packages/perspective/dist/ - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-jupyterlab-dist path: packages/perspective-jupyterlab/dist/ - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-viewer-d3fc-dist path: packages/perspective-viewer-d3fc/dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-viewer-datagrid-dist path: packages/perspective-viewer-datagrid/dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-viewer-openlayers-dist path: packages/perspective-viewer-openlayers/dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-esbuild-plugin-dist path: packages/perspective-esbuild-plugin/dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-webpack-plugin-dist path: packages/perspective-webpack-plugin/dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-cli-dist path: packages/perspective-cli/dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-workspace-dist path: packages/perspective-workspace/dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-viewer-dist path: rust/perspective-viewer/dist ###################################################### # Upload Jupyter artifacts for python build/test/dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: nbextension-dist path: python/perspective/perspective/nbextension if-no-files-found: error # TODO - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: labextension-dist path: python/perspective/perspective/labextension @@ -460,10 +446,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install LLVM 17 - uses: KyleMayes/install-llvm-action@v1 + uses: KyleMayes/install-llvm-action@v2 with: version: "17" directory: "./.llvm" @@ -471,30 +457,18 @@ jobs: ########## # Caches # ########## - ################ - # Yarn Cache - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - shell: bash - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} - - name: Setup yarn cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + ################ + # PNPM Cache + - name: Install pnpm + uses: pnpm/action-setup@v3 with: - path: | - ~/.cache/ms-playwright - ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} + version: 9 ################ # Pip Cache - name: Setup pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} @@ -506,35 +480,32 @@ jobs: # Language and Compiler Setup # ############################### - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml ################ # Dependencies # ################ ################ # JS - - name: Install yarn - run: npm install -g yarn - - name: Install js dependencies - run: yarn + run: pnpm install env: PSP_SKIP_EMSDK_INSTALL: 1 ################ # Python - name: Install python dependencies - run: yarn _requires_python + run: pnpm run _requires_python #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# #~~~~~~~~~ Build Pipelines ~~~~~~~~~# @@ -545,13 +516,13 @@ jobs: ######## # Linux - name: Python Lint (Linux) - run: yarn lint + run: pnpm run lint env: PYTHON_VERSION: ${{ matrix.python-version }} PSP_PROJECT: python - name: JavaScript Lint - run: yarn lint + run: pnpm run lint env: PYTHON_VERSION: ${{ matrix.python-version }} PSP_PROJECT: js @@ -580,7 +551,7 @@ jobs: - ubuntu-20.04 # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md python-version: - 3.9 - node-version: [18.x] + node-version: [20.x] # NOTE: don't fail fast as sometimes npm blocks the burst of fetches from GHA fail-fast: false @@ -592,35 +563,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 ########## # Caches # ########## ################ - # Yarn Cache - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - shell: bash - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} - - - name: Setup yarn cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Install pnpm + uses: pnpm/action-setup@v3 with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ~/.cache/ms-playwright - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} + version: 9 ################ # Pip Cache - name: Setup pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} @@ -631,7 +588,7 @@ jobs: ################ # Cargo Cache - name: Setup cargo cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/bin/ @@ -646,35 +603,32 @@ jobs: # Language and Compiler Setup # ############################### - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml ################ # Dependencies # ################ ################ # JS - - name: Install yarn - run: npm install -g yarn - - name: Install js dependencies - run: yarn + run: pnpm install env: PSP_SKIP_EMSDK_INSTALL: 1 ################ # Python - name: Install python dependencies - run: yarn _requires_python + run: pnpm run _requires_python ################ # Rust @@ -688,37 +642,37 @@ jobs: #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# #~~~~~~~~~ Build Pipelines ~~~~~~~~~# #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-dist path: packages/perspective/dist/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-jupyterlab-dist path: packages/perspective-jupyterlab/dist/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-d3fc-dist path: packages/perspective-viewer-d3fc/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-datagrid-dist path: packages/perspective-viewer-datagrid/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-openlayers-dist path: packages/perspective-viewer-openlayers/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-workspace-dist path: packages/perspective-workspace/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-dist path: rust/perspective-viewer/dist @@ -727,12 +681,12 @@ jobs: # WebAssembly # ############### - name: WebAssembly Test - run: yarn test_js --ci + run: pnpm run test_js --ci ###################### # Fancy HTML reports # ###################### - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: failure() with: name: playwright-report @@ -757,98 +711,81 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - node-version: [18.x] + node-version: [20.x] runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 ########## # Caches # ########## ################ - # Yarn Cache - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - shell: bash - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} - - - name: Setup yarn cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Install pnpm + uses: pnpm/action-setup@v3 with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ~/.cache/ms-playwright - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} + version: 9 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml ################ # Dependencies # ################ ################ # JS - - name: Install yarn - run: npm install -g yarn - - name: Install js dependencies - run: yarn + run: pnpm install env: PSP_SKIP_EMSDK_INSTALL: 1 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# #~~~~~~~~~ Build Pipelines ~~~~~~~~~# #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-dist path: packages/perspective/dist/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-jupyterlab-dist path: packages/perspective-jupyterlab/dist/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-d3fc-dist path: packages/perspective-viewer-d3fc/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-datagrid-dist path: packages/perspective-viewer-datagrid/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-openlayers-dist path: packages/perspective-viewer-openlayers/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-workspace-dist path: packages/perspective-workspace/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-dist path: rust/perspective-viewer/dist - name: Benchmarks - run: yarn bench + run: pnpm run bench - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-js-benchmarks path: tools/perspective-bench/dist/benchmark-js.arrow @@ -895,7 +832,7 @@ jobs: container: - none # Not manylinux, we will use this space to build the WASM assets - 2014 - node-version: [18.x] + node-version: [20.x] is-full-run: - ${{ needs.initialize.outputs.FULL_RUN == 'true' }} include-windows-run: @@ -948,7 +885,7 @@ jobs: steps: - name: Clean System - uses: AdityaGarg8/remove-unwanted-software@v2 + uses: AdityaGarg8/remove-unwanted-software@v3 if: ${{ runner.os == 'Linux' }} with: remove-android: "true" @@ -957,7 +894,7 @@ jobs: remove-codeql: "true" - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 ##################################################### # Conditionals # @@ -974,12 +911,12 @@ jobs: ################ # JS Artifacts # ################ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: nbextension-dist path: python/perspective/perspective/nbextension - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: labextension-dist path: python/perspective/perspective/labextension @@ -988,29 +925,15 @@ jobs: # Caches # ########## ################ - # Yarn Cache - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - shell: bash - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} - - - name: Setup yarn cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Install pnpm + uses: pnpm/action-setup@v3 with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ~/.cache/ms-playwright - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} + version: 9 ################ # Pip Cache - name: Setup pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} @@ -1021,7 +944,7 @@ jobs: ################ # Homebrew Cache - name: Setup homebrew cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/Library/Caches/Homebrew/boost--* @@ -1033,7 +956,7 @@ jobs: ################ # vcpkg Cache - name: Setup vcpkg cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | C:\Users\runneradmin\AppData\Local\vcpkg\archives @@ -1049,18 +972,18 @@ jobs: # Language and Compiler Setup # ############################### - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" if: ${{ runner.os != 'Linux' }} # skip on manylinux2014 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml if: ${{ runner.os != 'Linux' }} # skip on manylinux2014 ################ @@ -1068,26 +991,22 @@ jobs: ################ ################ # - name: Install LLVM 17 - # uses: KyleMayes/install-llvm-action@v1 + # uses: KyleMayes/install-llvm-action@v2 # if: false # with: # version: "17" # directory: "./.llvm" # JS - - name: Install yarn - run: npm install -g yarn - if: ${{ runner.os != 'Linux' }} - - name: Install js dependencies - run: yarn + run: pnpm install env: PSP_SKIP_EMSDK_INSTALL: 1 ################ # Python - name: Install python dependencies - run: yarn _requires_python + run: pnpm run _requires_python if: ${{ runner.os != 'Linux' }} # skip on manylinux2014 ################ @@ -1123,7 +1042,7 @@ jobs: ######## # Linux - name: Python Wheel Steps (Linux) - run: yarn _wheel_python --ci + run: pnpm run _wheel_python --ci env: PYTHON_VERSION: ${{ matrix.python-version }} MANYLINUX: ${{ matrix.container }} @@ -1134,8 +1053,8 @@ jobs: # Macos - name: Python Build Steps (Macos) run: | - yarn _wheel_python --ci --macos - yarn _wheel_python --ci --macos --arm + pnpm run _wheel_python --ci --macos + pnpm run _wheel_python --ci --macos --arm env: PYTHON_VERSION: ${{ matrix.python-version }} if: ${{ runner.os == 'macOS' }} @@ -1152,7 +1071,7 @@ jobs: ########## # Windows - name: Python Build Steps (Windows vc14.3) - run: yarn _wheel_python --ci + run: pnpm run _wheel_python --ci env: PSP_GENERATOR: Visual Studio 17 2022 PSP_VCPKG_PATH: C:/vcpkg/scripts/buildsystems/vcpkg.cmake @@ -1161,19 +1080,19 @@ jobs: #################### # Upload artifacts # #################### - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-python-dist-${{ matrix.os }}-${{ matrix.python-version }} path: python/perspective/dist/*.whl if: ${{ runner.os == 'Windows' }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-python-dist-${{ matrix.os }}-${{ matrix.python-version }} path: python/perspective/wheelhouse/*.whl if: ${{ runner.os != 'Windows' }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-python-sdist path: python/perspective/dist/*.tar.gz @@ -1210,9 +1129,9 @@ jobs: - name: copy files run: | - npm install -g yarn - yarn --frozen-lockfile - yarn build_python --setup-only + npm install -g pnpm + pnpm install --frozen-lockfile + pnpm run build_python --setup-only - name: Linux init steps run: sudo node tools/perspective-scripts/install_tools.mjs @@ -1227,7 +1146,7 @@ jobs: run: pyodide build python/perspective --exports=pyinit - name: Upload pyodide wheel - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: perspective-python-dist-pyodide path: dist/*.whl @@ -1259,7 +1178,7 @@ jobs: - ubuntu-20.04 # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md python-version: - 3.9 - node-version: [18.x] + node-version: [20.x] # NOTE: don't fail fast as sometimes npm blocks the burst of fetches from GHA fail-fast: false @@ -1271,44 +1190,44 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-dist path: packages/perspective/dist/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-jupyterlab-dist path: packages/perspective-jupyterlab/dist/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-d3fc-dist path: packages/perspective-viewer-d3fc/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-datagrid-dist path: packages/perspective-viewer-datagrid/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-workspace-dist path: packages/perspective-workspace/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-dist path: rust/perspective-viewer/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: nbextension-dist path: python/perspective/perspective/nbextension - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: labextension-dist path: python/perspective/perspective/labextension @@ -1317,29 +1236,15 @@ jobs: # Caches # ########## ################ - # Yarn Cache - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - shell: bash - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} - - - name: Setup yarn cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Install pnpm + uses: pnpm/action-setup@v3 with: - path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ~/.cache/ms-playwright - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} + version: 9 ################ # Pip Cache - name: Setup pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} @@ -1351,28 +1256,25 @@ jobs: # Language and Compiler Setup # ############################### - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml ################ # Dependencies # ################ ################ # JS - - name: Install yarn - run: npm install -g yarn - - name: Install js dependencies - run: yarn --frozen-lockfile + run: pnpm install --frozen-lockfile env: PSP_SKIP_EMSDK_INSTALL: 1 @@ -1382,10 +1284,10 @@ jobs: ################ # Python - name: Install python dependencies - run: yarn _requires_python + run: pnpm run _requires_python # Download artifact - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-${{ matrix.os }}-${{ matrix.python-version }} @@ -1400,7 +1302,7 @@ jobs: run: jupyter labextension list - name: Run Jupyterlab tests - run: yarn test_js --jupyter + run: pnpm run test_js --jupyter env: PACKAGE: perspective-jupyterlab @@ -1437,7 +1339,7 @@ jobs: - 3.9 - "3.10" - 3.11 - node-version: [18.x] + node-version: [20.x] is-full-run: - ${{ needs.initialize.outputs.FULL_RUN == 'true' }} include-windows-run: @@ -1482,35 +1384,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 ########## # Caches # ########## ################ - # Yarn Cache - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - shell: bash - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} - - - name: Setup yarn cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Install pnpm + uses: pnpm/action-setup@v3 with: - path: | - ~/.cache/ms-playwright - ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} + version: 9 ################ # Pip Cache - name: Setup pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} @@ -1522,35 +1410,32 @@ jobs: # Language and Compiler Setup # ############################### - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml ################ # Dependencies # ################ ################ # JS - - name: Install yarn - run: npm install -g yarn - - name: Install js dependencies - run: yarn + run: pnpm install env: PSP_SKIP_EMSDK_INSTALL: 1 ################ # Python - name: Install python dependencies - run: yarn _requires_python + run: pnpm run _requires_python #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# #~~~~~~~~~ Build Pipelines ~~~~~~~~~# @@ -1559,7 +1444,7 @@ jobs: # Python - Test # ################# # Download artifact - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-${{ matrix.os }}-${{ matrix.python-version }} @@ -1584,7 +1469,7 @@ jobs: # Run tests - name: Python Test Steps - run: yarn test_python --debug + run: pnpm run test_python --debug ########################################################################################################################## ########################################################################################################################## @@ -1622,35 +1507,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 ########## # Caches # ########## ################ - # Yarn Cache - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - shell: bash - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} - - - name: Setup yarn cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Install pnpm + uses: pnpm/action-setup@v3 with: - path: | - ~/.cache/ms-playwright - ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} + version: 9 ################ # Pip Cache - name: Setup pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} @@ -1662,28 +1533,25 @@ jobs: # Language and Compiler Setup # ############################### - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml ################ # Dependencies # ################ ################ # JS - - name: Install yarn - run: npm install -g yarn - - name: Install js dependencies - run: yarn --frozen-lockfile + run: pnpm install --frozen-lockfile env: PSP_SKIP_EMSDK_INSTALL: 1 @@ -1695,13 +1563,13 @@ jobs: ################ # Python - name: Install python dependencies - run: yarn _requires_python + run: pnpm run _requires_python #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# #~~~~~~~~~ Build Pipelines ~~~~~~~~~# #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Download sdist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-sdist @@ -1737,40 +1605,26 @@ jobs: matrix: os: [ubuntu-20.04] python-version: [3.11] - node-version: [18.x] + node-version: [20.x] if: startsWith(github.ref, 'refs/tags/v') runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 ########## # Caches # ########## ################ - # Yarn Cache - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - shell: bash - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} - - - name: Setup yarn cache - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Install pnpm + uses: pnpm/action-setup@v3 with: - path: | - ~/.cache/ms-playwright - ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - if: ${{ needs.initialize.outputs.SKIP_CACHE == 'false' }} + version: 9 ################ # Pip Cache - name: Setup pip cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} @@ -1782,35 +1636,32 @@ jobs: # Language and Compiler Setup # ############################### - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - cache-dependency-path: yarn.lock + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml ################ # Dependencies # ################ ################ # JS - - name: Install yarn - run: npm install -g yarn - - name: Install js dependencies - run: yarn + run: pnpm install env: PSP_SKIP_EMSDK_INSTALL: 1 ################ # Python - name: Install python dependencies - run: yarn _requires_python + run: pnpm rin _requires_python #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# #~~~~~~~~~ Build Pipelines ~~~~~~~~~# @@ -1819,7 +1670,7 @@ jobs: # Python - Test # ################# # Download artifact - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-${{ matrix.os }}-${{ matrix.python-version }} @@ -1829,12 +1680,12 @@ jobs: if: ${{ runner.os == 'Linux' }} - name: Run Benchmark - run: yarn bench + run: pnpm run bench shell: bash env: PSP_PROJECT: python - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: perspective-python-benchmarks path: tools/perspective-bench/dist/benchmark-python.arrow @@ -1878,161 +1729,187 @@ jobs: # path is empty, but `actions/downlaod-artifact` fails, and 3 JS # packages have no `dist`. - # - uses: actions/download-artifact@v3 + # - uses: actions/download-artifact@v4 # with: # name: perspective-cli-dist # path: packages/perspective-cli/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-dist path: packages/perspective/dist/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-jupyterlab-dist path: packages/perspective-jupyterlab/dist/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-d3fc-dist path: packages/perspective-viewer-d3fc/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-datagrid-dist path: packages/perspective-viewer-datagrid/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-openlayers-dist path: packages/perspective-viewer-openlayers/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-workspace-dist path: packages/perspective-workspace/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-viewer-dist path: rust/perspective-viewer/dist - # - uses: actions/download-artifact@v3 + # - uses: actions/download-artifact@v4 # with: # name: perspective-esbuild-plugin-dist # path: packages/perspective-esbuild-plugin/dist - # - uses: actions/download-artifact@v3 + # - uses: actions/download-artifact@v4 # with: # name: perspective-webpack-plugin-dist # path: packages/perspective-webpack-plugin/dist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: nbextension-dist path: python/perspective/perspective/nbextension - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: labextension-dist path: python/perspective/perspective/labextension - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-ubuntu-20.04-3.7 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-ubuntu-20.04-3.8 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-ubuntu-20.04-3.9 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-ubuntu-20.04-3.10 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-ubuntu-20.04-3.11 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-macos-11-3.7 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-macos-11-3.8 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-macos-11-3.9 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-macos-11-3.10 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-macos-11-3.11 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-windows-2022-3.7 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-windows-2022-3.8 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-windows-2022-3.9 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-windows-2022-3.10 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-windows-2022-3.11 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-dist-pyodide - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-sdist - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-js-benchmarks - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: perspective-python-benchmarks - - name: NPM pack - run: | - npm pack \ - --workspace=@finos/perspective \ - --workspace=@finos/perspective-viewer \ - --workspace=@finos/perspective-viewer-datagrid \ - --workspace=@finos/perspective-viewer-d3fc \ - --workspace=@finos/perspective-viewer-openlayers \ - --workspace=@finos/perspective-workspace \ - --workspace=@finos/perspective-cli \ - --workspace=@finos/perspective-webpack-plugin \ - --workspace=@finos/perspective-esbuild-plugin \ - --workspace=@finos/perspective-jupyterlab + - name: NPM pack perspective + run: pnpm pack --pack-destination=../.. + working-directory: ./packages/perspective + + - name: NPM pack perspective-viewer + run: pnpm pack --pack-destination=../.. + working-directory: ./rust/perspective-viewer + + - name: NPM pack perspective-viewer-datagrid + run: pnpm pack --pack-destination=../.. + working-directory: ./packages/perspective-viewer-datagrid + + - name: NPM pack perspective-viewer-d3fc + run: pnpm pack --pack-destination=../.. + working-directory: ./packages/perspective-viewer-d3fc + + - name: NPM pack perspective-viewer-openlayers + run: pnpm pack --pack-destination=../.. + working-directory: ./packages/perspective-viewer-openlayers + + - name: NPM pack perspective-workspace + run: pnpm pack --pack-destination=../.. + working-directory: ./packages/perspective-workspace + + - name: NPM pack perspective-cli + run: pnpm pack --pack-destination=../.. + working-directory: ./packages/perspective-cli + + - name: NPM pack perspective-webpack-plugin + run: pnpm pack --pack-destination=../.. + working-directory: ./packages/perspective-webpack-plugin + + - name: NPM pack perspective-esbuild-plugin + run: pnpm pack --pack-destination=../.. + working-directory: ./packages/perspective-esbuild-plugin + + - name: NPM pack perspective-jupyterlab + run: pnpm pack --pack-destination=../.. + working-directory: ./packages/perspective-jupyterlab - name: Debug run: ls -lah - name: Release wheels - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: draft: true generate_release_notes: true diff --git a/.husky/pre-push b/.husky/pre-push index 84489edd6a..bf440db5fa 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -yarn prepush +pnpm run prepush diff --git a/cpp/perspective/build.js b/cpp/perspective/build.js index 320ebdd488..b6d27df83b 100644 --- a/cpp/perspective/build.js +++ b/cpp/perspective/build.js @@ -21,7 +21,7 @@ const cwd = path.join(process.cwd(), "dist", env); delete process.env.NODE; function bootstrap(file) { - execSync(`cargo run -p perspective-bootstrap -- ${file}`, { + execSync(`cargo run --color always -p perspective-bootstrap -- ${file}`, { cwd: path.join(process.cwd(), "..", "..", "rust", "perspective-viewer"), stdio, }); diff --git a/docs/docs/development.md b/docs/docs/development.md index c88f4bcadb..2c84ad9775 100644 --- a/docs/docs/development.md +++ b/docs/docs/development.md @@ -147,13 +147,21 @@ yarn jlab_link # run this whenever you need to update a local perspective packag Install system dependencies through Homebrew: ```bash -brew install cmake +brew install cmake llvm@17 +brew link llvm@17 # optional, see below ``` On M1 (Apple Silicon) systems, make sure your brew-installed dependencies are in `/opt/homebrew` (the default location), and that `/opt/homebrew/bin` is on the `PATH`. +If you do not want to link the llvm@17 keg, then while developing ensure it is +on your PATH too, like this: + +``` +PATH=$(brew --prefix llvm@17)/bin:$PATH +``` + **Note**: Perspective vendors its C++ extensions, so you may run into trouble building if you have `brew`-installed versions of libraries, such as `flatbuffers`. diff --git a/docs/package.json b/docs/package.json index e474ad8f18..afaf1f64bd 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,13 +16,13 @@ "dependencies": { "@docusaurus/core": "2.2.0", "@docusaurus/preset-classic": "2.2.0", - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-webpack-plugin": "workspace:^", "@mdx-js/react": "^1.6.22", - "blocks": "^2.10.0", + "blocks": "workspace:^", "clsx": "^1.1.1", "prism-react-renderer": "^1.3.3", "react": "^17.0.2", diff --git a/examples/blocks/index.mjs b/examples/blocks/index.mjs index 6c1d513a92..42828be440 100644 --- a/examples/blocks/index.mjs +++ b/examples/blocks/index.mjs @@ -12,9 +12,9 @@ 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"; +import { execSync } from "child_process"; const version = JSON.parse(fs.readFileSync("./package.json")).version; const __dirname = url.fileURLToPath(new URL(".", import.meta.url)).slice(0, -1); @@ -37,7 +37,7 @@ const replacements = { export async function dist_examples( outpath = `${__dirname}/../../docs/static/blocks` ) { - sh`mkdir -p ${outpath}`.runSync(); + execSync(`mkdir -p ${outpath}`, {stdio:"inherit"}); const readme = generate_readme(); let existing = fs.readFileSync(`${__dirname}/../../README.md`).toString(); existing = existing.replace( @@ -51,7 +51,7 @@ export async function dist_examples( if (fs.existsSync(`${__dirname}/src/${name}`)) { // Copy for (const filename of fs.readdirSync(`${__dirname}/src/${name}`)) { - sh`mkdir -p ${outpath}/${name}`.runSync(); + execSync(`mkdir -p ${outpath}/${name}`, {stdio:"inherit"}); if ( filename.endsWith(".mjs") || filename.endsWith(".js") || @@ -71,7 +71,7 @@ export async function dist_examples( filecontents ); } else if (filename !== ".git") { - sh`cp ${__dirname}/src/${name}/${filename} ${outpath}/${name}/${filename}`.runSync(); + execSync(`cp ${__dirname}/src/${name}/${filename} ${outpath}/${name}/${filename}`, {stdio:"inherit"}); } } @@ -79,7 +79,7 @@ export async function dist_examples( if (fs.existsSync(path.join(outpath, name, "build.mjs"))) { console.log("Building " + name); const script = `${outpath}/${name}/build.mjs`; - sh`node ${script}`.runSync(); + execSync(`node ${script}`, {stdio:"inherit"}); } } } diff --git a/examples/blocks/package.json b/examples/blocks/package.json index 663ac74583..b244140d94 100644 --- a/examples/blocks/package.json +++ b/examples/blocks/package.json @@ -10,12 +10,12 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-viewer-openlayers": "^2.10.0", - "@finos/perspective-workspace": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-viewer-openlayers": "workspace:^", + "@finos/perspective-workspace": "workspace:^", "superstore-arrow": "3.0.0" }, "devDependencies": { diff --git a/examples/blocks/src/olympics/build.mjs b/examples/blocks/src/olympics/build.mjs index d6f1adc79c..f9452200d8 100644 --- a/examples/blocks/src/olympics/build.mjs +++ b/examples/blocks/src/olympics/build.mjs @@ -10,9 +10,7 @@ // ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃ // ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ -import sh from "@finos/perspective-scripts/sh.mjs"; -// import * as url from "url"; - +import { execSync } from "child_process"; import perspective from "@finos/perspective"; import { Uint8ArrayReader, @@ -34,9 +32,10 @@ async function main() { return; } - sh`kaggle datasets download -d heesoo37/120-years-of-olympic-history-athletes-and-results` - .cwd(__dirname) - .runSync(); + execSync( + `cd ${__dirname} && kaggle datasets download -d heesoo37/120-years-of-olympic-history-athletes-and-results`, + { stdio: "inherit" } + ); const zip = fs.readFileSync( `${__dirname}/120-years-of-olympic-history-athletes-and-results.zip` diff --git a/examples/esbuild-example/package.json b/examples/esbuild-example/package.json index cbc5bf3f43..de12f6aa5e 100644 --- a/examples/esbuild-example/package.json +++ b/examples/esbuild-example/package.json @@ -5,20 +5,20 @@ "description": "An esbuild example app built using `@finos/perspective-viewer`.", "scripts": { "build": "node build.js", - "start": "yarn build && http-server dist" + "start": "pnpm run build && http-server dist" }, "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-viewer-openlayers": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-viewer-openlayers": "workspace:^", "superstore-arrow": "^3.0.0" }, "devDependencies": { - "@finos/perspective-esbuild-plugin": "^2.10.0", + "@finos/perspective-esbuild-plugin": "workspace:^", "esbuild": "^0.14.54", "http-server": "^14.1.1" } diff --git a/examples/esbuild-remote/package.json b/examples/esbuild-remote/package.json index 9a3338e535..4a18e4637b 100644 --- a/examples/esbuild-remote/package.json +++ b/examples/esbuild-remote/package.json @@ -9,15 +9,15 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "express": "^4.17.1", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "express": "4.18.2", "express-ws": "^5.0.2" }, "devDependencies": { - "@finos/perspective-esbuild-plugin": "^2.10.0", + "@finos/perspective-esbuild-plugin": "workspace:^", "esbuild": "^0.14.54" } } diff --git a/examples/git-history/package.json b/examples/git-history/package.json index 46313ebaa9..b93b7cc751 100644 --- a/examples/git-history/package.json +++ b/examples/git-history/package.json @@ -9,9 +9,9 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0" + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^" } } diff --git a/examples/promo/package.json b/examples/promo/package.json index 66afb1577a..b5694585ca 100644 --- a/examples/promo/package.json +++ b/examples/promo/package.json @@ -13,14 +13,14 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-workspace": "^2.10.0" + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-workspace": "workspace:^" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective-webpack-plugin": "workspace:^", "http-server": "^14.1.1", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" diff --git a/examples/python-aiohttp/package.json b/examples/python-aiohttp/package.json index 2170d4a63f..d75adb2cb2 100644 --- a/examples/python-aiohttp/package.json +++ b/examples/python-aiohttp/package.json @@ -9,15 +9,15 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-workspace": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-workspace": "workspace:^", "superstore-arrow": "^3.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective-webpack-plugin": "workspace:^", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" } diff --git a/examples/python-starlette/package.json b/examples/python-starlette/package.json index 7ac8f413ed..b81572f117 100644 --- a/examples/python-starlette/package.json +++ b/examples/python-starlette/package.json @@ -9,15 +9,15 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-workspace": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-workspace": "workspace:^", "superstore-arrow": "^3.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective-webpack-plugin": "workspace:^", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" } diff --git a/examples/python-tornado-streaming/package.json b/examples/python-tornado-streaming/package.json index 6fe8388dd3..7c7036b7be 100644 --- a/examples/python-tornado-streaming/package.json +++ b/examples/python-tornado-streaming/package.json @@ -9,15 +9,15 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-workspace": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-workspace": "workspace:^", "superstore-arrow": "^3.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective-webpack-plugin": "workspace:^", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" } diff --git a/examples/python-tornado/package.json b/examples/python-tornado/package.json index 6b6fa0b604..76611846ed 100644 --- a/examples/python-tornado/package.json +++ b/examples/python-tornado/package.json @@ -9,15 +9,15 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-workspace": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-workspace": "workspace:^", "superstore-arrow": "^3.0.0" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective-webpack-plugin": "workspace:^", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" } diff --git a/examples/react-example/package.json b/examples/react-example/package.json index 9714a28aee..3b2d997f6f 100644 --- a/examples/react-example/package.json +++ b/examples/react-example/package.json @@ -10,17 +10,17 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "react": "^16.14.0", - "react-dom": "^16.9.17" + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "react": "^17.0.2", + "react-dom": "^17.0.2" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", - "@types/react": "^16.14.0", - "@types/react-dom": "^16.9.17", + "@finos/perspective-webpack-plugin": "workspace:^", + "@types/react": "^17.0.2", + "@types/react-dom": "^17.0.2", "source-map-loader": "^0.2.4", "ts-loader": "^6.2.1" } diff --git a/examples/webpack-cross-origin/package.json b/examples/webpack-cross-origin/package.json index a4e23be542..b4f61d5167 100644 --- a/examples/webpack-cross-origin/package.json +++ b/examples/webpack-cross-origin/package.json @@ -12,13 +12,13 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0" + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective-webpack-plugin": "workspace:^", "css-loader": "^0.28.7", "html-webpack-plugin": "^5.1.0", "http-server": "^14.1.1", diff --git a/examples/webpack-example/package.json b/examples/webpack-example/package.json index 8d86e86eef..ac4ca4cd3f 100644 --- a/examples/webpack-example/package.json +++ b/examples/webpack-example/package.json @@ -4,19 +4,20 @@ "version": "2.10.0", "description": "An example app built using `@finos/perspective-viewer`.", "scripts": { - "build": "webpack", + "webpack_build": "webpack", "start": "webpack serve" }, "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0" + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective-webpack-plugin": "workspace:^", + "arraybuffer-loader": "^1.0.8", "css-loader": "^0.28.7", "html-webpack-plugin": "^5.1.0", "style-loader": "^0.18.2", diff --git a/examples/workspace-editing-python/package.json b/examples/workspace-editing-python/package.json index 37f41790df..60ab30eb7b 100644 --- a/examples/workspace-editing-python/package.json +++ b/examples/workspace-editing-python/package.json @@ -4,7 +4,7 @@ "version": "2.10.0", "description": "An example app demonstrating client/server editing, built using `@finos/perspective-workspace` and `perspective-python`.", "scripts": { - "start": "yarn webpack && yarn start:server", + "start": "pnpm run webpack && pnpm run start:server", "start:client": "webpack-dev-server --open", "start:server": "PYTHONPATH=../../python/perspective python3 src/server.py", "webpack": "webpack --color" @@ -12,14 +12,14 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-workspace": "^2.10.0" + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-workspace": "workspace:^" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective-webpack-plugin": "workspace:^", "http-server": "^14.1.1", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" diff --git a/examples/workspace/package.json b/examples/workspace/package.json index 5b8b218d7a..cbcf2ac811 100644 --- a/examples/workspace/package.json +++ b/examples/workspace/package.json @@ -10,14 +10,14 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-workspace": "^2.10.0" + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-workspace": "workspace:^" }, "devDependencies": { - "@finos/perspective-webpack-plugin": "^2.10.0", + "@finos/perspective-webpack-plugin": "workspace:^", "http-server": "^14.1.1", "npm-run-all": "^4.1.3", "rimraf": "^2.5.2" diff --git a/package.json b/package.json index c485d1a4ed..5a96f4d069 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "emscripten": "3.1.48", "llvm": "17.0.6", "engines": { - "node": ">=14.18.2" + "node": ">=14.18.2 <22" }, "workspaces": [ "tools/perspective-test", @@ -36,8 +36,16 @@ "python/perspective" ], "devDependencies": { + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-openlayers": "workspace:^", + "@finos/perspective-workspace": "workspace:^", + "@finos/perspective-jupyterlab": "workspace:^", + "@finos/perspective-test": "workspace:^", "@fontsource/roboto-mono": "4.5.10", - "@playwright/test": "^1.30.0", + "@playwright/test": "^1.37.1", "@types/ws": "^7.2.2", "@zip.js/zip.js": "^2.7.27", "auto-changelog": "^2.4.0", @@ -68,6 +76,7 @@ "sinon": "^7.3.1", "stoppable": "^1.1.0", "style-loader": "^3.3.1", + "superstore-arrow": "3.0.0", "tar": "^6.1.13", "term-img": "^4.1.0", "timezone-mock": "^1.3.6", @@ -98,7 +107,7 @@ "setup": "node tools/perspective-scripts/setup.mjs", "docs": "node tools/perspective-scripts/docs.mjs", "test": "node tools/perspective-scripts/test.mjs", - "test:jupyter": "yarn workspace @finos/perspective-jupyterlab test:jupyter", + "test:jupyter": "pnpm run --recursive --filter @finos/perspective-jupyterlab test:jupyter", "test_js": "node tools/perspective-scripts/test_js.mjs", "test_python": "node tools/perspective-scripts/test_python.mjs", "clean": "node tools/perspective-scripts/clean.mjs", diff --git a/packages/perspective-cli/package.json b/packages/perspective-cli/package.json index 72e0e37855..0b46830416 100644 --- a/packages/perspective-cli/package.json +++ b/packages/perspective-cli/package.json @@ -24,12 +24,12 @@ "perspective": "perspective" }, "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-viewer-openlayers": "^2.10.0", - "@finos/perspective-workspace": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-viewer-openlayers": "workspace:^", + "@finos/perspective-workspace": "workspace:^", "commander": "^2.19.0", "puppeteer": "^13.1.3" } diff --git a/packages/perspective-jupyterlab/package.json b/packages/perspective-jupyterlab/package.json index c051a498b8..1a899bf051 100644 --- a/packages/perspective-jupyterlab/package.json +++ b/packages/perspective-jupyterlab/package.json @@ -34,19 +34,19 @@ "version": "yarn build" }, "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", - "@finos/perspective-viewer-d3fc": "^2.10.0", - "@finos/perspective-viewer-datagrid": "^2.10.0", - "@finos/perspective-viewer-openlayers": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", + "@finos/perspective-viewer-d3fc": "workspace:^", + "@finos/perspective-viewer-datagrid": "workspace:^", + "@finos/perspective-viewer-openlayers": "workspace:^", "@jupyter-widgets/base": "^2 || ^3 || ^4 || ^5 || ^6", "@jupyterlab/application": "^3.6.1", "@lumino/application": "^1.27.0", "@lumino/widgets": "^1.37.0" }, "devDependencies": { - "@finos/perspective-esbuild-plugin": "^2.10.0", - "@finos/perspective-test": "^2.10.0", + "@finos/perspective-esbuild-plugin": "workspace:^", + "@finos/perspective-test": "workspace:^", "@jupyterlab/builder": "^3.4.0", "@prospective.co/procss": "^0.1.15", "cpy": "^9.0.1" diff --git a/packages/perspective-jupyterlab/src/js/notebook/css.js b/packages/perspective-jupyterlab/src/js/notebook/css.js new file mode 100644 index 0000000000..047af3216c --- /dev/null +++ b/packages/perspective-jupyterlab/src/js/notebook/css.js @@ -0,0 +1,20 @@ +// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ +// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃ +// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃ +// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃ +// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃ +// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ +// ┃ Copyright (c) 2017, the Perspective Authors. ┃ +// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃ +// ┃ This file is part of the Perspective library, distributed under the terms ┃ +// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃ +// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ + +import THEMES from "../../../dist/css/perspective-jupyterlab.css"; + +// Export the required load_ipython_extension +exports.load_css = () => { + const style = document.createElement("style"); + style.textContent = THEMES; + document.head.appendChild(style); +}; diff --git a/packages/perspective-jupyterlab/src/js/notebook/extension.js b/packages/perspective-jupyterlab/src/js/notebook/extension.js index e8647d347a..9626da743d 100644 --- a/packages/perspective-jupyterlab/src/js/notebook/extension.js +++ b/packages/perspective-jupyterlab/src/js/notebook/extension.js @@ -11,17 +11,11 @@ // ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ /* eslint-disable no-underscore-dangle */ +import { load_css } from "./css"; // This file contains the javascript that is run when the notebook is loaded. // It contains some requirejs configuration and the `load_ipython_extension` // which is required for any notebook extension. -// -// Some static assets may be required by the custom widget javascript. The base -// url for the notebook is not known at build time and is therefore computed -// dynamically. - -import THEMES from "../../../dist/css/perspective-jupyterlab.css"; - if (window.require) { window.require.config({ map: { @@ -33,9 +27,6 @@ if (window.require) { }); } -// Export the required load_ipython_extension exports.load_ipython_extension = () => { - const style = document.createElement("style"); - style.textContent = THEMES; - document.head.appendChild(style); + load_css(); }; diff --git a/packages/perspective-jupyterlab/src/js/notebook/index.js b/packages/perspective-jupyterlab/src/js/notebook/index.js index 4dde6a378d..c39aea3bb7 100644 --- a/packages/perspective-jupyterlab/src/js/notebook/index.js +++ b/packages/perspective-jupyterlab/src/js/notebook/index.js @@ -14,8 +14,14 @@ import "@finos/perspective-viewer-datagrid"; import "@finos/perspective-viewer-d3fc"; import "@finos/perspective-viewer-openlayers"; +import { load_css } from "./css"; import { PerspectiveView } from "../view"; import { PerspectiveModel } from "../model"; exports.PerspectiveModel = PerspectiveModel; exports.PerspectiveView = PerspectiveView; + +// Run if in vs-code +if (window.vscIPyWidgets) { + load_css(); +} diff --git a/packages/perspective-jupyterlab/src/js/view.js b/packages/perspective-jupyterlab/src/js/view.js index 5999fcd141..0afe525253 100644 --- a/packages/perspective-jupyterlab/src/js/view.js +++ b/packages/perspective-jupyterlab/src/js/view.js @@ -404,10 +404,16 @@ export class PerspectiveView extends DOMWidgetView { table.update(updated.delta); } - this._client_view.on_update( - (updated) => this._client_view_update_callback(updated), - { mode: "row" } - ); + if (this._client_view) { + // NOTE: if `plugin_config_changed` called before + // `_handle_load_message`, this will be undefined + // Ignore, as `_handle_load_message` is sure to + // follow. + this._client_view.on_update( + (updated) => this._client_view_update_callback(updated), + { mode: "row" } + ); + } this._kernel_view.on_update( (updated) => this._kernel_view_update_callback(updated), diff --git a/packages/perspective-jupyterlab/src/less/index.less b/packages/perspective-jupyterlab/src/less/index.less index 3213497ec6..7f7d634588 100644 --- a/packages/perspective-jupyterlab/src/less/index.less +++ b/packages/perspective-jupyterlab/src/less/index.less @@ -35,6 +35,14 @@ div.PSPContainer { height: 520px; } +// Widget height for Voila +// Widget height for VS Code +body[data-voila="voila"] .jp-OutputArea-output div.PSPContainer, +body[data-vscode-theme-id] .cell-output-ipywidget-background div.PSPContainer { + min-height: 520px; + height: 520px; +} + div.PSPContainer perspective-viewer[theme="Pro Light"] { --plugin--border: 1px solid #e0e0e0; } diff --git a/packages/perspective-viewer-d3fc/package.json b/packages/perspective-viewer-d3fc/package.json index 86896fe689..413cd6a49a 100644 --- a/packages/perspective-viewer-d3fc/package.json +++ b/packages/perspective-viewer-d3fc/package.json @@ -46,8 +46,8 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", "chroma-js": "^1.3.4", "d3fc": "^15.2.4", "d3-selection": "^3.0.0", @@ -58,8 +58,8 @@ }, "devDependencies": { "@types/d3": "^7.0.0", - "@finos/perspective-esbuild-plugin": "^2.10.0", - "@finos/perspective-test": "^2.10.0", + "@finos/perspective-esbuild-plugin": "workspace:^", + "@finos/perspective-test": "workspace:^", "@prospective.co/procss": "^0.1.15" } } diff --git a/packages/perspective-viewer-d3fc/src/ts/axis/axisType.ts b/packages/perspective-viewer-d3fc/src/ts/axis/axisType.ts index 957bca9dad..6c24579622 100644 --- a/packages/perspective-viewer-d3fc/src/ts/axis/axisType.ts +++ b/packages/perspective-viewer-d3fc/src/ts/axis/axisType.ts @@ -19,7 +19,7 @@ export const AXIS_TYPES = { linear: "linear", } as const; -export type AxisTypeValues = typeof AXIS_TYPES[keyof typeof AXIS_TYPES]; +export type AxisTypeValues = (typeof AXIS_TYPES)[keyof typeof AXIS_TYPES]; export interface AxisType { (): AxisTypeValues; diff --git a/packages/perspective-viewer-datagrid/package.json b/packages/perspective-viewer-datagrid/package.json index 02d5e4ba2b..3f8a0e47f0 100644 --- a/packages/perspective-viewer-datagrid/package.json +++ b/packages/perspective-viewer-datagrid/package.json @@ -29,14 +29,14 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", "chroma-js": "^1.3.4", "regular-table": "=0.6.4" }, "devDependencies": { - "@prospective.co/procss": "^0.1.13", - "@finos/perspective-esbuild-plugin": "^2.10.0", - "@finos/perspective-test": "^2.10.0" + "@prospective.co/procss": "^0.1.15", + "@finos/perspective-esbuild-plugin": "workspace:^", + "@finos/perspective-test": "workspace:^" } } diff --git a/packages/perspective-viewer-datagrid/src/less/mitered-headers.less b/packages/perspective-viewer-datagrid/src/less/mitered-headers.less index 546b202f07..4eefb86ef8 100644 --- a/packages/perspective-viewer-datagrid/src/less/mitered-headers.less +++ b/packages/perspective-viewer-datagrid/src/less/mitered-headers.less @@ -31,10 +31,12 @@ 0px 10px 0 -9px var(--inactive--border-color, #8b868045); } -.psp-header-border.psp-header-group:not(.psp-is-top):not(.psp-header-group-corner) { - // right and bottom - box-shadow: 1px 0px var(--inactive--border-color, #8b868045), - 0px 10px 0 -9px var(--inactive--border-color, #8b868045); +.psp-header-border.psp-header-group { + &:not(.psp-is-top):not(.psp-header-group-corner) { + // right and bottom + box-shadow: 1px 0px var(--inactive--border-color, #8b868045), + 0px 10px 0 -9px var(--inactive--border-color, #8b868045); + } } @mixin disabled-menu-funky-box-shadow { diff --git a/packages/perspective-viewer-openlayers/package.json b/packages/perspective-viewer-openlayers/package.json index d7dc456aef..c48d7e6dd2 100644 --- a/packages/perspective-viewer-openlayers/package.json +++ b/packages/perspective-viewer-openlayers/package.json @@ -24,8 +24,8 @@ "clean:screenshots": "rimraf \"test/screenshots/**/*.@(failed|diff).png\"" }, "dependencies": { - "@finos/perspective": "^2.10.0", - "@finos/perspective-viewer": "^2.10.0", + "@finos/perspective": "workspace:^", + "@finos/perspective-viewer": "workspace:^", "d3": "^7.1.1", "d3-color": "^3.0.1", "gradient-parser": "1.0.2", @@ -33,6 +33,7 @@ "ol": "^5.3.2" }, "devDependencies": { - "@finos/perspective-esbuild-plugin": "^2.10.0" + "@finos/perspective-esbuild-plugin": "workspace:^", + "@prospective.co/procss": "^0.1.15" } } diff --git a/packages/perspective-viewer-openlayers/test/html/superstore.html b/packages/perspective-viewer-openlayers/test/html/superstore.html index 5d2a4f687f..574e6f9580 100644 --- a/packages/perspective-viewer-openlayers/test/html/superstore.html +++ b/packages/perspective-viewer-openlayers/test/html/superstore.html @@ -10,9 +10,9 @@
- - - + + + - - - -