-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
248 changed files
with
13,961 additions
and
18,052 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'react', 'react-hooks'], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react/recommended', | ||
'plugin:react-hooks/recommended', | ||
], | ||
settings: { | ||
react: { version: 'detect' }, | ||
}, | ||
env: { browser: true }, | ||
ignorePatterns: ['*.glsl', '*.css'], | ||
rules: { | ||
// My practice is to use "log" for messages I intend to clean up before merging. | ||
// All these others reflect the intension that they should be left in the codebase. | ||
'no-console': [2, { 'allow': ['warn', 'error', 'info', 'groupCollapsed', 'groupEnd'] }], | ||
'no-underscore-dangle': [0], | ||
'@typescript-eslint/no-empty-function': [0], | ||
// Non-alphabetical groupings can make more sense. | ||
'react/sort-comp': [0], | ||
// Makes punctuation after tab awkward. | ||
'react/jsx-one-expression-per-line': [0], | ||
// TODO: Re-enable: https://github.com/hubmapconsortium/vitessce/issues/144 | ||
'react/prop-types': [0], | ||
// Hit eslint error: SyntaxError: Unexpected token, expected { | ||
'react/jsx-curly-newline': [0], | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Avivator GitHub Pages | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
|
||
- uses: pnpm/[email protected] | ||
name: Install pnpm | ||
id: pnpm-install | ||
with: | ||
version: 7 | ||
run_install: true | ||
|
||
- name: Build 🔧 | ||
run: pnpm --filter=avivator build && touch sites/avivator/dist/.nojekyll | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: sites/avivator/dist | ||
CLEAN: true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
check-changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Updated CHANGELOG.md | ||
if: ${{ github.ref != 'refs/heads/main' }} && !contains(github.ref, 'dependabot') | ||
run: | | ||
! diff CHANGELOG.md <(curl -s "https://raw.githubusercontent.com/hms-dbmi/viv/master/CHANGELOG.md") | ||
build-windows: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
|
||
- uses: pnpm/[email protected] | ||
name: Install pnpm | ||
id: pnpm-install | ||
with: | ||
version: 7 | ||
run_install: true | ||
|
||
- name: Build Avivator | ||
run: pnpm --filter=avivator build | ||
|
||
test-linux: | ||
runs-on: ubuntu-latest | ||
env: | ||
DISPLAY: :0 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
id: pnpm-install | ||
with: | ||
version: 7 | ||
run_install: true | ||
|
||
- name: Check formatting | ||
run: pnpm check-format | ||
|
||
- name: Lint | ||
run: pnpm lint | ||
|
||
- name: Setup xvf (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get install -y xvfb | ||
# start xvfb in the background | ||
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 & | ||
- name: Test | ||
run: pnpm test | ||
|
||
- name: Build packages and sites | ||
run: pnpm build | ||
|
||
publish: | ||
needs: [check-changelog, build-windows, test-linux] | ||
runs-on: ubuntu-latest | ||
# this will run when you have tagged a commit, starting with "v*" | ||
if: contains(github.ref, 'tags') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
id: pnpm-install | ||
with: | ||
version: 7 | ||
run_install: true | ||
|
||
- name: Build packages and sites | ||
run: pnpm build | ||
|
||
- name: Publish to NPM | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: pnpm publish --filter='./packages/*' --dry-run | ||
|
||
- name: Upload to S3 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.VIV_S3_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.VIV_S3_ACCESS_KEY_SECRET }} | ||
run: | | ||
aws s3 cp --recursive sites/avivator/dist s3://avivator.gehlenborglab.org --dry-run | ||
aws s3 cp --recursive sites/docs/dist s3://viv.gehlenborglab.org --dry-run | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import * as fs from 'node:fs'; | ||
import * as path from 'node:path'; | ||
|
||
// temporary - @vivjs/* should follow same version of `@hms-dbmi/viv` after we have successfully tested a release. | ||
const VIV_VERSION = '0.12.10-alpha.0'; | ||
|
||
const DECK_VERSION = '8.6.7'; | ||
const LUMAGL_VERSION = '8.5.13'; | ||
const MATHGL_VERSION = '^3.5.7'; | ||
const REACT_VERSION = '^16.8.0 || ^17.0.0'; | ||
|
||
|
||
/** @typedef {import('@pnpm/types').PackageManifest} PackageManifest */ | ||
|
||
/** | ||
* Mutates package metadata in-place to pin specific package versions. | ||
* | ||
* @param {PackageManifest} manifest | ||
*/ | ||
function pinVersions(manifest) { | ||
for (let key of /** @type {const} */ (['dependencies', 'devDependencies', 'peerDependencies'])) { | ||
let deps = manifest[key] ?? {}; | ||
for (let name of Object.keys(deps)) { | ||
if (name.startsWith('@deck.gl/') || name === 'deck.gl') { | ||
deps[name] = DECK_VERSION; | ||
} | ||
if (name.startsWith('@luma.gl/') || name === 'luma.gl') { | ||
deps[name] = LUMAGL_VERSION; | ||
} | ||
if (name.startsWith('@math.gl/')) { | ||
deps[name] = MATHGL_VERSION; | ||
} | ||
if (name === 'react' || name === 'react-dom') { | ||
deps[name] = REACT_VERSION; | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
export default (/** @type {string} */ workspaceDir) => { | ||
let root = path.resolve(workspaceDir, 'package.json'); | ||
/** @type {PackageManifest} */ | ||
let meta = JSON.parse(fs.readFileSync(root, { encoding: 'utf-8' })); | ||
return { | ||
'package.json': ( | ||
/** @type {PackageManifest} */ manifest, | ||
/** @type {string} */ _dir | ||
) => { | ||
const version = manifest.name === '@hms-dbmi/viv' ? VIV_VERSION : meta.version; | ||
// Only pin deps in @vivjs/*. Avivator should manually update. | ||
manifest.name?.includes('@vivjs') && pinVersions(manifest); | ||
return { ...manifest, version }; | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
auto-install-peers=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
### Added | ||
|
||
### Changed | ||
- Migrate to pnpm monorepo | ||
|
||
## 0.12.9 | ||
|
||
|
Oops, something went wrong.