Skip to content

Commit

Permalink
Merge branch 'main' into fix/pin-nft
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstork authored Dec 13, 2024
2 parents 9c8fd77 + 131a644 commit ed1f009
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions packages/config/docs/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ Most Netlify CLI commands rely on configuration properties. The base command loa
[using `@netlify/config` programmatically](https://github.com/netlify/cli/blob/f87d9e6e1749bedaabaace3dae98ca1ed6d84fd6/src/commands/base-command.js#L474).

An `inlineConfig` flag was added to `@netlify/config` so Netlify CLI can override specific configuration properties
based on its own CLI flags, but this is not used yet (see https://github.com/netlify/cli/issues/1265,
https://github.com/netlify/cli/issues/960, https://github.com/netlify/cli/issues/961).
based on its own CLI flags, but this is not used yet (see <https://github.com/netlify/cli/issues/1265>,
<https://github.com/netlify/cli/issues/960>, <https://github.com/netlify/cli/issues/961>).

We try to
[emulate the same environment variables](https://github.com/netlify/build/blob/558fe8869f47ecc84d05bd4d26d32df00f47a3b9/packages/config/src/env/main.js#L13)
Expand Down Expand Up @@ -150,11 +150,10 @@ Redirects configuration is more complicated:
- It can be specified either in `netlify.toml` or in a separate `_redirects` file located in the publish directory and
with its own Netlify-specific file format

Therefore, that logic is abstracted to
[its own module `netlify-redirect-parser`](https://github.com/netlify/netlify-redirect-parser).
Therefore, that logic is abstracted to [its own module `@netlify/redirect-parser`](../../redirect-parser).

Headers are handled very similarly to redirects, for consistency. They use a separate `_headers` file
[and `netlify-headers-parser` module](https://github.com/netlify/netlify-headers-parser).
[and `@netlify/headers-parser` module](../../headers-parser).

## Context-specific configuration

Expand Down
4 changes: 2 additions & 2 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"js-yaml": "^4.0.0",
"map-obj": "^5.0.0",
"netlify": "^13.2.0",
"netlify-headers-parser": "^7.2.0",
"netlify-redirect-parser": "^14.4.0",
"@netlify/headers-parser": "^7.2.0",
"@netlify/redirect-parser": "^14.4.0",
"node-fetch": "^3.3.1",
"omit.js": "^2.0.2",
"p-locate": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/headers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { resolve } from 'path'

import { parseAllHeaders } from 'netlify-headers-parser'
import { parseAllHeaders } from '@netlify/headers-parser'

import { warnHeadersParsing, warnHeadersCaseSensitivity } from './log/messages.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/redirects.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { resolve } from 'path'

import { parseAllRedirects } from 'netlify-redirect-parser'
import { parseAllRedirects } from '@netlify/redirect-parser'

import { warnRedirectsParsing } from './log/messages.js'

Expand Down
13 changes: 7 additions & 6 deletions packages/functions-utils/tests/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { rm } from 'fs/promises'
import { readFile, rm } from 'fs/promises'
import { normalize } from 'path'
import { fileURLToPath, pathToFileURL } from 'url'
import { fileURLToPath } from 'url'

import cpy from 'cpy'
import { pathExists } from 'path-exists'
Expand Down Expand Up @@ -77,21 +77,22 @@ test('Should copy a source file even if dist directory already exists', async ()
test('Should overwrite dist file if it already exists', async () => {
const dist = await getDist()
const fixtureDir = `${FIXTURES_DIR}/file`
const testModule = `${dist}/test.mjs`

await cpy(`${fixtureDir}/test.mjs`, fixtureDir, { rename: 'test.mjs.backup' })

try {
await add(`${fixtureDir}/test.mjs`, dist)

const { func1 } = await import(`${pathToFileURL(`${dist}/test.mjs`).href}?one`)
const file1 = await readFile(testModule, 'utf8')

await cpy(`${fixtureDir}/test_2.mjs`, fixtureDir, { rename: 'test.mjs' })
await add(`${fixtureDir}/test.mjs`, dist)

const { func2 } = await import(`${pathToFileURL(`${dist}/test.mjs`).href}?two`)
const file2 = await readFile(testModule, 'utf8')

expect(func1()).toBe('one')
expect(func2()).toBe('two')
expect(file1).toContain('one')
expect(file2).toContain('two')
} finally {
await cpy(`${fixtureDir}/test.mjs.backup`, fixtureDir, { rename: 'test.mjs' })
await rm(`${fixtureDir}/test.mjs.backup`, { force: true })
Expand Down
2 changes: 1 addition & 1 deletion packages/headers-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "netlify-headers-parser",
"name": "@netlify/headers-parser",
"version": "7.2.0",
"description": "Parses Netlify headers into a JavaScript object representation",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/redirect-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "netlify-redirect-parser",
"name": "@netlify/redirect-parser",
"version": "14.4.0",
"description": "Parses netlify redirects into a js object representation",
"type": "module",
Expand Down

0 comments on commit ed1f009

Please sign in to comment.