Skip to content

Commit

Permalink
Fix capitalization of Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
GregBrimble committed Feb 27, 2023
1 parent f7d49eb commit c907da9
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-old-node-error.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test old node.js version
name: Test old Node.js version

on: pull_request

Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/bin/wrangler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function runWrangler() {
// Note Volta and nvm are also recommended in the official docs:
// https://developers.cloudflare.com/workers/get-started/guide#2-install-the-workers-cli
console.error(
`Wrangler requires at least node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of node.js.
`Wrangler requires at least Node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of Node.js.
Consider using a Node.js version manager such as https://volta.sh/ or https://github.com/nvm-sh/nvm.`
);
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/__tests__/dev.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ describe("wrangler dev", () => {
--experimental-local Run on my machine using the Cloudflare Workers runtime [boolean] [default: false]
--experimental-local-remote-kv Read/write KV data from/to real namespaces on the Cloudflare network [boolean] [default: false]
--minify Minify the script [boolean]
--node-compat Enable node.js compatibility [boolean]
--node-compat Enable Node.js compatibility [boolean]
--persist Enable persistence for local mode, using default path: .wrangler/state [boolean]
--persist-to Specify directory to use for local persistence (implies --persist) [string]
--live-reload Auto reload HTML pages when change is detected in local mode [boolean]
Expand Down
8 changes: 4 additions & 4 deletions packages/wrangler/src/__tests__/publish.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6658,7 +6658,7 @@ export default{
"err": "",
"out": "Total Upload: xx KiB / gzip: xx KiB
--dry-run: exiting now.",
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mEnabling node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.[0m
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mEnabling Node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.[0m
",
}
Expand Down Expand Up @@ -6705,7 +6705,7 @@ export default{
"err": "",
"out": "Total Upload: xx KiB / gzip: xx KiB
--dry-run: exiting now.",
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mEnabling node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.[0m
"warn": "[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mEnabling Node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.[0m
",
}
Expand Down Expand Up @@ -7125,7 +7125,7 @@ export default{
"publish index.js --no-bundle --node-compat --dry-run --outdir dist"
);
expect(std.warn).toMatchInlineSnapshot(`
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mEnabling node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.[0m
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mEnabling Node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.[0m
▲ [WARNING] \`--node-compat\` and \`--no-bundle\` can't be used together. If you want to polyfill Node.js built-ins and disable Wrangler's bundling, please polyfill as part of your own bundling process.
Expand All @@ -7145,7 +7145,7 @@ export default{
fs.writeFileSync("index.js", scriptContent);
await runWrangler("publish index.js --dry-run --outdir dist");
expect(std.warn).toMatchInlineSnapshot(`
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mEnabling node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.[0m
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mEnabling Node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.[0m
▲ [WARNING] \`--node-compat\` and \`--no-bundle\` can't be used together. If you want to polyfill Node.js built-ins and disable Wrangler's bundling, please polyfill as part of your own bundling process.
Expand Down
6 changes: 3 additions & 3 deletions packages/wrangler/src/__tests__/test-old-node-version.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// this test has to be run with a version of node.js older than 16.13 to pass
// this test has to be run with a version of Node.js older than 16.13 to pass

const { spawn } = require("child_process");
const path = require("path");
Expand All @@ -11,7 +11,7 @@ const wranglerProcess = spawn(
{ stdio: "pipe" }
);

const messageToMatch = "Wrangler requires at least node.js v16.13.0";
const messageToMatch = "Wrangler requires at least Node.js v16.13.0";

wranglerProcess.once("exit", (code) => {
try {
Expand All @@ -25,7 +25,7 @@ wranglerProcess.once("exit", (code) => {
} catch (err) {
console.error("Error:", err);
throw new Error(
"This test has to be run with a version of node.js under 16.13 to pass"
"This test has to be run with a version of Node.js under 16.13 to pass"
);
}
});
6 changes: 3 additions & 3 deletions packages/wrangler/src/api/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface UnstableDevOptions {
site?: string; // Root folder of static assets for Workers Sites
siteInclude?: string[]; // Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.
siteExclude?: string[]; // Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.
nodeCompat?: boolean; // Enable node.js compatibility
nodeCompat?: boolean; // Enable Node.js compatibility
compatibilityDate?: string; // Date to use for compatibility checks
compatibilityFlags?: string[]; // Flags to use for compatibility checks
persist?: boolean; // Enable persistence for local mode, using default path: .wrangler/state
Expand Down Expand Up @@ -163,7 +163,7 @@ export async function unstable_dev(
site: options?.site, // Root folder of static assets for Workers Sites
siteInclude: options?.siteInclude, // Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.
siteExclude: options?.siteExclude, // Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.
nodeCompat: options?.nodeCompat, // Enable node.js compatibility
nodeCompat: options?.nodeCompat, // Enable Node.js compatibility
persist: options?.persist, // Enable persistence for local mode, using default path: .wrangler/state
persistTo: options?.persistTo, // Specify directory to use for local persistence (implies --persist)
experimentalJsonConfig: undefined,
Expand Down Expand Up @@ -252,7 +252,7 @@ export async function unstable_dev(
site: options?.site, // Root folder of static assets for Workers Sites
siteInclude: options?.siteInclude, // Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.
siteExclude: options?.siteExclude, // Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.
nodeCompat: options?.nodeCompat, // Enable node.js compatibility
nodeCompat: options?.nodeCompat, // Enable Node.js compatibility
persist: options?.persist, // Enable persistence for local mode, using default path: .wrangler/state
persistTo: options?.persistTo, // Specify directory to use for local persistence (implies --persist)
experimentalJsonConfig: undefined,
Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export function devOptions(yargs: CommonYargsArgv) {
type: "boolean",
})
.option("node-compat", {
describe: "Enable node.js compatibility",
describe: "Enable Node.js compatibility",
type: "boolean",
})
.option("experimental-enable-local-persistence", {
Expand Down Expand Up @@ -745,7 +745,7 @@ async function validateDevServerSettings(
const nodeCompat = args.nodeCompat ?? config.node_compat;
if (nodeCompat) {
logger.warn(
"Enabling node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
"Enabling Node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/pages/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function Options(yargs: CommonYargsArgv) {
description: "The directory to output static assets to",
},
"node-compat": {
describe: "Enable node.js compatibility",
describe: "Enable Node.js compatibility",
default: false,
type: "boolean",
hidden: true,
Expand Down Expand Up @@ -120,7 +120,7 @@ export const Handler = async ({

if (nodeCompat) {
console.warn(
"Enabling node.js compatibility mode for builtins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
"Enabling Node.js compatibility mode for builtins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/wrangler/src/pages/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function Options(yargs: CommonYargsArgv) {
requiresArg: true,
},
"node-compat": {
describe: "Enable node.js compatibility",
describe: "Enable Node.js compatibility",
default: false,
type: "boolean",
hidden: true,
Expand Down Expand Up @@ -315,7 +315,7 @@ export const Handler = async ({

if (nodeCompat) {
console.warn(
"Enabling node.js compatibility mode for builtins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
"Enabling Node.js compatibility mode for builtins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function readableRelative(to: string) {
declare const __RELATIVE_PACKAGE_PATH__: string;

/**
* Use this function (rather than node.js constants like `__dirname`) to specify
* Use this function (rather than Node.js constants like `__dirname`) to specify
* paths that are relative to the base path of the Wrangler package.
*
* It is important to use this function because it reliably maps to the root of the package
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/publish/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export function publishOptions(yargs: CommonYargsArgv) {
type: "boolean",
})
.option("node-compat", {
describe: "Enable node.js compatibility",
describe: "Enable Node.js compatibility",
type: "boolean",
})
.option("dry-run", {
Expand Down
2 changes: 1 addition & 1 deletion packages/wrangler/src/publish/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
const nodeCompat = props.nodeCompat ?? config.node_compat;
if (nodeCompat) {
logger.warn(
"Enabling node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
"Enabling Node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details."
);
}

Expand Down

0 comments on commit c907da9

Please sign in to comment.