Repository: sveltejs/kit
Pull request #4921 (2022-05-14 04:32:13)

[docs] setting Node version in `adapter-netlify`
I tested running Node 16 on Netlify (see https://github.com/sveltejs/kit/issues/4916) and it works with the following caveat

changeset-bot[bot]: ###  ⚠️  No Changeset found

Latest commit: 26b463be808fb127297c7eda202d062ca685e1ed

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. **If these changes should result in a version bump, you need to add a changeset.**

<details><summary>This PR includes no changesets</summary>

  When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

</details>

[Click here to learn what changesets are, and how to add one](https://github.com/changesets/changesets/blob/master/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add a changeset to this PR](https://github.com/sveltejs/kit/new/benmccann-patch-1?filename=.changeset/empty-hats-sleep.md&value=---%0A%22%40sveltejs%2Fadapter-netlify%22%3A%20patch%0A---%0A%0A%5Bdocs%5D%20setting%20Node%20version%20in%20%60adapter-netlify%60%0A)



Patch:
diff --git a/.changeset/honest-rats-double.md b/.changeset/honest-rats-double.md
new file mode 100644
index 000000000..db9ce8583
--- /dev/null
+++ b/.changeset/honest-rats-double.md
@@ -0,0 +1,5 @@
+---
+"@sveltejs/adapter-netlify": patch
+---
+
+[docs] explain how to change node version
diff --git a/packages/adapter-netlify/README.md b/packages/adapter-netlify/README.md
index 75897126f..681a0ba65 100644
--- a/packages/adapter-netlify/README.md
+++ b/packages/adapter-netlify/README.md
@@ -42,6 +42,10 @@ Then, make sure you have a [netlify.toml](https://docs.netlify.com/configure-bui
 
 If the `netlify.toml` file or the `build.publish` value is missing, a default value of `"build"` will be used. Note that if you have set the publish directory in the Netlify UI to something else then you will need to set it in `netlify.toml` too, or use the default value of `"build"`.
 
+### Node version
+
+New projects will use Node 16 by default. However, if you're upgrading a project you created a while ago it may be stuck on an older version. See [the Netlify docs](https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript) for details on manually specifying Node 16 or newer.
+
 ## Netlify Edge Functions (beta)
 
 SvelteKit supports the beta release of Netlify Edge Functions. If you pass the option `edge: true` to the `adapter` function, server-side rendering will happen in a Deno-based edge function that's deployed close to the site visitor. If set to `false` (the default), the site will deploy to standard Node-based Netlify Functions.
diff --git a/packages/adapter-vercel/README.md b/packages/adapter-vercel/README.md
index 34a0999fb..7095c12b7 100644
--- a/packages/adapter-vercel/README.md
+++ b/packages/adapter-vercel/README.md
@@ -6,7 +6,7 @@ If you're using [adapter-auto](../adapter-auto), you don't need to install this
 
 ## Usage
 
-> The `edge` and `split` options depend on the Vercel Build Output API which is currently in beta. For now, you must opt in by visiting `https://vercel.com/svelte/[YOUR_PROJECT]/settings/environment-variables` and adding `ENABLE_VC_BUILD` with the value `1`.
+> The `edge` and `split` options depend on the Vercel Build Output API which is currently in beta. For now, you must opt in by visiting `https://vercel.com/[YOUR_USERNAME]/[YOUR_PROJECT]/settings/environment-variables` and adding `ENABLE_VC_BUILD` with the value `1`.
 
 Add `"@sveltejs/adapter-vercel": "next"` to the `devDependencies` in your `package.json` and run `npm install`.
 
diff --git a/packages/kit/src/packaging/index.js b/packages/kit/src/packaging/index.js
index c525ca135..010774db9 100644
--- a/packages/kit/src/packaging/index.js
+++ b/packages/kit/src/packaging/index.js
@@ -109,6 +109,7 @@ export async function watch(config, cwd = process.cwd()) {
 	let timeout;
 
 	const watcher = chokidar.watch(lib, { ignoreInitial: true });
+	const ready = new Promise((resolve) => watcher.on('ready', resolve));
 
 	watcher.on('all', async (type, path) => {
 		const file = analyze(config, relative(lib, path));
@@ -176,6 +177,7 @@ export async function watch(config, cwd = process.cwd()) {
 
 	return {
 		watcher,
+		ready,
 		settled: () =>
 			new Promise((fulfil, reject) => {
 				fulfillers.push(fulfil);


Test patch:
diff --git a/packages/kit/src/packaging/test/index.js b/packages/kit/src/packaging/test/index.js
index ebefaef98..3c818f22b 100644
--- a/packages/kit/src/packaging/test/index.js
+++ b/packages/kit/src/packaging/test/index.js
@@ -154,7 +154,7 @@ if (!process.env.CI) {
 		const config = await load_config({ cwd });
 		config.kit.package.dir = resolve(cwd, config.kit.package.dir);
 
-		const { watcher, settled } = await watch(config, cwd);
+		const { watcher, ready, settled } = await watch(config, cwd);
 
 		/** @param {string} file */
 		function compare(file) {
@@ -181,6 +181,8 @@ if (!process.env.CI) {
 		}
 
 		try {
+			await ready;
+
 			// completes initial build
 			compare('index.js');
 
diff --git a/packages/kit/src/packaging/test/watch/tsconfig.json b/packages/kit/src/packaging/test/watch/tsconfig.json
index bcc299cd9..44dca20d0 100644
--- a/packages/kit/src/packaging/test/watch/tsconfig.json
+++ b/packages/kit/src/packaging/test/watch/tsconfig.json
@@ -1,6 +1,7 @@
 {
 	"compilerOptions": {
 		"allowJs": true,
-		"checkJs": true
+		"checkJs": true,
+		"newLine": "lf"
 	}
 }