Skip to content

Commit

Permalink
ci: publishing to npm on action
Browse files Browse the repository at this point in the history
  • Loading branch information
skewb1k committed Feb 26, 2025
1 parent 3a8186e commit 7bc19ed
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,21 @@ jobs:
with:
bun-version: latest
- name: Install deps
run: bun install
run: bun install --frozen-lockfile
- name: Run tests
run: bun test
- name: Build
run: bun run build
- name: Generate docs
uses: erikyo/tsdoc-action@v1
with:
source_dir: ./src/*
output_dir: ./docs
front_page: README.md
source_dir: src/index.ts
output_dir: docs
- name: Deploy docs to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: dist
- run: bun publish
env:
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ sky.destroy(); // Clean up the instance
-->

## 📖 **Documentation & Examples**
📚 **Full API Documentation:** [skewb1k.github.io/skymap](https://skewb1k.github.io/skymap) (TODO)
📚 **Full API Documentation:** [skewb1k.github.io/skymap](https://skewb1k.github.io/skymap)

<!--
🛠 **Live Demos:** [CodeSandbox](https://codesandbox.io/) (TODO)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "skymap",
"version": "1.1.0",
"version": "1.2.0",
"description": "Interactive Sky Map library for canvas",
"type": "module",
"repository": {
Expand Down
9 changes: 9 additions & 0 deletions src/SkyMap/SkyMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class SkyMap {
this.container = document.createElement("div");
this.container.style.clipPath = "circle(50%)";
this.container.style.aspectRatio = "1/1";
container.innerHTML = "";
container.append(this.container);

this.geoTz = init();
Expand Down Expand Up @@ -180,6 +181,14 @@ export class SkyMap {
this.resizeObserver.observe(this.container);
}

/**
* Disconnects SkyMap from container.
*/
public disconnect() {
this.resizeObserver.disconnect();
this.lastGeoTzFindCallId = 0;
}

/**
* Clones this SkyMap instance, creating a new instance with the same configuration for another container.
*
Expand Down

0 comments on commit 7bc19ed

Please sign in to comment.