From 72656fa1a9f3aa78a75a8bcd7d3b32ecbda41981 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Mon, 26 Sep 2022 13:58:32 +0100 Subject: [PATCH 1/3] Initial attempt at npm publishing scripts --- .gitignore | 4 + Makefile | 78 +++++++ npm/lib/node-install.ts | 297 ++++++++++++++++++++++++ npm/lib/node-path.ts | 6 + npm/lib/node-platform.ts | 167 +++++++++++++ npm/lib/node-shim.ts | 8 + npm/scripts/build-shim-package.mjs | 18 ++ npm/scripts/bump-version.mjs | 13 ++ npm/workerd-darwin-64/README.md | 6 + npm/workerd-darwin-64/package.json | 21 ++ npm/workerd-darwin-arm64/README.md | 6 + npm/workerd-darwin-arm64/package.json | 20 ++ npm/workerd-linux-64/README.md | 6 + npm/workerd-linux-64/package.json | 21 ++ npm/workerd-linux-arm64/README.md | 6 + npm/workerd-linux-arm64/package.json | 21 ++ npm/workerd/.gitignore | 1 + npm/workerd/README.md | 6 + npm/workerd/package.json | 24 ++ src/workerd/io/compatibility-date.capnp | 2 +- 20 files changed, 730 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100644 npm/lib/node-install.ts create mode 100644 npm/lib/node-path.ts create mode 100644 npm/lib/node-platform.ts create mode 100644 npm/lib/node-shim.ts create mode 100644 npm/scripts/build-shim-package.mjs create mode 100644 npm/scripts/bump-version.mjs create mode 100644 npm/workerd-darwin-64/README.md create mode 100644 npm/workerd-darwin-64/package.json create mode 100644 npm/workerd-darwin-arm64/README.md create mode 100644 npm/workerd-darwin-arm64/package.json create mode 100644 npm/workerd-linux-64/README.md create mode 100644 npm/workerd-linux-64/package.json create mode 100644 npm/workerd-linux-arm64/README.md create mode 100644 npm/workerd-linux-arm64/package.json create mode 100644 npm/workerd/.gitignore create mode 100644 npm/workerd/README.md create mode 100644 npm/workerd/package.json diff --git a/.gitignore b/.gitignore index e376aa0a558..18ec5ab710f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ bazel-bin bazel-out bazel-testlogs bazel-workerd +node_modules +/npm/*/bin +/npm/workerd/install.js +/npm/workerd/lib/ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..f6b7d3287d4 --- /dev/null +++ b/Makefile @@ -0,0 +1,78 @@ + +LATEST_COMPATIBILITY_DATE=$(shell bazel build @capnp-cpp//src/capnp:capnp_tool && bazel-bin/external/capnp-cpp/src/capnp/capnp_tool eval src/workerd/io/compatibility-date.capnp supportedCompatibilityDate) +WORKERD_VERSION=1.$(shell bazel build @capnp-cpp//src/capnp:capnp_tool && bazel-bin/external/capnp-cpp/src/capnp/capnp_tool eval src/workerd/io/compatibility-date.capnp supportedCompatibilityDate | tr -d '-' | tr -d '"').0 + +platform-bazel-build: + bazel build -c opt //src/workerd/server:workerd + mkdir -p "$(NPMDIR)/bin" + WORKERD_VERSION=$(WORKERD_VERSION) node npm/scripts/bump-version.mjs "$(NPMDIR)/package.json" + cp bazel-bin/src/workerd/server/workerd $(NPMDIR)/bin/workerd + +platform-darwin: + @$(MAKE) NPMDIR=npm/workerd-darwin-64 platform-bazel-build + +platform-darwin-arm64: + @$(MAKE) NPMDIR=npm/workerd-darwin-arm64 platform-bazel-build + +platform-linux: + @$(MAKE) NPMDIR=npm/workerd-linux-64 platform-bazel-build + +platform-linux-arm64: + @$(MAKE) NPMDIR=npm/workerd-linux-arm64 platform-bazel-build + +platform-neutral: + echo $(WORKERD_VERSION) + WORKERD_VERSION=$(WORKERD_VERSION) node npm/scripts/bump-version.mjs "npm/workerd/package.json" + mkdir -p npm/workerd/lib + mkdir -p npm/workerd/bin + npx esbuild npm/lib/node-install.ts --outfile=npm/workerd/install.js --bundle --target=node16 --define:LATEST_COMPATIBILITY_DATE="\"$(LATEST_COMPATIBILITY_DATE)\"" --platform=node --external:workerd --log-level=warning + npx esbuild npm/lib/node-shim.ts --outfile=npm/workerd/bin/workerd --bundle --target=node16 --define:LATEST_COMPATIBILITY_DATE="\"$(LATEST_COMPATIBILITY_DATE)\"" --platform=node --external:workerd --log-level=warning + npx esbuild npm/lib/node-path.ts --outfile=npm/workerd/lib/main.js --bundle --target=node16 --define:LATEST_COMPATIBILITY_DATE="\"$(LATEST_COMPATIBILITY_DATE)\"" --platform=node --external:workerd --log-level=warning + WORKERD_VERSION=$(WORKERD_VERSION) node npm/scripts/build-shim-package.mjs + +publish-darwin: platform-darwin + cd npm/workerd-darwin-64 && npm publish + +publish-darwin-arm64: platform-darwin-arm64 + cd npm/workerd-darwin-arm64 && npm publish + +publish-linux: platform-linux + cd npm/workerd-linux-64 && npm publish + +publish-linux-arm64: platform-linux-arm64 + cd npm/workerd-linux-arm64 && npm publish + +publish-neutral: platform-neutral + cd npm/workerd && npm publish + +validate-build: + @test -n "$(TARGET)" || (echo "The environment variable TARGET must be provided" && false) + @test -n "$(PACKAGE)" || (echo "The environment variable PACKAGE must be provided" && false) + @test -n "$(SUBPATH)" || (echo "The environment variable SUBPATH must be provided" && false) + @echo && echo "🔷 Checking $(SCOPE)$(PACKAGE)" + @rm -fr validate && mkdir validate + @$(MAKE) --no-print-directory "$(TARGET)" + @curl -s "https://registry.npmjs.org/$(SCOPE)$(PACKAGE)/-/$(PACKAGE)-$(WORKERD_VERSION).tgz" > validate/workerd.tgz + @cd validate && tar xf workerd.tgz + @ls -l "npm/$(SCOPE)$(PACKAGE)/$(SUBPATH)" "validate/package/$(SUBPATH)" && \ + shasum "npm/$(SCOPE)$(PACKAGE)/$(SUBPATH)" "validate/package/$(SUBPATH)" && \ + cmp "npm/$(SCOPE)$(PACKAGE)/$(SUBPATH)" "validate/package/$(SUBPATH)" + @rm -fr validate + +# This checks that the published binaries are bitwise-identical to the locally-build binaries +validate-builds: + git fetch --all --tags && git checkout "v$(WORKERD_VERSION)" + @$(MAKE) --no-print-directory TARGET=platform-darwin PACKAGE=workerd-darwin-64 SUBPATH=bin/workerd validate-build + @$(MAKE) --no-print-directory TARGET=platform-darwin-arm64 PACKAGE=workerd-darwin-arm64 SUBPATH=bin/workerd validate-build + @$(MAKE) --no-print-directory TARGET=platform-linux PACKAGE=workerd-linux-64 SUBPATH=bin/workerd validate-build + @$(MAKE) --no-print-directory TARGET=platform-linux-arm64 PACKAGE=workerd-linux-arm64 SUBPATH=bin/workerd validate-build + +clean: + rm -f npm/workerd/install.js + rm -rf npm/workerd-darwin-64/bin + rm -rf npm/workerd-darwin-arm64/bin + rm -rf npm/workerd-linux-64/bin + rm -rf npm/workerd-linux-arm64/bin + rm -rf npm/workerd/bin + rm -rf npm/workerd/lib + \ No newline at end of file diff --git a/npm/lib/node-install.ts b/npm/lib/node-install.ts new file mode 100644 index 00000000000..261c25dfca6 --- /dev/null +++ b/npm/lib/node-install.ts @@ -0,0 +1,297 @@ +// Adapted from evanw/esbuild +import { + downloadedBinPath, + pkgAndSubpathForCurrentPlatform +} from './node-platform'; + +import fs from 'fs'; +import os from 'os'; +import path from 'path'; +import zlib from 'zlib'; +import https from 'https'; +import child_process from 'child_process'; + +declare const LATEST_COMPATIBILITY_DATE: string; + +// Make something semver-ish +const WORKERD_VERSION = `1.${LATEST_COMPATIBILITY_DATE.split('-').join('')}.0`; + +const toPath = path.join(__dirname, 'bin', 'workerd'); +let isToPathJS = true; + +function validateBinaryVersion(...command: string[]): void { + command.push('--version'); + const stdout = child_process + .execFileSync(command.shift()!, command, { + // Without this, this install script strangely crashes with the error + // "EACCES: permission denied, write" but only on Ubuntu Linux when node is + // installed from the Snap Store. This is not a problem when you download + // the official version of node. The problem appears to be that stderr + // (i.e. file descriptor 2) isn't writable? + // + // More info: + // - https://snapcraft.io/ (what the Snap Store is) + // - https://nodejs.org/dist/ (download the official version of node) + // - https://github.com/evanw/esbuild/issues/1711#issuecomment-1027554035 + // + stdio: 'pipe' + }) + .toString() + .trim(); + if (stdout !== LATEST_COMPATIBILITY_DATE) { + throw new Error( + `Expected ${JSON.stringify( + LATEST_COMPATIBILITY_DATE + )} but got ${JSON.stringify(stdout)}` + ); + } +} + +function isYarn(): boolean { + const { npm_config_user_agent } = process.env; + if (npm_config_user_agent) { + return /\byarn\//.test(npm_config_user_agent); + } + return false; +} + +function fetch(url: string): Promise { + return new Promise((resolve, reject) => { + https + .get(url, (res) => { + if ( + (res.statusCode === 301 || res.statusCode === 302) && + res.headers.location + ) + return fetch(res.headers.location).then(resolve, reject); + if (res.statusCode !== 200) + return reject(new Error(`Server responded with ${res.statusCode}`)); + let chunks: Buffer[] = []; + res.on('data', (chunk) => chunks.push(chunk)); + res.on('end', () => resolve(Buffer.concat(chunks))); + }) + .on('error', reject); + }); +} + +function extractFileFromTarGzip(buffer: Buffer, subpath: string): Buffer { + try { + buffer = zlib.unzipSync(buffer); + } catch (err: any) { + throw new Error( + `Invalid gzip data in archive: ${(err && err.message) || err}` + ); + } + let str = (i: number, n: number) => + String.fromCharCode(...buffer.subarray(i, i + n)).replace(/\0.*$/, ''); + let offset = 0; + subpath = `package/${subpath}`; + while (offset < buffer.length) { + let name = str(offset, 100); + let size = parseInt(str(offset + 124, 12), 8); + offset += 512; + if (!isNaN(size)) { + if (name === subpath) return buffer.subarray(offset, offset + size); + offset += (size + 511) & ~511; + } + } + throw new Error(`Could not find ${JSON.stringify(subpath)} in archive`); +} + +function installUsingNPM(pkg: string, subpath: string, binPath: string): void { + // Erase "npm_config_global" so that "npm install --global workerd" works. + // Otherwise this nested "npm install" will also be global, and the install + // will deadlock waiting for the global installation lock. + const env = { ...process.env, npm_config_global: undefined }; + + // Create a temporary directory inside the "workerd" package with an empty + // "package.json" file. We'll use this to run "npm install" in. + const libDir = path.dirname(require.resolve('workerd')); + const installDir = path.join(libDir, 'npm-install'); + fs.mkdirSync(installDir); + try { + fs.writeFileSync(path.join(installDir, 'package.json'), '{}'); + + // Run "npm install" in the temporary directory which should download the + // desired package. Try to avoid unnecessary log output. This uses the "npm" + // command instead of a HTTP request so that it hopefully works in situations + // where HTTP requests are blocked but the "npm" command still works due to, + // for example, a custom configured npm registry and special firewall rules. + child_process.execSync( + `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${WORKERD_VERSION}`, + { cwd: installDir, stdio: 'pipe', env } + ); + + // Move the downloaded binary executable into place. The destination path + // is the same one that the JavaScript API code uses so it will be able to + // find the binary executable here later. + const installedBinPath = path.join( + installDir, + 'node_modules', + pkg, + subpath + ); + fs.renameSync(installedBinPath, binPath); + } finally { + // Try to clean up afterward so we don't unnecessarily waste file system + // space. Leaving nested "node_modules" directories can also be problematic + // for certain tools that scan over the file tree and expect it to have a + // certain structure. + try { + removeRecursive(installDir); + } catch { + // Removing a file or directory can randomly break on Windows, returning + // EBUSY for an arbitrary length of time. I think this happens when some + // other program has that file or directory open (e.g. an anti-virus + // program). This is fine on Unix because the OS just unlinks the entry + // but keeps the reference around until it's unused. There's nothing we + // can do in this case so we just leave the directory there. + } + } +} + +function removeRecursive(dir: string): void { + for (const entry of fs.readdirSync(dir)) { + const entryPath = path.join(dir, entry); + let stats; + try { + stats = fs.lstatSync(entryPath); + } catch { + continue; // Guard against https://github.com/nodejs/node/issues/4760 + } + if (stats.isDirectory()) removeRecursive(entryPath); + else fs.unlinkSync(entryPath); + } + fs.rmdirSync(dir); +} + +function maybeOptimizePackage(binPath: string): void { + // This package contains a "bin/workerd" JavaScript file that finds and runs + // the appropriate binary executable. However, this means that running the + // "workerd" command runs another instance of "node" which is way slower than + // just running the binary executable directly. + // + // Here we optimize for this by replacing the JavaScript file with the binary + // executable at install time. + // + // This doesn't work with Yarn both because of lack of support for binary + // files in Yarn 2+ (see https://github.com/yarnpkg/berry/issues/882) and + // because Yarn (even Yarn 1?) may run the same install scripts in the same + // place multiple times from different platforms, especially when people use + // Docker. Avoid idempotency issues by just not optimizing when using Yarn. + // + // This optimization also doesn't apply when npm's "--ignore-scripts" flag is + // used since in that case this install script will not be run. + if (!isYarn()) { + const tempPath = path.join(__dirname, 'bin-workerd'); + try { + // First link the binary with a temporary file. If this fails and throws an + // error, then we'll just end up doing nothing. This uses a hard link to + // avoid taking up additional space on the file system. + fs.linkSync(binPath, tempPath); + + // Then use rename to atomically replace the target file with the temporary + // file. If this fails and throws an error, then we'll just end up leaving + // the temporary file there, which is harmless. + fs.renameSync(tempPath, toPath); + + // If we get here, then we know that the target location is now a binary + // executable instead of a JavaScript file. + isToPathJS = false; + + // If this install script is being re-run, then "renameSync" will fail + // since the underlying inode is the same (it just returns without doing + // anything, and without throwing an error). In that case we should remove + // the file manually. + fs.unlinkSync(tempPath); + } catch { + // Ignore errors here since this optimization is optional + } + } +} + +async function downloadDirectlyFromNPM( + pkg: string, + subpath: string, + binPath: string +): Promise { + // If that fails, the user could have npm configured incorrectly or could not + // have npm installed. Try downloading directly from npm as a last resort. + const url = `https://registry.npmjs.org/${pkg}/-/${pkg}-${WORKERD_VERSION}.tgz`; + console.error(`[workerd] Trying to download ${JSON.stringify(url)}`); + try { + fs.writeFileSync( + binPath, + extractFileFromTarGzip(await fetch(url), subpath) + ); + fs.chmodSync(binPath, 0o755); + } catch (e: any) { + console.error( + `[workerd] Failed to download ${JSON.stringify(url)}: ${ + (e && e.message) || e + }` + ); + throw e; + } +} + +async function checkAndPreparePackage(): Promise { + const { pkg, subpath } = pkgAndSubpathForCurrentPlatform(); + + let binPath: string; + try { + // First check for the binary package from our "optionalDependencies". This + // package should have been installed alongside this package at install time. + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + console.error(`[workerd] Failed to find package "${pkg}" on the file system + +This can happen if you use the "--no-optional" flag. The "optionalDependencies" +package.json feature is used by workerd to install the correct binary executable +for your current platform. This install script will now attempt to work around +this. If that fails, you need to remove the "--no-optional" flag to use workerd. +`); + + // If that didn't work, then someone probably installed workerd with the + // "--no-optional" flag. Attempt to compensate for this by downloading the + // package using a nested call to "npm" instead. + // + // THIS MAY NOT WORK. Package installation uses "optionalDependencies" for + // a reason: manually downloading the package has a lot of obscure edge + // cases that fail because people have customized their environment in + // some strange way that breaks downloading. This code path is just here + // to be helpful but it's not the supported way of installing workerd. + binPath = downloadedBinPath(pkg, subpath); + try { + console.error(`[workerd] Trying to install package "${pkg}" using npm`); + installUsingNPM(pkg, subpath, binPath); + } catch (e2: any) { + console.error( + `[workerd] Failed to install package "${pkg}" using npm: ${ + (e2 && e2.message) || e2 + }` + ); + + // If that didn't also work, then something is likely wrong with the "npm" + // command. Attempt to compensate for this by manually downloading the + // package from the npm registry over HTTP as a last resort. + try { + await downloadDirectlyFromNPM(pkg, subpath, binPath); + } catch (e3: any) { + throw new Error(`Failed to install package "${pkg}"`); + } + } + } + + maybeOptimizePackage(binPath); +} + +checkAndPreparePackage().then(() => { + if (isToPathJS) { + // We need "node" before this command since it's a JavaScript file + validateBinaryVersion(process.execPath, toPath); + } else { + // This is no longer a JavaScript file so don't run it using "node" + validateBinaryVersion(toPath); + } +}); diff --git a/npm/lib/node-path.ts b/npm/lib/node-path.ts new file mode 100644 index 00000000000..693ebeea1cb --- /dev/null +++ b/npm/lib/node-path.ts @@ -0,0 +1,6 @@ +#!/usr/bin/env node + +import { generateBinPath } from './node-platform'; +const { binPath } = generateBinPath(); + +export default binPath; diff --git a/npm/lib/node-platform.ts b/npm/lib/node-platform.ts new file mode 100644 index 00000000000..4aff2721aea --- /dev/null +++ b/npm/lib/node-platform.ts @@ -0,0 +1,167 @@ +// Adapted from evanw/esbuild + +import fs from 'fs'; +import os from 'os'; +import path from 'path'; + +declare const WORKERD_VERSION: string; + +export const knownPackages: Record = { + 'darwin arm64 LE': '@cloudflare/workerd-darwin-arm64', + 'darwin x64 LE': '@cloudflare/workerd-darwin-64', + 'linux arm64 LE': '@cloudflare/workerd-linux-arm64', + 'linux x64 LE': '@cloudflare/workerd-linux-64' +}; + +export function pkgAndSubpathForCurrentPlatform(): { + pkg: string; + subpath: string; +} { + let pkg: string; + let subpath: string; + let platformKey = `${process.platform} ${os.arch()} ${os.endianness()}`; + + if (platformKey in knownPackages) { + pkg = knownPackages[platformKey]; + subpath = 'bin/workerd'; + } else { + throw new Error(`Unsupported platform: ${platformKey}`); + } + + return { pkg, subpath }; +} + +function pkgForSomeOtherPlatform(): string | null { + const libMain = require.resolve('workerd'); + const nodeModulesDirectory = path.dirname( + path.dirname(path.dirname(libMain)) + ); + + if (path.basename(nodeModulesDirectory) === 'node_modules') { + for (const unixKey in knownPackages) { + try { + const pkg = knownPackages[unixKey]; + if (fs.existsSync(path.join(nodeModulesDirectory, pkg))) return pkg; + } catch {} + } + } + + return null; +} + +export function downloadedBinPath(pkg: string, subpath: string): string { + const libDir = path.dirname(require.resolve('workerd')); + return path.join(libDir, `downloaded-${pkg}-${path.basename(subpath)}`); +} + +export function generateBinPath(): { binPath: string } { + const { pkg, subpath } = pkgAndSubpathForCurrentPlatform(); + let binPath: string; + + try { + // First check for the binary package from our "optionalDependencies". This + // package should have been installed alongside this package at install time. + binPath = require.resolve(`${pkg}/${subpath}`); + } catch (e) { + // If that didn't work, then someone probably installed workerd with the + // "--no-optional" flag. Our install script attempts to compensate for this + // by manually downloading the package instead. Check for that next. + binPath = downloadedBinPath(pkg, subpath); + if (!fs.existsSync(binPath)) { + // If that didn't work too, check to see whether the package is even there + // at all. It may not be (for a few different reasons). + try { + require.resolve(pkg); + } catch { + // If we can't find the package for this platform, then it's possible + // that someone installed this for some other platform and is trying + // to use it without reinstalling. That won't work of course, but + // people do this all the time with systems like Docker. Try to be + // helpful in that case. + const otherPkg = pkgForSomeOtherPlatform(); + if (otherPkg) { + throw new Error(` +You installed workerd on another platform than the one you're currently using. +This won't work because workerd is written with native code and needs to +install a platform-specific binary executable. + +Specifically the "${otherPkg}" package is present but this platform +needs the "${pkg}" package instead. People often get into this +situation by installing workerd on macOS and copying "node_modules" +into a Docker image that runs Linux. + +If you are installing with npm, you can try not copying the "node_modules" +directory when you copy the files over, and running "npm ci" or "npm install" +on the destination platform after the copy. Or you could consider using yarn +instead which has built-in support for installing a package on multiple +platforms simultaneously. + +If you are installing with yarn, you can try listing both this platform and the +other platform in your ".yarnrc.yml" file using the "supportedArchitectures" +feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures +Keep in mind that this means multiple copies of workerd will be present. +`); + } + + // If that didn't work too, then maybe someone installed workerd with + // both the "--no-optional" and the "--ignore-scripts" flags. The fix + // for this is to just not do that. We don't attempt to handle this + // case at all. + // + // In that case we try to have a nice error message if we think we know + // what's happening. Otherwise we just rethrow the original error message. + throw new Error(`The package "${pkg}" could not be found, and is needed by workerd. + +If you are installing workerd with npm, make sure that you don't specify the +"--no-optional" flag. The "optionalDependencies" package.json feature is used +by workerd to install the correct binary executable for your current platform.`); + } + throw e; + } + } + + // The workerd binary executable can't be used in Yarn 2 in PnP mode because + // it's inside a virtual file system and the OS needs it in the real file + // system. So we need to copy the file out of the virtual file system into + // the real file system. + // + // You might think that we could use "preferUnplugged: true" in each of the + // platform-specific packages for this instead, since that tells Yarn to not + // use the virtual file system for those packages. This is not done because: + // + // * Really early versions of Yarn don't support "preferUnplugged", so package + // installation would break on those Yarn versions if we did this. + // + // * Earlier Yarn versions always installed all optional dependencies for all + // platforms even though most of them are incompatible. To minimize file + // system space, we want these useless packages to take up as little space + // as possible so they should remain unzipped inside their ".zip" files. + // + // We have to explicitly pass "preferUnplugged: false" instead of leaving + // it up to Yarn's default behavior because Yarn's heuristics otherwise + // automatically unzip packages containing ".exe" files, and we don't want + // our Windows-specific packages to be unzipped either. + // + let pnpapi: any; + try { + pnpapi = require('pnpapi'); + } catch (e) {} + if (pnpapi) { + const root = pnpapi.getPackageInformation(pnpapi.topLevel).packageLocation; + const binTargetPath = path.join( + root, + 'node_modules', + '.cache', + 'workerd', + `pnpapi-${pkg}-${WORKERD_VERSION}-${path.basename(subpath)}` + ); + if (!fs.existsSync(binTargetPath)) { + fs.mkdirSync(path.dirname(binTargetPath), { recursive: true }); + fs.copyFileSync(binPath, binTargetPath); + fs.chmodSync(binTargetPath, 0o755); + } + return { binPath: binTargetPath }; + } + + return { binPath }; +} diff --git a/npm/lib/node-shim.ts b/npm/lib/node-shim.ts new file mode 100644 index 00000000000..a4f74d8363f --- /dev/null +++ b/npm/lib/node-shim.ts @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +import { generateBinPath } from "./node-platform"; +const { binPath } = generateBinPath(); + +require("child_process").execFileSync(binPath, process.argv.slice(2), { + stdio: "inherit", +}); diff --git a/npm/scripts/build-shim-package.mjs b/npm/scripts/build-shim-package.mjs new file mode 100644 index 00000000000..8f8081a92ea --- /dev/null +++ b/npm/scripts/build-shim-package.mjs @@ -0,0 +1,18 @@ +// Adapted from evanw/esbuild + +import path from 'path'; +import fs from 'fs'; + +function buildNeutralLib() { + const pjPath = path.join('npm', 'workerd', 'package.json'); + const package_json = JSON.parse(fs.readFileSync(pjPath, 'utf8')); + package_json.optionalDependencies = { + '@cloudflare/workerd-darwin-arm64': process.env.WORKERD_VERSION, + '@cloudflare/workerd-darwin-64': process.env.WORKERD_VERSION, + '@cloudflare/workerd-linux-arm64': process.env.WORKERD_VERSION, + '@cloudflare/workerd-linux-64': process.env.WORKERD_VERSION + }; + fs.writeFileSync(pjPath, JSON.stringify(package_json, null, 2) + '\n'); +} + +buildNeutralLib(); diff --git a/npm/scripts/bump-version.mjs b/npm/scripts/bump-version.mjs new file mode 100644 index 00000000000..cccc40bb0a5 --- /dev/null +++ b/npm/scripts/bump-version.mjs @@ -0,0 +1,13 @@ +// Adapted from evanw/esbuild +import fs from 'fs'; + +function updateVersionPackageJSON(pathToPackageJSON) { + console.log(pathToPackageJSON); + const json = JSON.parse(fs.readFileSync(pathToPackageJSON, 'utf8')); + + json.version = process.env.WORKERD_VERSION; + + fs.writeFileSync(pathToPackageJSON, JSON.stringify(json, null, 2) + '\n'); +} + +updateVersionPackageJSON(process.argv[2]); diff --git a/npm/workerd-darwin-64/README.md b/npm/workerd-darwin-64/README.md new file mode 100644 index 00000000000..409f389dc75 --- /dev/null +++ b/npm/workerd-darwin-64/README.md @@ -0,0 +1,6 @@ +# 👷 `workerd` for macOS 64-bit, Cloudflare's JavaScript/Wasm Runtime + +`workerd` is a JavaScript / Wasm server runtime based on the same code that powers +[Cloudflare Workers](https://workers.dev). + +See https://github.com/cloudflare/workerd for details. diff --git a/npm/workerd-darwin-64/package.json b/npm/workerd-darwin-64/package.json new file mode 100644 index 00000000000..e404f0de452 --- /dev/null +++ b/npm/workerd-darwin-64/package.json @@ -0,0 +1,21 @@ +{ + "name": "@cloudflare/workerd-darwin-64", + "description": "👷 workerd for macOS 64-bit, Cloudflare's JavaScript/Wasm Runtime", + "repository": "https://github.com/cloudflare/workerd", + "license": "Apache-2.0", + "preferUnplugged": false, + "private": true, + "engines": { + "node": ">=16" + }, + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ], + "publishConfig": { + "registry": "https://registry-gateway.cloudflare-ui.workers.dev" + }, + "version": "1.20220920.0" +} diff --git a/npm/workerd-darwin-arm64/README.md b/npm/workerd-darwin-arm64/README.md new file mode 100644 index 00000000000..bf9bc658a3f --- /dev/null +++ b/npm/workerd-darwin-arm64/README.md @@ -0,0 +1,6 @@ +# 👷 `workerd` for macOS ARM 64-bit, Cloudflare's JavaScript/Wasm Runtime + +`workerd` is a JavaScript / Wasm server runtime based on the same code that powers +[Cloudflare Workers](https://workers.dev). + +See https://github.com/cloudflare/workerd for details. diff --git a/npm/workerd-darwin-arm64/package.json b/npm/workerd-darwin-arm64/package.json new file mode 100644 index 00000000000..2e99b13f205 --- /dev/null +++ b/npm/workerd-darwin-arm64/package.json @@ -0,0 +1,20 @@ +{ + "name": "@cloudflare/workerd-darwin-arm64", + "description": "👷 workerd for macOS ARM 64-bit, Cloudflare's JavaScript/Wasm Runtime", + "repository": "https://github.com/cloudflare/workerd", + "license": "Apache-2.0", + "preferUnplugged": false, + "engines": { + "node": ">=16" + }, + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ], + "publishConfig": { + "registry": "https://registry-gateway.cloudflare-ui.workers.dev" + }, + "version": "1.20220920.0" +} diff --git a/npm/workerd-linux-64/README.md b/npm/workerd-linux-64/README.md new file mode 100644 index 00000000000..edbebe807f7 --- /dev/null +++ b/npm/workerd-linux-64/README.md @@ -0,0 +1,6 @@ +# 👷 `workerd` for Linux 64-bit, Cloudflare's JavaScript/Wasm Runtime + +`workerd` is a JavaScript / Wasm server runtime based on the same code that powers +[Cloudflare Workers](https://workers.dev). + +See https://github.com/cloudflare/workerd for details. diff --git a/npm/workerd-linux-64/package.json b/npm/workerd-linux-64/package.json new file mode 100644 index 00000000000..bfa95bf5fd9 --- /dev/null +++ b/npm/workerd-linux-64/package.json @@ -0,0 +1,21 @@ +{ + "name": "@cloudflare/workerd-linux-64", + "description": "👷 workerd for Linux 64-bit, Cloudflare's JavaScript/Wasm Runtime", + "repository": "https://github.com/cloudflare/workerd", + "license": "Apache-2.0", + "preferUnplugged": false, + "private": true, + "engines": { + "node": ">=16" + }, + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "publishConfig": { + "registry": "https://registry-gateway.cloudflare-ui.workers.dev" + }, + "version": "1.20220920.0" +} diff --git a/npm/workerd-linux-arm64/README.md b/npm/workerd-linux-arm64/README.md new file mode 100644 index 00000000000..346c664ae24 --- /dev/null +++ b/npm/workerd-linux-arm64/README.md @@ -0,0 +1,6 @@ +# 👷 `workerd` for Linux ARM 64-bit, Cloudflare's JavaScript/Wasm Runtime + +`workerd` is a JavaScript / Wasm server runtime based on the same code that powers +[Cloudflare Workers](https://workers.dev). + +See https://github.com/cloudflare/workerd for details. diff --git a/npm/workerd-linux-arm64/package.json b/npm/workerd-linux-arm64/package.json new file mode 100644 index 00000000000..b21469a82b2 --- /dev/null +++ b/npm/workerd-linux-arm64/package.json @@ -0,0 +1,21 @@ +{ + "name": "@cloudflare/workerd-linux-arm64", + "description": "👷 workerd for Linux ARM 64-bit, Cloudflare's JavaScript/Wasm Runtime", + "repository": "https://github.com/cloudflare/workerd", + "license": "Apache-2.0", + "private": true, + "preferUnplugged": false, + "engines": { + "node": ">=16" + }, + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "publishConfig": { + "registry": "https://registry-gateway.cloudflare-ui.workers.dev" + }, + "version": "1.20220920.0" +} diff --git a/npm/workerd/.gitignore b/npm/workerd/.gitignore new file mode 100644 index 00000000000..b512c09d476 --- /dev/null +++ b/npm/workerd/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/npm/workerd/README.md b/npm/workerd/README.md new file mode 100644 index 00000000000..4c1d57e6a73 --- /dev/null +++ b/npm/workerd/README.md @@ -0,0 +1,6 @@ +# 👷 `workerd`, Cloudflare's JavaScript/Wasm Runtime + +`workerd` is a JavaScript / Wasm server runtime based on the same code that powers +[Cloudflare Workers](https://workers.dev). + +See https://github.com/cloudflare/workerd for details. diff --git a/npm/workerd/package.json b/npm/workerd/package.json new file mode 100644 index 00000000000..9181654cce3 --- /dev/null +++ b/npm/workerd/package.json @@ -0,0 +1,24 @@ +{ + "name": "workerd", + "version": "1.20220920.0", + "description": "👷 workerd, Cloudflare's JavaScript/Wasm Runtime", + "repository": "https://github.com/cloudflare/workerd", + "scripts": {}, + "main": "lib/main.js", + "engines": { + "node": ">=16" + }, + "bin": { + "workerd": "bin/workerd" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-arm64": "1.20220920.0", + "@cloudflare/workerd-darwin-64": "1.20220920.0", + "@cloudflare/workerd-linux-arm64": "1.20220920.0", + "@cloudflare/workerd-linux-64": "1.20220920.0" + }, + "license": "Apache-2.0", + "publishConfig": { + "registry": "https://registry-gateway.cloudflare-ui.workers.dev" + } +} diff --git a/src/workerd/io/compatibility-date.capnp b/src/workerd/io/compatibility-date.capnp index d8114006bd4..014d082964c 100644 --- a/src/workerd/io/compatibility-date.capnp +++ b/src/workerd/io/compatibility-date.capnp @@ -6,7 +6,7 @@ $import "/capnp/c++.capnp".namespace("workerd"); -const supportedCompatibilityDate :Text = "2022-09-17"; +const supportedCompatibilityDate :Text = "2022-09-20"; # Newest compatibility date that can safely be set using code compiled from this repo. Trying to # run a Worker with a newer compatibility date than this will fail. # From 101ac325f8581591d825a757880a4c5aeae2a055 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Mon, 26 Sep 2022 17:58:04 +0100 Subject: [PATCH 2/3] Makefile->npm.sh, add proper copyright attribution --- Makefile | 78 ------------------------- npm.sh | 64 ++++++++++++++++++++ npm/lib/node-install.ts | 7 ++- npm/lib/node-path.ts | 6 ++ npm/lib/node-platform.ts | 8 ++- npm/lib/node-shim.ts | 12 +++- npm/scripts/build-shim-package.mjs | 8 ++- npm/scripts/bump-version.mjs | 7 ++- src/workerd/io/compatibility-date.capnp | 2 +- 9 files changed, 104 insertions(+), 88 deletions(-) delete mode 100644 Makefile create mode 100644 npm.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index f6b7d3287d4..00000000000 --- a/Makefile +++ /dev/null @@ -1,78 +0,0 @@ - -LATEST_COMPATIBILITY_DATE=$(shell bazel build @capnp-cpp//src/capnp:capnp_tool && bazel-bin/external/capnp-cpp/src/capnp/capnp_tool eval src/workerd/io/compatibility-date.capnp supportedCompatibilityDate) -WORKERD_VERSION=1.$(shell bazel build @capnp-cpp//src/capnp:capnp_tool && bazel-bin/external/capnp-cpp/src/capnp/capnp_tool eval src/workerd/io/compatibility-date.capnp supportedCompatibilityDate | tr -d '-' | tr -d '"').0 - -platform-bazel-build: - bazel build -c opt //src/workerd/server:workerd - mkdir -p "$(NPMDIR)/bin" - WORKERD_VERSION=$(WORKERD_VERSION) node npm/scripts/bump-version.mjs "$(NPMDIR)/package.json" - cp bazel-bin/src/workerd/server/workerd $(NPMDIR)/bin/workerd - -platform-darwin: - @$(MAKE) NPMDIR=npm/workerd-darwin-64 platform-bazel-build - -platform-darwin-arm64: - @$(MAKE) NPMDIR=npm/workerd-darwin-arm64 platform-bazel-build - -platform-linux: - @$(MAKE) NPMDIR=npm/workerd-linux-64 platform-bazel-build - -platform-linux-arm64: - @$(MAKE) NPMDIR=npm/workerd-linux-arm64 platform-bazel-build - -platform-neutral: - echo $(WORKERD_VERSION) - WORKERD_VERSION=$(WORKERD_VERSION) node npm/scripts/bump-version.mjs "npm/workerd/package.json" - mkdir -p npm/workerd/lib - mkdir -p npm/workerd/bin - npx esbuild npm/lib/node-install.ts --outfile=npm/workerd/install.js --bundle --target=node16 --define:LATEST_COMPATIBILITY_DATE="\"$(LATEST_COMPATIBILITY_DATE)\"" --platform=node --external:workerd --log-level=warning - npx esbuild npm/lib/node-shim.ts --outfile=npm/workerd/bin/workerd --bundle --target=node16 --define:LATEST_COMPATIBILITY_DATE="\"$(LATEST_COMPATIBILITY_DATE)\"" --platform=node --external:workerd --log-level=warning - npx esbuild npm/lib/node-path.ts --outfile=npm/workerd/lib/main.js --bundle --target=node16 --define:LATEST_COMPATIBILITY_DATE="\"$(LATEST_COMPATIBILITY_DATE)\"" --platform=node --external:workerd --log-level=warning - WORKERD_VERSION=$(WORKERD_VERSION) node npm/scripts/build-shim-package.mjs - -publish-darwin: platform-darwin - cd npm/workerd-darwin-64 && npm publish - -publish-darwin-arm64: platform-darwin-arm64 - cd npm/workerd-darwin-arm64 && npm publish - -publish-linux: platform-linux - cd npm/workerd-linux-64 && npm publish - -publish-linux-arm64: platform-linux-arm64 - cd npm/workerd-linux-arm64 && npm publish - -publish-neutral: platform-neutral - cd npm/workerd && npm publish - -validate-build: - @test -n "$(TARGET)" || (echo "The environment variable TARGET must be provided" && false) - @test -n "$(PACKAGE)" || (echo "The environment variable PACKAGE must be provided" && false) - @test -n "$(SUBPATH)" || (echo "The environment variable SUBPATH must be provided" && false) - @echo && echo "🔷 Checking $(SCOPE)$(PACKAGE)" - @rm -fr validate && mkdir validate - @$(MAKE) --no-print-directory "$(TARGET)" - @curl -s "https://registry.npmjs.org/$(SCOPE)$(PACKAGE)/-/$(PACKAGE)-$(WORKERD_VERSION).tgz" > validate/workerd.tgz - @cd validate && tar xf workerd.tgz - @ls -l "npm/$(SCOPE)$(PACKAGE)/$(SUBPATH)" "validate/package/$(SUBPATH)" && \ - shasum "npm/$(SCOPE)$(PACKAGE)/$(SUBPATH)" "validate/package/$(SUBPATH)" && \ - cmp "npm/$(SCOPE)$(PACKAGE)/$(SUBPATH)" "validate/package/$(SUBPATH)" - @rm -fr validate - -# This checks that the published binaries are bitwise-identical to the locally-build binaries -validate-builds: - git fetch --all --tags && git checkout "v$(WORKERD_VERSION)" - @$(MAKE) --no-print-directory TARGET=platform-darwin PACKAGE=workerd-darwin-64 SUBPATH=bin/workerd validate-build - @$(MAKE) --no-print-directory TARGET=platform-darwin-arm64 PACKAGE=workerd-darwin-arm64 SUBPATH=bin/workerd validate-build - @$(MAKE) --no-print-directory TARGET=platform-linux PACKAGE=workerd-linux-64 SUBPATH=bin/workerd validate-build - @$(MAKE) --no-print-directory TARGET=platform-linux-arm64 PACKAGE=workerd-linux-arm64 SUBPATH=bin/workerd validate-build - -clean: - rm -f npm/workerd/install.js - rm -rf npm/workerd-darwin-64/bin - rm -rf npm/workerd-darwin-arm64/bin - rm -rf npm/workerd-linux-64/bin - rm -rf npm/workerd-linux-arm64/bin - rm -rf npm/workerd/bin - rm -rf npm/workerd/lib - \ No newline at end of file diff --git a/npm.sh b/npm.sh new file mode 100644 index 00000000000..55c05e894ce --- /dev/null +++ b/npm.sh @@ -0,0 +1,64 @@ +#! /bin/bash +# TODO(cleanup): Convert to bazel rules/GitHub Actions +set -euo pipefail + +bazel build @capnp-cpp//src/capnp:capnp_tool + +export LATEST_COMPATIBILITY_DATE=$(bazel-bin/external/capnp-cpp/src/capnp/capnp_tool eval src/workerd/io/compatibility-date.capnp supportedCompatibilityDate) +export WORKERD_VERSION=1.$(echo $LATEST_COMPATIBILITY_DATE | tr -d '-' | tr -d '"').0 + +bazel_build() { + bazel build -c opt //src/workerd/server:workerd + mkdir -p $1/bin + node npm/scripts/bump-version.mjs $1/package.json + cp bazel-bin/src/workerd/server/workerd $1/bin/workerd +} + +case $1 in +build-darwin-arm64) + bazel_build npm/workerd-darwin-arm64 + ;; +publish-darwin-arm64) + cd npm/workerd-darwin-arm64 && npm publish + ;; +build-darwin) + bazel_build npm/workerd-darwin-64 + ;; +publish-darwin) + cd npm/workerd-darwin-64 && npm publish + ;; +build-linux-arm64) + bazel_build npm/workerd-linux-arm64 + ;; +publish-linux-arm64) + cd npm/workerd-linux-arm64 && npm publish + ;; +build-linux) + bazel_build npm/workerd-linux-64 + ;; +publish-linux) + cd npm/workerd-linux-64 && npm publish + ;; +build-shim) + node npm/scripts/bump-version.mjs npm/workerd/package.json + mkdir -p npm/workerd/lib + mkdir -p npm/workerd/bin + npx esbuild npm/lib/node-install.ts --outfile=npm/workerd/install.js --bundle --target=node16 --define:LATEST_COMPATIBILITY_DATE=$LATEST_COMPATIBILITY_DATE --platform=node --external:workerd --log-level=warning + npx esbuild npm/lib/node-shim.ts --outfile=npm/workerd/bin/workerd --bundle --target=node16 --define:LATEST_COMPATIBILITY_DATE=$LATEST_COMPATIBILITY_DATE --platform=node --external:workerd --log-level=warning + npx esbuild npm/lib/node-path.ts --outfile=npm/workerd/lib/main.js --bundle --target=node16 --define:LATEST_COMPATIBILITY_DATE=$LATEST_COMPATIBILITY_DATE --platform=node --external:workerd --log-level=warning + node npm/scripts/build-shim-package.mjs + ;; +publish-shim) + cd npm/workerd && npm publish + ;; +clean) + rm -f npm/workerd/install.js + rm -rf npm/workerd-darwin-64/bin + rm -rf npm/workerd-darwin-arm64/bin + rm -rf npm/workerd-linux-64/bin + rm -rf npm/workerd-linux-arm64/bin + rm -rf npm/workerd/bin + rm -rf npm/workerd/lib + ;; +*) ;; +esac diff --git a/npm/lib/node-install.ts b/npm/lib/node-install.ts index 261c25dfca6..53663524659 100644 --- a/npm/lib/node-install.ts +++ b/npm/lib/node-install.ts @@ -1,4 +1,9 @@ -// Adapted from evanw/esbuild +/* Adapted from github.com/evanw/esbuild +MIT License +Copyright (c) 2020 Evan Wallace +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ import { downloadedBinPath, pkgAndSubpathForCurrentPlatform diff --git a/npm/lib/node-path.ts b/npm/lib/node-path.ts index 693ebeea1cb..3ec12a43d04 100644 --- a/npm/lib/node-path.ts +++ b/npm/lib/node-path.ts @@ -1,4 +1,10 @@ #!/usr/bin/env node +/* Adapted from github.com/evanw/esbuild +MIT License +Copyright (c) 2020 Evan Wallace +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ import { generateBinPath } from './node-platform'; const { binPath } = generateBinPath(); diff --git a/npm/lib/node-platform.ts b/npm/lib/node-platform.ts index 4aff2721aea..0b2e09999a8 100644 --- a/npm/lib/node-platform.ts +++ b/npm/lib/node-platform.ts @@ -1,5 +1,9 @@ -// Adapted from evanw/esbuild - +/* Adapted from github.com/evanw/esbuild +MIT License +Copyright (c) 2020 Evan Wallace +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ import fs from 'fs'; import os from 'os'; import path from 'path'; diff --git a/npm/lib/node-shim.ts b/npm/lib/node-shim.ts index a4f74d8363f..076f0beb168 100644 --- a/npm/lib/node-shim.ts +++ b/npm/lib/node-shim.ts @@ -1,8 +1,14 @@ #!/usr/bin/env node +/* Adapted from github.com/evanw/esbuild +MIT License +Copyright (c) 2020 Evan Wallace +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ -import { generateBinPath } from "./node-platform"; +import { generateBinPath } from './node-platform'; const { binPath } = generateBinPath(); -require("child_process").execFileSync(binPath, process.argv.slice(2), { - stdio: "inherit", +require('child_process').execFileSync(binPath, process.argv.slice(2), { + stdio: 'inherit' }); diff --git a/npm/scripts/build-shim-package.mjs b/npm/scripts/build-shim-package.mjs index 8f8081a92ea..b01fb816160 100644 --- a/npm/scripts/build-shim-package.mjs +++ b/npm/scripts/build-shim-package.mjs @@ -1,5 +1,9 @@ -// Adapted from evanw/esbuild - +/* Adapted from github.com/evanw/esbuild +MIT License +Copyright (c) 2020 Evan Wallace +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ import path from 'path'; import fs from 'fs'; diff --git a/npm/scripts/bump-version.mjs b/npm/scripts/bump-version.mjs index cccc40bb0a5..8cc77352f95 100644 --- a/npm/scripts/bump-version.mjs +++ b/npm/scripts/bump-version.mjs @@ -1,4 +1,9 @@ -// Adapted from evanw/esbuild +/* Adapted from github.com/evanw/esbuild +MIT License +Copyright (c) 2020 Evan Wallace +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ import fs from 'fs'; function updateVersionPackageJSON(pathToPackageJSON) { diff --git a/src/workerd/io/compatibility-date.capnp b/src/workerd/io/compatibility-date.capnp index 014d082964c..bcb51c2a9c4 100644 --- a/src/workerd/io/compatibility-date.capnp +++ b/src/workerd/io/compatibility-date.capnp @@ -6,7 +6,7 @@ $import "/capnp/c++.capnp".namespace("workerd"); -const supportedCompatibilityDate :Text = "2022-09-20"; +const supportedCompatibilityDate :Text = "2022-09-26"; # Newest compatibility date that can safely be set using code compiled from this repo. Trying to # run a Worker with a newer compatibility date than this will fail. # From 594b8d1304b74e04ec7f7724d2cc17ed5d3244a2 Mon Sep 17 00:00:00 2001 From: Samuel Macleod Date: Mon, 26 Sep 2022 20:26:12 +0100 Subject: [PATCH 3/3] Address PR comments --- npm.sh => build-npm-package.sh | 9 ++++++++- npm/lib/node-install.ts | 14 ++++++++------ npm/lib/node-path.ts | 15 ++++++++------- npm/lib/node-platform.ts | 14 ++++++++------ npm/lib/node-shim.ts | 15 ++++++++------- npm/scripts/build-shim-package.mjs | 14 ++++++++------ npm/scripts/bump-version.mjs | 14 ++++++++------ npm/workerd-darwin-64/package.json | 6 +----- npm/workerd-darwin-arm64/package.json | 5 +---- npm/workerd-linux-64/package.json | 6 +----- npm/workerd-linux-arm64/package.json | 6 +----- npm/workerd/package.json | 15 ++++++--------- 12 files changed, 66 insertions(+), 67 deletions(-) rename npm.sh => build-npm-package.sh (94%) diff --git a/npm.sh b/build-npm-package.sh similarity index 94% rename from npm.sh rename to build-npm-package.sh index 55c05e894ce..3914b3afec2 100644 --- a/npm.sh +++ b/build-npm-package.sh @@ -2,6 +2,10 @@ # TODO(cleanup): Convert to bazel rules/GitHub Actions set -euo pipefail +if [ -z "${1-}" ]; then + echo "Please specify a command" + exit 1 +fi bazel build @capnp-cpp//src/capnp:capnp_tool export LATEST_COMPATIBILITY_DATE=$(bazel-bin/external/capnp-cpp/src/capnp/capnp_tool eval src/workerd/io/compatibility-date.capnp supportedCompatibilityDate) @@ -60,5 +64,8 @@ clean) rm -rf npm/workerd/bin rm -rf npm/workerd/lib ;; -*) ;; +*) + echo "Invalid command" + exit 1 + ;; esac diff --git a/npm/lib/node-install.ts b/npm/lib/node-install.ts index 53663524659..9c7ffd354ac 100644 --- a/npm/lib/node-install.ts +++ b/npm/lib/node-install.ts @@ -1,9 +1,11 @@ -/* Adapted from github.com/evanw/esbuild -MIT License -Copyright (c) 2020 Evan Wallace -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ +// Adapted from github.com/evanw/esbuild +// Original copyright and license: +// Copyright (c) 2020 Evan Wallace +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import { downloadedBinPath, pkgAndSubpathForCurrentPlatform diff --git a/npm/lib/node-path.ts b/npm/lib/node-path.ts index 3ec12a43d04..de058bbab6a 100644 --- a/npm/lib/node-path.ts +++ b/npm/lib/node-path.ts @@ -1,11 +1,12 @@ #!/usr/bin/env node -/* Adapted from github.com/evanw/esbuild -MIT License -Copyright (c) 2020 Evan Wallace -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ - +// Adapted from github.com/evanw/esbuild +// Original copyright and license: +// Copyright (c) 2020 Evan Wallace +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import { generateBinPath } from './node-platform'; const { binPath } = generateBinPath(); diff --git a/npm/lib/node-platform.ts b/npm/lib/node-platform.ts index 0b2e09999a8..df7ecdd58f7 100644 --- a/npm/lib/node-platform.ts +++ b/npm/lib/node-platform.ts @@ -1,9 +1,11 @@ -/* Adapted from github.com/evanw/esbuild -MIT License -Copyright (c) 2020 Evan Wallace -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ +// Adapted from github.com/evanw/esbuild +// Original copyright and license: +// Copyright (c) 2020 Evan Wallace +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import fs from 'fs'; import os from 'os'; import path from 'path'; diff --git a/npm/lib/node-shim.ts b/npm/lib/node-shim.ts index 076f0beb168..19c16e1a8f6 100644 --- a/npm/lib/node-shim.ts +++ b/npm/lib/node-shim.ts @@ -1,11 +1,12 @@ #!/usr/bin/env node -/* Adapted from github.com/evanw/esbuild -MIT License -Copyright (c) 2020 Evan Wallace -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ - +// Adapted from github.com/evanw/esbuild +// Original copyright and license: +// Copyright (c) 2020 Evan Wallace +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import { generateBinPath } from './node-platform'; const { binPath } = generateBinPath(); diff --git a/npm/scripts/build-shim-package.mjs b/npm/scripts/build-shim-package.mjs index b01fb816160..8c394e9920e 100644 --- a/npm/scripts/build-shim-package.mjs +++ b/npm/scripts/build-shim-package.mjs @@ -1,9 +1,11 @@ -/* Adapted from github.com/evanw/esbuild -MIT License -Copyright (c) 2020 Evan Wallace -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ +// Adapted from github.com/evanw/esbuild +// Original copyright and license: +// Copyright (c) 2020 Evan Wallace +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import path from 'path'; import fs from 'fs'; diff --git a/npm/scripts/bump-version.mjs b/npm/scripts/bump-version.mjs index 8cc77352f95..b8a9476e89e 100644 --- a/npm/scripts/bump-version.mjs +++ b/npm/scripts/bump-version.mjs @@ -1,9 +1,11 @@ -/* Adapted from github.com/evanw/esbuild -MIT License -Copyright (c) 2020 Evan Wallace -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ +// Adapted from github.com/evanw/esbuild +// Original copyright and license: +// Copyright (c) 2020 Evan Wallace +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import fs from 'fs'; function updateVersionPackageJSON(pathToPackageJSON) { diff --git a/npm/workerd-darwin-64/package.json b/npm/workerd-darwin-64/package.json index e404f0de452..dbfad44ca7d 100644 --- a/npm/workerd-darwin-64/package.json +++ b/npm/workerd-darwin-64/package.json @@ -4,7 +4,6 @@ "repository": "https://github.com/cloudflare/workerd", "license": "Apache-2.0", "preferUnplugged": false, - "private": true, "engines": { "node": ">=16" }, @@ -14,8 +13,5 @@ "cpu": [ "x64" ], - "publishConfig": { - "registry": "https://registry-gateway.cloudflare-ui.workers.dev" - }, - "version": "1.20220920.0" + "version": "1.20220926.0" } diff --git a/npm/workerd-darwin-arm64/package.json b/npm/workerd-darwin-arm64/package.json index 2e99b13f205..afc2457f940 100644 --- a/npm/workerd-darwin-arm64/package.json +++ b/npm/workerd-darwin-arm64/package.json @@ -13,8 +13,5 @@ "cpu": [ "arm64" ], - "publishConfig": { - "registry": "https://registry-gateway.cloudflare-ui.workers.dev" - }, - "version": "1.20220920.0" + "version": "1.20220926.0" } diff --git a/npm/workerd-linux-64/package.json b/npm/workerd-linux-64/package.json index bfa95bf5fd9..9a188c5827b 100644 --- a/npm/workerd-linux-64/package.json +++ b/npm/workerd-linux-64/package.json @@ -4,7 +4,6 @@ "repository": "https://github.com/cloudflare/workerd", "license": "Apache-2.0", "preferUnplugged": false, - "private": true, "engines": { "node": ">=16" }, @@ -14,8 +13,5 @@ "cpu": [ "x64" ], - "publishConfig": { - "registry": "https://registry-gateway.cloudflare-ui.workers.dev" - }, - "version": "1.20220920.0" + "version": "1.20220926.0" } diff --git a/npm/workerd-linux-arm64/package.json b/npm/workerd-linux-arm64/package.json index b21469a82b2..613200df61e 100644 --- a/npm/workerd-linux-arm64/package.json +++ b/npm/workerd-linux-arm64/package.json @@ -3,7 +3,6 @@ "description": "👷 workerd for Linux ARM 64-bit, Cloudflare's JavaScript/Wasm Runtime", "repository": "https://github.com/cloudflare/workerd", "license": "Apache-2.0", - "private": true, "preferUnplugged": false, "engines": { "node": ">=16" @@ -14,8 +13,5 @@ "cpu": [ "arm64" ], - "publishConfig": { - "registry": "https://registry-gateway.cloudflare-ui.workers.dev" - }, - "version": "1.20220920.0" + "version": "1.20220926.0" } diff --git a/npm/workerd/package.json b/npm/workerd/package.json index 9181654cce3..f162a90872a 100644 --- a/npm/workerd/package.json +++ b/npm/workerd/package.json @@ -1,6 +1,6 @@ { "name": "workerd", - "version": "1.20220920.0", + "version": "1.20220926.0", "description": "👷 workerd, Cloudflare's JavaScript/Wasm Runtime", "repository": "https://github.com/cloudflare/workerd", "scripts": {}, @@ -12,13 +12,10 @@ "workerd": "bin/workerd" }, "optionalDependencies": { - "@cloudflare/workerd-darwin-arm64": "1.20220920.0", - "@cloudflare/workerd-darwin-64": "1.20220920.0", - "@cloudflare/workerd-linux-arm64": "1.20220920.0", - "@cloudflare/workerd-linux-64": "1.20220920.0" + "@cloudflare/workerd-darwin-arm64": "1.20220926.0", + "@cloudflare/workerd-darwin-64": "1.20220926.0", + "@cloudflare/workerd-linux-arm64": "1.20220926.0", + "@cloudflare/workerd-linux-64": "1.20220926.0" }, - "license": "Apache-2.0", - "publishConfig": { - "registry": "https://registry-gateway.cloudflare-ui.workers.dev" - } + "license": "Apache-2.0" }