workerd 0.20230228.2 → 0.20230404.1

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/bin/workerd CHANGED
@@ -31,15 +31,16 @@ var knownPackages = {
31
31
  "darwin x64 LE": "@cloudflare/workerd-darwin-64",
32
32
  "linux arm64 LE": "@cloudflare/workerd-linux-arm64",
33
33
  "linux x64 LE": "@cloudflare/workerd-linux-64",
34
- "win32 x64 LE": "@cloudflare/workerd-linux-64"
34
+ "win32 x64 LE": "@cloudflare/workerd-windows-64"
35
35
  };
36
+ var maybeExeExtension = process.platform === "win32" ? ".exe" : "";
36
37
  function pkgAndSubpathForCurrentPlatform() {
37
38
  let pkg;
38
39
  let subpath;
39
40
  let platformKey = `${process.platform} ${import_os.default.arch()} ${import_os.default.endianness()}`;
40
41
  if (platformKey in knownPackages) {
41
42
  pkg = knownPackages[platformKey];
42
- subpath = "bin/workerd";
43
+ subpath = `bin/workerd${maybeExeExtension}`;
43
44
  } else {
44
45
  throw new Error(`Unsupported platform: ${platformKey}`);
45
46
  }
@@ -64,7 +65,7 @@ function pkgForSomeOtherPlatform() {
64
65
  }
65
66
  function downloadedBinPath(pkg, subpath) {
66
67
  const libDir = import_path.default.dirname(require.resolve("workerd"));
67
- return import_path.default.join(libDir, `downloaded-${pkg.replace("/", "-")}-${import_path.default.basename(subpath)}`);
68
+ return import_path.default.join(libDir, `downloaded-${pkg.replace("/", "-")}-${import_path.default.basename(subpath)}${maybeExeExtension}`);
68
69
  }
69
70
  function generateBinPath() {
70
71
  const { pkg, subpath } = pkgAndSubpathForCurrentPlatform();
@@ -122,7 +123,7 @@ by workerd to install the correct binary executable for your current platform.`)
122
123
  "node_modules",
123
124
  ".cache",
124
125
  "workerd",
125
- `pnpapi-${pkg.replace("/", "-")}-${"0.20230228.2"}-${import_path.default.basename(subpath)}`
126
+ `pnpapi-${pkg.replace("/", "-")}-${"0.20230404.1"}-${import_path.default.basename(subpath)}`
126
127
  );
127
128
  if (!import_fs.default.existsSync(binTargetPath)) {
128
129
  import_fs.default.mkdirSync(import_path.default.dirname(binTargetPath), { recursive: true });
package/install.js CHANGED
@@ -29,15 +29,16 @@ var knownPackages = {
29
29
  "darwin x64 LE": "@cloudflare/workerd-darwin-64",
30
30
  "linux arm64 LE": "@cloudflare/workerd-linux-arm64",
31
31
  "linux x64 LE": "@cloudflare/workerd-linux-64",
32
- "win32 x64 LE": "@cloudflare/workerd-linux-64"
32
+ "win32 x64 LE": "@cloudflare/workerd-windows-64"
33
33
  };
34
+ var maybeExeExtension = process.platform === "win32" ? ".exe" : "";
34
35
  function pkgAndSubpathForCurrentPlatform() {
35
36
  let pkg;
36
37
  let subpath;
37
38
  let platformKey = `${process.platform} ${import_os.default.arch()} ${import_os.default.endianness()}`;
38
39
  if (platformKey in knownPackages) {
39
40
  pkg = knownPackages[platformKey];
40
- subpath = "bin/workerd";
41
+ subpath = `bin/workerd${maybeExeExtension}`;
41
42
  } else {
42
43
  throw new Error(`Unsupported platform: ${platformKey}`);
43
44
  }
@@ -45,11 +46,12 @@ function pkgAndSubpathForCurrentPlatform() {
45
46
  }
46
47
  function downloadedBinPath(pkg, subpath) {
47
48
  const libDir = import_path.default.dirname(require.resolve("workerd"));
48
- return import_path.default.join(libDir, `downloaded-${pkg.replace("/", "-")}-${import_path.default.basename(subpath)}`);
49
+ return import_path.default.join(libDir, `downloaded-${pkg.replace("/", "-")}-${import_path.default.basename(subpath)}${maybeExeExtension}`);
49
50
  }
50
51
 
51
52
  // npm/lib/node-install.ts
52
53
  var import_fs = __toESM(require("fs"));
54
+ var import_os2 = __toESM(require("os"));
53
55
  var import_path2 = __toESM(require("path"));
54
56
  var import_zlib = __toESM(require("zlib"));
55
57
  var import_https = __toESM(require("https"));
@@ -72,10 +74,10 @@ function validateBinaryVersion(...command) {
72
74
  //
73
75
  stdio: "pipe"
74
76
  }).toString().trim();
75
- if (stdout !== `workerd ${"2023-02-28"}`) {
77
+ if (stdout !== `workerd ${"2023-04-04"}`) {
76
78
  throw new Error(
77
79
  `Expected ${JSON.stringify(
78
- "2023-02-28"
80
+ "2023-04-04"
79
81
  )} but got ${JSON.stringify(stdout)}`
80
82
  );
81
83
  }
@@ -131,7 +133,7 @@ function installUsingNPM(pkg, subpath, binPath) {
131
133
  try {
132
134
  import_fs.default.writeFileSync(import_path2.default.join(installDir, "package.json"), "{}");
133
135
  import_child_process.default.execSync(
134
- `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.20230228.2"}`,
136
+ `npm install --loglevel=error --prefer-offline --no-audit --progress=false ${pkg}@${"0.20230404.1"}`,
135
137
  { cwd: installDir, stdio: "pipe", env }
136
138
  );
137
139
  const installedBinPath = import_path2.default.join(
@@ -165,7 +167,7 @@ function removeRecursive(dir) {
165
167
  import_fs.default.rmdirSync(dir);
166
168
  }
167
169
  function maybeOptimizePackage(binPath) {
168
- if (!isYarn()) {
170
+ if (import_os2.default.platform() !== "win32" && !isYarn()) {
169
171
  const tempPath = import_path2.default.join(__dirname, "bin-workerd");
170
172
  try {
171
173
  import_fs.default.linkSync(binPath, tempPath);
@@ -178,7 +180,7 @@ function maybeOptimizePackage(binPath) {
178
180
  }
179
181
  async function downloadDirectlyFromNPM(pkg, subpath, binPath) {
180
182
  const unscopedPkg = pkg.substring(pkg.indexOf("/") + 1);
181
- const url = `https://registry.npmjs.org/${pkg}/-/${unscopedPkg}-${"0.20230228.2"}.tgz`;
183
+ const url = `https://registry.npmjs.org/${pkg}/-/${unscopedPkg}-${"0.20230404.1"}.tgz`;
182
184
  console.error(`[workerd] Trying to download ${JSON.stringify(url)}`);
183
185
  try {
184
186
  import_fs.default.writeFileSync(
@@ -224,11 +226,9 @@ this. If that fails, you need to remove the "--no-optional" flag to use workerd.
224
226
  maybeOptimizePackage(binPath);
225
227
  }
226
228
  checkAndPreparePackage().then(() => {
227
- if (process.platform !== "win32") {
228
- if (isToPathJS) {
229
- validateBinaryVersion(process.execPath, toPath);
230
- } else {
231
- validateBinaryVersion(toPath);
232
- }
229
+ if (isToPathJS) {
230
+ validateBinaryVersion(process.execPath, toPath);
231
+ } else {
232
+ validateBinaryVersion(toPath);
233
233
  }
234
234
  });
package/lib/main.js CHANGED
@@ -45,15 +45,16 @@ var knownPackages = {
45
45
  "darwin x64 LE": "@cloudflare/workerd-darwin-64",
46
46
  "linux arm64 LE": "@cloudflare/workerd-linux-arm64",
47
47
  "linux x64 LE": "@cloudflare/workerd-linux-64",
48
- "win32 x64 LE": "@cloudflare/workerd-linux-64"
48
+ "win32 x64 LE": "@cloudflare/workerd-windows-64"
49
49
  };
50
+ var maybeExeExtension = process.platform === "win32" ? ".exe" : "";
50
51
  function pkgAndSubpathForCurrentPlatform() {
51
52
  let pkg;
52
53
  let subpath;
53
54
  let platformKey = `${process.platform} ${import_os.default.arch()} ${import_os.default.endianness()}`;
54
55
  if (platformKey in knownPackages) {
55
56
  pkg = knownPackages[platformKey];
56
- subpath = "bin/workerd";
57
+ subpath = `bin/workerd${maybeExeExtension}`;
57
58
  } else {
58
59
  throw new Error(`Unsupported platform: ${platformKey}`);
59
60
  }
@@ -78,7 +79,7 @@ function pkgForSomeOtherPlatform() {
78
79
  }
79
80
  function downloadedBinPath(pkg, subpath) {
80
81
  const libDir = import_path.default.dirname(require.resolve("workerd"));
81
- return import_path.default.join(libDir, `downloaded-${pkg.replace("/", "-")}-${import_path.default.basename(subpath)}`);
82
+ return import_path.default.join(libDir, `downloaded-${pkg.replace("/", "-")}-${import_path.default.basename(subpath)}${maybeExeExtension}`);
82
83
  }
83
84
  function generateBinPath() {
84
85
  const { pkg, subpath } = pkgAndSubpathForCurrentPlatform();
@@ -136,7 +137,7 @@ by workerd to install the correct binary executable for your current platform.`)
136
137
  "node_modules",
137
138
  ".cache",
138
139
  "workerd",
139
- `pnpapi-${pkg.replace("/", "-")}-${"0.20230228.2"}-${import_path.default.basename(subpath)}`
140
+ `pnpapi-${pkg.replace("/", "-")}-${"0.20230404.1"}-${import_path.default.basename(subpath)}`
140
141
  );
141
142
  if (!import_fs.default.existsSync(binTargetPath)) {
142
143
  import_fs.default.mkdirSync(import_path.default.dirname(binTargetPath), { recursive: true });
@@ -151,8 +152,8 @@ by workerd to install the correct binary executable for your current platform.`)
151
152
  // npm/lib/node-path.ts
152
153
  var { binPath } = generateBinPath();
153
154
  var node_path_default = binPath;
154
- var compatibilityDate = "2023-02-28";
155
- var version = "0.20230228.2";
155
+ var compatibilityDate = "2023-04-04";
156
+ var version = "0.20230404.1";
156
157
  // Annotate the CommonJS export names for ESM import in node:
157
158
  0 && (module.exports = {
158
159
  compatibilityDate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workerd",
3
- "version": "0.20230228.2",
3
+ "version": "0.20230404.1",
4
4
  "description": "👷 workerd, Cloudflare's JavaScript/Wasm Runtime",
5
5
  "repository": "https://github.com/cloudflare/workerd",
6
6
  "scripts": {
@@ -14,10 +14,11 @@
14
14
  "workerd": "bin/workerd"
15
15
  },
16
16
  "optionalDependencies": {
17
- "@cloudflare/workerd-darwin-arm64": "0.20230228.2",
18
- "@cloudflare/workerd-darwin-64": "0.20230228.2",
19
- "@cloudflare/workerd-linux-arm64": "0.20230228.2",
20
- "@cloudflare/workerd-linux-64": "0.20230228.2"
17
+ "@cloudflare/workerd-darwin-arm64": "0.20230404.1",
18
+ "@cloudflare/workerd-darwin-64": "0.20230404.1",
19
+ "@cloudflare/workerd-linux-arm64": "0.20230404.1",
20
+ "@cloudflare/workerd-linux-64": "0.20230404.1",
21
+ "@cloudflare/workerd-windows-64": "0.20230404.1"
21
22
  },
22
23
  "license": "Apache-2.0"
23
24
  }