Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,488 changes: 2,962 additions & 4,526 deletions examples/context-edge-akamai/worker/package-lock.json

Large diffs are not rendered by default.

23 changes: 8 additions & 15 deletions examples/context-edge-akamai/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"private": true,
"description": "Example of bundling EdgeWorker with TypeScript modules",
"license": "MIT",
"type": "module",
"scripts": {
"start": "rollup -c -w",
"download:manifest": "uniform context manifest download --output ./src/manifest/current.json",
"build": "rimraf dist & rollup -c",
"build": "tsup && npm run bundle",
"bundle": "cd dist && tar -czvf bundle.tgz main.js bundle.json && cd ..",
"lint": "eslint \"src/**/*.{js,ts,tsx}\"",
"format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
"upload:bundle": "node ./scripts/upload-bundle.js",
Expand All @@ -18,25 +20,16 @@
"worker:status": "node ./scripts/check-status.js"
},
"dependencies": {
"@uniformdev/context": "^19.145.0",
"@uniformdev/context-edge": "^19.145.0",
"@uniformdev/context-edge-akamai": "^19.145.0"
"@uniformdev/context": "19.173.0",
"@uniformdev/context-edge-akamai": "19.173.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "22.0.0",
"@rollup/plugin-json": "4.1.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@rollup/plugin-typescript": "8.3.2",
"@types/akamai-edgeworkers": "1.0.10",
"@types/node": "^17.0.44",
"@uniformdev/cli": "^19.145.0",
"@uniformdev/cli": "19.173.0",
"dotenv": "^16.0.1",
"rimraf": "^3.0.2",
"rollup": "2.74.1",
"rollup-plugin-copy-assets": "2.0.3",
"rollup-plugin-terser": "7.0.2",
"semver": "7.3.7",
"tslib": "2.4.0",
"typescript": "^4.7.2"
"tsup": "^8.1.0",
"typescript": "^5.5.4"
}
}
4 changes: 4 additions & 0 deletions examples/context-edge-akamai/worker/public/bundle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"edgeworker-version": "0.1.0",
"description": "Uniform Akamai EdgeWorker"
}
33 changes: 0 additions & 33 deletions examples/context-edge-akamai/worker/rollup.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { exec } = require("child_process");

require("dotenv").config();

const data = fs.readFileSync('src/bundle.json', { encoding: 'utf-8' });
const data = fs.readFileSync('public/bundle.json', { encoding: 'utf-8' });
const json = JSON.parse(data);

const currentVersion = coerce(json['edgeworker-version']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const FALLBACK_VERSION = '0.1.0';

const VERSION_INCREMENT = process.env.AKAMAI_WORKER_VERSION_INCREMENT || 'patch';

const data = fs.readFileSync('src/bundle.json', { encoding: 'utf-8' });
const data = fs.readFileSync('public/bundle.json', { encoding: 'utf-8' });
const json = JSON.parse(data);

const oldVersion = coerce(json['edgeworker-version']);
Expand All @@ -29,4 +29,4 @@ if (valid(oldVersion)) {

json['edgeworker-version'] = newVersion;

fs.writeFileSync('src/bundle.json', JSON.stringify(json, null, 2));
fs.writeFileSync('public/bundle.json', JSON.stringify(json, null, 2));
6 changes: 3 additions & 3 deletions examples/context-edge-akamai/worker/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "es2015",
"target": "ES2015",
"module": "esnext",
"target": "ES2018",
"moduleResolution": "node",
"noImplicitAny": false,
"rootDir": ".",
Expand All @@ -11,6 +11,6 @@
"resolveJsonModule": true,
"skipLibCheck": true,
},
"include": ["**/*.ts", "src/bundle.json"],
"include": ["**/*.ts", "public/bundle.json"],
"exclude": ["node_modules", "dist"],
}
12 changes: 12 additions & 0 deletions examples/context-edge-akamai/worker/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable no-var */
import type { Options } from 'tsup';

export var tsup: Options = {
clean: true,
format: ['esm'],
entry: ['src/main.ts'],
splitting: false,
external: ['http-request', 'create-response', 'streams', 'cookies'],
noExternal: [/@uniformdev/],
publicDir: './public'
};