Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
dxdc committed Nov 1, 2023
2 parents 2c9a720 + 39cb157 commit e95e597
Show file tree
Hide file tree
Showing 140 changed files with 18,817 additions and 20,721 deletions.
13 changes: 13 additions & 0 deletions .devcontainer/devcontainers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"postCreateCommand": "nvm install 16.16.0 && npm run build",
"customizations": {
"vscode": {
"extensions": [
"ritwickdey.LiveServer",
"github.vscode-github-actions",
"GitHub.vscode-pull-request-github",
"waderyan.gitblame"
]
}
}
}
20 changes: 14 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Build
run: |
npm i npm@latest
npm install
node-version: 20

# As our package has a postInstall script, which in turn calls `npm run build`, hence we do not need a explicit job for that
- name: Install Dependencies & Build 3dmol.js
run: npm install

- name: Test
run: npm test

- name: Coverage
env:
NODE_OPTIONS: "--max_old_space_size=8192"
NODE_OPTIONS: "--max_old_space_size=8192"
# coverage has trouble fetching data for some reason in the CI,
# I don't actually care about the test results (that's tested above)
# so ignore any failure here
run: npm run cover
continue-on-error: true

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3

58 changes: 58 additions & 0 deletions .github/workflows/CodeQL-Analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "CodeQL"

on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
cache: npm
node-version: 20

- name: Cache NPM Dependencies
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}

# For CodeQL, we don't need to generate tests or doc, hence running only install
- name: Install Dependencies
run: npm install --ignore-scripts

# Build for dev and prod
- name: Build 3dmol.js
run: |
npm run build:dev
npm run build:prod
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
19 changes: 19 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Dependency Review
on: [ pull_request ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Dependency Review
uses: actions/dependency-review-action@v3
56 changes: 56 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
cache: npm
node-version: 20

- uses: actions/cache@v3
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
cache: npm
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Cache NPM Dependencies
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}

- name: Check Cache & Install Dependencies
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
run: npm ci

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
15 changes: 14 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/tests
/node_modules
/tmp
/coverage
Expand All @@ -8,6 +7,20 @@ script.map
.settings
.ipynb

CODE_OF_CONDUCT.md
CONTRIBUTING.md
doc.md
echo.cgi
examples/
index.html
learning-environment/
paper/
py3Dmol/
tests/
track/
tutorials/
/viewer.*

#Ignoring Virtual Environments for the Active Learning Environment Project
.env
.venv
Expand Down
29 changes: 29 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
cff-version: 1.2.0
title: '3Dmol.js: molecular visualization with WebGL'
message: If you use 3Dmol.js, please cite our Bioinformatics paper
type: software
authors:
- given-names: David
family-names: Koes
email: [email protected]
affiliation: University of Pittsburgh
orcid: 'https://orcid.org/0000-0002-6892-6614'
- given-names: Nicholas
family-names: Rego
affiliation: University of Pittsburgh
orcid: 'https://orcid.org/0000-0002-3164-6803'
identifiers:
- type: doi
value: 10.1093/bioinformatics/btu829
repository-code: 'https://github.com/3dmol/3Dmol.js'
url: 'https://3dmol.org/'
abstract: >-
3Dmol.js is a modern, object-oriented JavaScript library
that uses the latest web technologies to provide
interactive, hardware-accelerated three-dimensional
representations of molecular data without the need to
install browser plugins or Java. 3Dmol.js provides a full
featured API for developers as well as a straightforward
declarative interface that lets users easily share and
embed molecular data in websites.
license: BSD-3-Clause
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Feature Request

1. Please go through the 3Dmol.js [js documentation](http://3dmol.org/doc/index.html) to check whether the feature is already present.
1. Please go through the 3Dmol.js [js documentation](https://3dmol.org/doc/index.html) to check whether the feature is already present.
2. Ensure that the feature request is new and is not already proposed.
3. If the feature request is new, follow the feature request template to submit an issue.
4. Please close your issue when you think it has been adequately resolved.
Expand Down
18 changes: 18 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
coverage:
status:
project:
default:
# basic
target: auto
threshold: 0.05%
base: auto
flags:
- unit
paths:
- "src"
# advanced settings
branches:
- master
if_ci_failed: error #success, failure, error, ignore
informational: false
only_pulls: false
27 changes: 14 additions & 13 deletions doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@
</script>

3Dmol.js is an object-oriented, WebGL based JavaScript library for online molecular visualization - No Java required!
With 3Dmol.js, you can add beautifully rendered molecular visualizations to your web applications. Features include:
With 3Dmol.js, you can add beautifully rendered molecular visualizations to your web applications.

* support for pdb, sdf, mol2, xyz, and cube formats
* parallelized molecular surface computation
* sphere, stick, line, cross, cartoon, and surface styles
* atom property based selection and styling
* labels
* clickable interactivity with molecular data
* geometric shapes including spheres and arrows
Features include:

- Support for pdb, sdf, mol2, xyz, and cube formats
- Parallelized molecular surface computation
- Sphere, stick, line, cross, cartoon, and surface styles
- Atom property based selection and styling
- Labels
- Clickable interactivity with molecular data
- Geometric shapes including spheres and arrows

## Getting Started

Molecular data can be shared and visualized without writing any HTML
using only a declarative URL specification and our hosted viewer (see {@tutorial url}).
Molecular data can be shared and visualized without writing any HTML using only a declarative URL specification and our hosted viewer (see {@tutorial url}).

Viewers can be quickly embedded in any HTML document using just two lines of source code (see {@tutorial embeddable}).

Expand Down Expand Up @@ -64,11 +65,11 @@ An un-minified file is also provided for debugging purposes:

#### Method 2: using a CDN

The files hosted by 3Dmol.org closely track the development version and so will change frequently. If you desire more stability you may copy the files into your own project or, alternatively, we host release snapshots on the <a href="https://cdnjs.com/libraries/3Dmol">cdnjs</a> content delivery network (note that you must specify the release version).
The files hosted by 3Dmol.org closely track the development version and so will change frequently. If you desire more stability you may copy the files into your own project or, alternatively, we host release snapshots on the <a href="https://cdnjs.com/libraries/3Dmol">cdnjs</a> content delivery network (note that you must specify the release version). **Do not use the CDN minified version** (3Dmol-min.min.js). The CDN autominifier does not generate correct code and `3Dmol-min.js` is alread minified.

```{@lang html}
<script src="https://cdnjs.cloudflare.com/ajax/libs/3Dmol/1.8.0/3Dmol-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/3Dmol/1.8.0/3Dmol.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/3Dmol/2.0.1/3Dmol-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/3Dmol/2.0.1/3Dmol.js"></script>
```

Using the CDN will likely provide the best network performance to your users, but features will lag behind the development branch as we only plan to tag new releases a few times a year.
Expand Down
Loading

0 comments on commit e95e597

Please sign in to comment.