Skip to content

Commit

Permalink
Update to latest plugin template
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Oct 7, 2023
1 parent ed7f5bd commit 9b4597a
Show file tree
Hide file tree
Showing 12 changed files with 6,213 additions and 6,102 deletions.
3 changes: 0 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"presets": [
// need this to be able to use spread operator on Set and Map
// see https://github.com/formium/tsdx/issues/376#issuecomment-566750042
["@babel/preset-env", { "loose": false }],
// can remove this if only using TypeScript
"@babel/preset-react"
]
Expand Down
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ coverage
# Dependency directories
node_modules/

# TSDX build / generate output
# build / generated output
dist
28 changes: 12 additions & 16 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
module.exports = {
"extends": [
"react-app",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"settings": {
"react": {
"version": "detect"
}
extends: ['react-app', 'plugin:prettier/recommended'],
settings: {
react: {
version: 'detect',
},
},
"rules": {
"@typescript-eslint/no-unused-vars": [
"warn",
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
{
"args": "after-used",
"ignoreRestSiblings": true
}
args: 'after-used',
ignoreRestSiblings: true,
},
],
}
},
}
23 changes: 23 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Integration

on: push

jobs:
integration:
name: Run integration tests
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install deps (with cache)
uses: bahmutov/npm-install@v1
- name: Get latest JBrowse
run: mkdir .jbrowse && yarn run jbrowse create --force .jbrowse
- name: Run unit tests
run: yarn test --passWithNoTests
- name: Test plugin
run: yarn run test:e2e
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@ dist
# Cypress specific files
cypress/videos
cypress/screenshots

# Ignore code editor
.vscode
107 changes: 73 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,41 @@
"jbrowse2"
],
"main": "dist/index.js",
"module": "dist/jbrowse-plugin-msaview.esm.js",
"module": "dist/index.esm.js",
"typings": "dist/index.d.ts",
"files": [
"dist",
"src"
],
"config": {
"port": 9000,
"browse": {
"port": 8999
},
"jbrowse": {
"plugin": {
"name": "MsaView"
}
}
},
"scripts": {
"setup": "node scripts/setup.js && npm run browse-install",
"setup": "npm-run-all setup:*",
"setup:file": "ts-node scripts/setup.ts",
"setup:jbrowse": "npm-run-all setup:jbrowse:*",
"setup:jbrowse:clean": "rimraf .jbrowse",
"setup:jbrowse:create": "jbrowse create .jbrowse",
"clean": "rimraf dist",
"start": "tsdx watch --verbose --noClean --format umd --name JBrowsePluginMsaView --onFirstSuccess \"serve --cors --listen 9000 .\"",
"prebuild": "npm run clean",
"build": "tsdx build --format cjs,esm,umd --name JBrowsePluginMsaView && cp distconfig.json dist/config.json",
"browse-install": "cd .jbrowse && rm -rf * && jbrowse create .",
"browse": "cd .jbrowse && cp ../jbrowse_config.json . && mv jbrowse_config.json config.json && npx serve .",
"test": "tsdx test",
"lint": "tsdx lint",
"prepublishOnly": "npm test",
"prepare": "npm run build",
"postinstall": "jbrowse-plugin-postinstall",
"start": "npm-run-all --sequential clean --parallel start:*",
"start:watch": "JB_NPM=false rollup --config --watch --bundleConfigAsCjs",
"start:server": "serve --cors --listen $npm_package_config_port .",
"prebuild": "npm-run-all clean",
"build": "rollup --config --bundleConfigAsCjs",
"browse": "npm-run-all jbrowse:*",
"jbrowse:configure": "cp jbrowse_config.json .jbrowse/config.json",
"jbrowse:serve": "cross-var serve --listen $npm_package_config_browse_port .jbrowse",
"lint": "eslint --ext .js,.ts,.jsx,.tsx src/",
"prepublishOnly": "npm-run-all test",
"prepack": "npm-run-all build",
"postversion": "git push --follow-tags"
},
"jbrowse-plugin": {
Expand All @@ -36,29 +52,52 @@
"trailingComma": "all"
},
"dependencies": {
"@material-ui/icons": "^4.11.2",
"react-msaview": "^1.2.11"
},
"peerDependencies": {
"@jbrowse/core": "^1.0.4"
"react-msaview": "^2.0.0",
"regenerator-runtime": "^0.13.9",
"tslib": "^2.3.1"
},
"devDependencies": {
"@babel/preset-react": "^7.10.4",
"@jbrowse/core": "^1.0.4",
"@jbrowse/development-tools": "^1.0.3",
"@material-ui/core": "^4.9.13",
"@material-ui/lab": "^4.0.0-alpha.45",
"@babel/core": "^7.23.0",
"@babel/preset-react": "^7.22.15",
"@emotion/react": "^11.10.4",
"@jbrowse/cli": "^2.7.0",
"@jbrowse/core": "^2.7.0",
"@jbrowse/development-tools": "^2.1.1",
"@mui/material": "^5.14.12",
"@mui/system": "^5.14.12",
"@mui/x-data-grid": "^6.16.1",
"@schemastore/package": "^0.0.9",
"@types/node": "^16.11.13",
"@types/react": "^17.0.0",
"cypress": "^6.2.1",
"mobx": "^5.0.0",
"mobx-react": "^6.0.0",
"mobx-state-tree": "3.14.1",
"react": "^16.8.0",
"rimraf": "^3.0.2",
"rxjs": "^6.0.0",
"serve": "^11.3.2",
"start-server-and-test": "^1.11.7",
"tslib": "^2.0.3",
"typescript": "^4.1.3"
}
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"babel-eslint": "^10.0.0",
"chalk": "^5.3.0",
"cross-var": "^1.1.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.0.8",
"mobx": "^6.10.2",
"mobx-react": "^9.0.1",
"mobx-state-tree": "5.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.5",
"rollup": "^4.0.2",
"rxjs": "^7.8.1",
"serve": "^14.2.1",
"start-server-and-test": "^2.0.1",
"ts-node": "^10.3.0",
"tss-react": "^4.9.2",
"typescript": "^5.2.2"
},
"private": true
}
27 changes: 27 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import globals from '@jbrowse/core/ReExports/list'
import { createRollupConfig } from '@jbrowse/development-tools'

function stringToBoolean(string) {
if (string === undefined) {
return undefined
}
if (string === 'true') {
return true
}
if (string === 'false') {
return false
}
throw new Error('unknown boolean string')
}

const includeUMD = stringToBoolean(process.env.JB_UMD)
const includeCJS = stringToBoolean(process.env.JB_CJS)
const includeESMBundle = stringToBoolean(process.env.JB_ESM_BUNDLE)
const includeNPM = stringToBoolean(process.env.JB_NPM)

export default createRollupConfig(globals.default, {
includeUMD,
includeCJS,
includeESMBundle,
includeNPM,
})
Loading

0 comments on commit 9b4597a

Please sign in to comment.