glashjs 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/bin/glash.mjs +3 -1
- package/package.json +9 -3
package/README.md
CHANGED
|
@@ -31,6 +31,11 @@ JPG and MP4 are *already* compressed; you can't losslessly shrink them 10–20×
|
|
|
31
31
|
- **mp4 / mov / webm** → **AV1** + poster frame (needs optional `ffmpeg`).
|
|
32
32
|
- Emits `glash-assets.manifest.json` so the glashdb edge (or any server) serves the best variant per client. Originals are never mutated.
|
|
33
33
|
|
|
34
|
+
> **glashjs installs with zero dependencies.** Brotli/Gzip works out of the box.
|
|
35
|
+
> To enable image/video transcoding, add the optional enhancers yourself:
|
|
36
|
+
> `npm i sharp` (AVIF/WebP) and install `ffmpeg` on your PATH (AV1). They're
|
|
37
|
+
> declared as **optional peers**, so a plain `npm i glashjs` pulls nothing else.
|
|
38
|
+
|
|
34
39
|
### 2. Offline layer — usable with no internet after first visit
|
|
35
40
|
Generates a **Service Worker** (`glash-sw.js`) + PWA manifest that precache the app shell and hashed assets into small cached files. Strategies:
|
|
36
41
|
- **assets** → cache-first (immutable, hash-busted on deploy)
|
package/bin/glash.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// glashjs CLI
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
3
4
|
import { build } from '../src/build.mjs';
|
|
4
5
|
import { optimizeAssets } from '../src/assets/optimize.mjs';
|
|
5
6
|
|
|
7
|
+
const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
6
8
|
const [, , cmd, ...rest] = process.argv;
|
|
7
9
|
|
|
8
10
|
function arg(name, fallback) {
|
|
@@ -27,7 +29,7 @@ async function main() {
|
|
|
27
29
|
case 'version':
|
|
28
30
|
case '--version':
|
|
29
31
|
case '-v':
|
|
30
|
-
console.log('glashjs
|
|
32
|
+
console.log('glashjs ' + VERSION);
|
|
31
33
|
break;
|
|
32
34
|
default:
|
|
33
35
|
console.log(`glashjs — fast, offline-capable, hard-to-hack sites
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glashjs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "glashjs — a build pipeline + runtime conventions for fast, offline-capable, hard-to-hack sites. Built on proven primitives, with a best-in-class asset optimizer, PWA offline layer, and secure-by-default headers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -19,8 +19,14 @@
|
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=20"
|
|
21
21
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
22
|
+
"dependencies": {},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"sharp": "^0.34.5"
|
|
25
|
+
},
|
|
26
|
+
"peerDependenciesMeta": {
|
|
27
|
+
"sharp": {
|
|
28
|
+
"optional": true
|
|
29
|
+
}
|
|
24
30
|
},
|
|
25
31
|
"keywords": [
|
|
26
32
|
"glash",
|