Skip to content

Commit 83669f9

Browse files
author
David Reed
committed
prepare
1 parent 6cec2d4 commit 83669f9

File tree

5 files changed

+19
-27
lines changed

5 files changed

+19
-27
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.tgz

README.md

+4-27
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,7 @@
1-
# ultraviolet-scripts
2-
Core Ultraviolet scripts
1+
# Ultraviolet-Static
32

4-
# Configuration
5-
Configure Ultraviolet for both client-hooking & service worker in `uv.config.js`
6-
```javascript
7-
self.__uv$config = {
8-
bare: '/bare/',
9-
prefix: '/service/',
10-
encodeUrl: Ultraviolet.codec.xor.encode,
11-
decodeUrl: Ultraviolet.codec.xor.decode,
12-
handler: '/uv.handler.js',
13-
bundle: '/uv.bundle.js',
14-
config: '/uv.config.js',
15-
};
16-
```
3+
Static files/assets used to spin up an Ultraviolet website.
174

5+
## Packaging
186

19-
# Example Usage
20-
```javascript
21-
importScripts('/PATHTOSCRIPTS/uv.sw.js');
22-
23-
const sw = new UVServiceWorker();
24-
25-
self.addEventListener('fetch', event =>
26-
event.respondWith(
27-
sw.fetch(event)
28-
)
29-
);
30-
```
7+
Run `npm pack` to produce a tgz containing the assets as an NPM package.

lib/index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const publicPath: string;

lib/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { fileURLToPath } from 'url';
2+
3+
export const publicPath = fileURLToPath(new URL('../public/', import.meta.url));

package.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "ultraviolet-static",
3+
"main": "lib/index.js",
4+
"version": "1.0.0",
5+
"type": "module",
6+
"files": [
7+
"public",
8+
"lib"
9+
]
10+
}

0 commit comments

Comments
 (0)