glashjs 0.0.1 → 0.0.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GlashDB
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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 0.0.1');
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.1",
3
+ "version": "0.0.3",
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
- "optionalDependencies": {
23
- "sharp": "^0.33.0"
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",
@@ -33,5 +39,5 @@
33
39
  "brotli",
34
40
  "security"
35
41
  ],
36
- "license": "UNLICENSED"
42
+ "license": "MIT"
37
43
  }