# @cocalc/cdn

> Files that CoCalc uses that would be natural in various contexts to get from a CDN

Latest version **1.15.1** (published 2022-11-09) · SEE LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install @cocalc/cdn
pnpm add @cocalc/cdn
yarn add @cocalc/cdn
bun add @cocalc/cdn
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; large bundle.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.15.1 |
| Published | 2022-11-09 |
| First published | 2021-05-17 |
| Weekly downloads | 0 |
| License | SEE LICENSE.md |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 100.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 1288 |
| Author | SageMath, Inc. |
| Maintainers | wstein, hasch |
| Keywords | cdn, cocalc |

## Links

- npm: https://www.npmjs.com/package/@cocalc/cdn
- Repository: https://github.com/sagemathinc/cocalc
- Homepage: https://github.com/sagemathinc/cocalc/tree/master/src/packages/cdn
- Issues: https://github.com/sagemathinc/cocalc/issues
- npm.io page: https://npm.io/package/@cocalc/cdn

## Recent versions

- 1.15.1 (latest) — 2022-11-09
- 1.14.1 (next-sso) — 2022-08-23
- 1.10.0 (pr-5723) — 2022-03-06
- 1.0.8 (basepath) — 2021-07-21
- 1.15.0 — 2022-11-01
- 1.14.0 — 2022-08-10
- 1.13.0 — 2022-07-28
- 1.12.0 — 2022-04-27
- 1.11.0 — 2022-04-27
- 1.9.0 — 2022-03-01
- 1.8.2 — 2021-11-12
- 1.8.1 — 2021-11-02
- 1.7.0 — 2021-10-15
- 1.6.0 — 2021-09-30
- 1.5.1 — 2021-09-29
- … 16 more at https://npm.io/package/@cocalc/cdn/versions

## README

# Webapp Resource files

## Why?

This directory contains additional resources for at least the `/index.html`   and `/app`   page.  Many of these were served directly from CDN's before. However, that introduces a dependency where [CoCalc.com](http://CoCalc.com) can't load unless all these random CDN's also work... and that is unacceptable for two reasons:

1. If any of these CDN's go down, [CoCalc.com](http://CoCalc.com) would get mangled or not load.  That's no good.
2. If you use a private install of cocalc on a computer that doesn't have network access, it doesn't work at all ever.  That's definitely not good.

## How?

Run `npm ci` to install the modules in the node\_modules directory, as usual.  The run `npm run build` to update the `dist/` subdirectory with all relevant data ready to be served via various webservers.  The `setup.py` script (that `npm run build` uses)  makes sure to include a version number in the path, because all files will be served with a long cache time.

**IMPORTANT:** we copy all the files from `node_modules`  to dist, rather than just making symlinks, because (1) the symlinks don't get published to npm anyways, and (2) the `node_modules`  folders would likely get hoisted away when we install elsewhere, thus breaking everything.

## Notes

Other files in `packages/assets` might not be used any more. At some point we can clean them up.

We have to run a postinstall script to create the versioned symlinks, since -- to be cross platform -- npm itself [doesn't support symlinks](https://npm.community/t/how-can-i-publish-symlink/5599).

---
_Source: https://npm.io/package/@cocalc/cdn · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
