Conversation
| @@ -0,0 +1,303 @@ | |||
| <!DOCTYPE html> | |||
There was a problem hiding this comment.
Copied as is from the CLI.
| import { fileURLToPath } from 'node:url' | ||
|
|
||
| const templatesPath = dirname(fileURLToPath(import.meta.url)) | ||
| const functionErrorTemplatePath = resolve(templatesPath, '../src/templates/function-error.html') |
There was a problem hiding this comment.
This file was copied from the CLI. The only change I made was to hardcode the path to the function error template, as opposed to accepting it as an argument of renderFunctionErrorPage, as I didn't see a reason for that.
| } | ||
|
|
||
| async start(port = 0) { | ||
| if (this.url) { |
There was a problem hiding this comment.
Small change to make it possible to call start() multiple times without us starting multiple servers.
| @@ -0,0 +1,3 @@ | |||
| import { ulid } from 'ulid' | |||
There was a problem hiding this comment.
Copied as is from the CLI.
|
|
||
| private async handleInEphemeralDirectory(request: Request, destPath: string) { | ||
| // Functions | ||
| const userFunctionsPath = |
There was a problem hiding this comment.
I moved the initialisation of the handlers to the start() method so that we only have one instance of each handler per NetlifyDev instance.
packages/dev/src/main.ts
Outdated
| } | ||
|
|
||
| this.#edgeFunctionsHandler = new EdgeFunctionsHandler({ | ||
| bootstrapURL: 'https://edge.netlify.com/bootstrap/index-combined.ts', |
There was a problem hiding this comment.
It doesn't make sense to have this here. This needs to point to a specific version of the bootstrap, which is what the existing @netlify/edge-functions package (published from the bootstrap repo) does. We'll need to figure out a different setup here. For consistency, I've used @netlify/edge-functions for the new package in this monorepo, so perhaps we need to start publishing something like @netlify/edge-functions-bootstrap from the bootstrap repo and we add it as a dependency here.
| @@ -0,0 +1,68 @@ | |||
| type Cache = 'off' | 'manual' | |||
There was a problem hiding this comment.
This file was copied as is from the bootstrap repo.
| matrix: | ||
| os: [ubuntu-latest, macOS-latest, windows-latest] | ||
| node-version: ['*'] | ||
| deno-version: ['v1.37.0', 'v1.44.4'] |
There was a problem hiding this comment.
I don't think we need to test with multiple versions of Deno.
| } | ||
|
|
||
| if (this.#features.headers) { | ||
| this.#headersHandler = new HeadersHandler({ |
There was a problem hiding this comment.
@serhalp FYI, I moved the initialisation of all the handlers here, so I did the same to HeadersHandler.
Co-authored-by: Philippe Serhal <philippe.serhal@netlify.com>
|
|
||
| const packagesPath = path.join(__dirname, 'packages') | ||
| const packages = await fs.readdir(packagesPath) | ||
| const packageIgnores = packages.map((name) => includeIgnoreFile(path.resolve(packagesPath, name, '.gitignore'))) |
There was a problem hiding this comment.
This is awkward. As I mentioned to @serhalp, I think we should have each package defining its own lint step with its own ignore rules, etc.
|
|
||
| export type Geolocation = Context['geo'] | ||
|
|
||
| export const mockLocation: Geolocation = { |
There was a problem hiding this comment.
We should incorporate the CLI logic that uses https://netlifind.netlify.app/ to provide a real geo-location object.
|
|
||
| try { | ||
| await denoBridge.runInBackground(['run', ...denoFlags, denoRunPath, JSON.stringify(runOptions)], processRef, { | ||
| await denoBridge.runInBackground(['eval', ...denoFlags, script], processRef, { |
There was a problem hiding this comment.
from https://netlify.slack.com/archives/C0359548J07/p1748542712027619?thread_ts=1748532679.718369&cid=C0359548J07 it seems like this approach didn't work?
| // Releasing version 1.2.3 of the `@netlify/edge-functions` module will | ||
| // make release-please create a GitHub release and corresponding tag of | ||
| // `v1.2.3`. Because the `edge` Netlify site is configured to build all | ||
| // branches, the tag will generate a `v1-2-3--edge.netlify.com` URL, | ||
| // which serves the bootstrap for this version. We're computing that | ||
| // URL here. | ||
| const branch = `v${version.split('.').join('-')}` |
There was a problem hiding this comment.
Never mind, I hadn't seen https://github.com/netlify/edge-functions-bootstrap/pull/423
Co-authored-by: Philippe Serhal <philippe.serhal@netlify.com>
- move non-temporary config out of `eslint_temporary_suppressions` - configure `node-builtins` rule properly
The new eslint setup was merged after most of the work on this PR was done.
No description provided.