Skip to content

Commit ec16aac

Browse files
renovate[bot]danez
andauthored
fix(deps): update dependency tempy to v3 (#5389)
* fix(deps): update dependency tempy to v3 * chore: update api --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Tschinder <[email protected]>
1 parent 055055a commit ec16aac

File tree

7 files changed

+113
-35
lines changed

7 files changed

+113
-35
lines changed

npm-shrinkwrap.json

+98-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
"string-similarity": "^4.0.4",
168168
"strip-ansi-control-characters": "^2.0.0",
169169
"tabtab": "^3.0.2",
170-
"tempy": "^1.0.0",
170+
"tempy": "^3.0.0",
171171
"terminal-link": "^2.1.1",
172172
"through2-filter": "^3.0.0",
173173
"through2-map": "^3.0.0",

src/lib/functions/runtimes/go/index.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { dirname, extname } from 'path'
33
import { platform } from 'process'
44

5-
import tempy from 'tempy'
5+
import { temporaryFile } from 'tempy'
66

77
import execa from '../../../../utils/execa.mjs'
88
import { runFunctionsProxy } from '../../local-proxy.mjs'
@@ -41,7 +41,7 @@ const checkGoInstallation = async ({ cwd }) => {
4141

4242
export const getBuildFunction = ({ func }) => {
4343
const functionDirectory = dirname(func.mainFile)
44-
const binaryPath = tempy.file(isWindows ? { extension: 'exe' } : undefined)
44+
const binaryPath = temporaryFile(isWindows ? { extension: 'exe' } : undefined)
4545

4646
return () => build({ binaryPath, functionDirectory })
4747
}

src/utils/deploy/deploy-site.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { rm } from 'fs/promises'
22

33
import cleanDeep from 'clean-deep'
4-
import tempy from 'tempy'
4+
import { temporaryDirectory } from 'tempy'
55

66
import { deployFileNormalizer, getDistPathIfExists, isEdgeFunctionFile } from '../../lib/edge-functions/deploy.mjs'
77
import { warn } from '../command-helpers.mjs'
@@ -45,7 +45,7 @@ export const deploySite = async (
4545
/* default to noop */
4646
},
4747
syncFileLimit = DEFAULT_SYNC_LIMIT,
48-
tmpDir = tempy.directory(),
48+
tmpDir = temporaryDirectory(),
4949
rootDir,
5050
} = {},
5151
) => {

tests/integration/500.command.dev.test.cjs

+6-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const avaTest = require('ava')
77
const { isCI } = require('ci-info')
88
const FormData = require('form-data')
99
const getPort = require('get-port')
10-
const tempy = require('tempy')
1110

1211
const { withDevServer } = require('./utils/dev-server.cjs')
1312
const got = require('./utils/got.cjs')
@@ -395,7 +394,9 @@ test('Runs build plugins with the `onPreDev` event', async (t) => {
395394
},
396395
};
397396
`
398-
const pluginDirectory = await tempy.directory()
397+
398+
const { temporaryDirectory } = await import('tempy')
399+
const pluginDirectory = await temporaryDirectory()
399400

400401
await fs.writeFile(path.join(pluginDirectory, 'manifest.yml'), pluginManifest)
401402
await fs.writeFile(path.join(pluginDirectory, 'index.js'), pluginSource)
@@ -440,7 +441,9 @@ test('Handles errors from the `onPreDev` event', async (t) => {
440441
},
441442
};
442443
`
443-
const pluginDirectory = await tempy.directory()
444+
445+
const { temporaryDirectory } = await import('tempy')
446+
const pluginDirectory = await temporaryDirectory()
444447

445448
await fs.writeFile(path.join(pluginDirectory, 'manifest.yml'), pluginManifest)
446449
await fs.writeFile(path.join(pluginDirectory, 'index.js'), pluginSource)

tests/integration/utils/mock-execa.cjs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
const { rm, writeFile } = require('fs').promises
22
const { pathToFileURL } = require('url')
33

4-
const tempy = require('tempy')
5-
64
// Saves to disk a JavaScript file with the contents provided and returns
75
// an environment variable that replaces the `execa` module implementation.
86
// A cleanup method is also returned, allowing the consumer to remove the
97
// mock file.
108
const createMock = async (contents) => {
11-
const path = tempy.file({ extension: 'js' })
9+
const { temporaryFile } = await import('tempy')
10+
const path = temporaryFile({ extension: 'js' })
1211

1312
await writeFile(path, contents)
1413

tests/unit/utils/deploy/hash-fns.test.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import tempy from 'tempy'
1+
import { temporaryDirectory } from 'tempy'
22
import { expect, test } from 'vitest'
33

44
import { DEFAULT_CONCURRENT_HASH } from '../../../../src/utils/deploy/constants.mjs'
@@ -21,7 +21,7 @@ test('Hashes files in a folder', async () => {
2121

2222
const expectedFunctions = ['hello', 'goodbye']
2323
const { fnShaMap, functions } = await hashFns(`${builder.directory}/functions`, {
24-
tmpDir: tempy.directory(),
24+
tmpDir: temporaryDirectory(),
2525
concurrentHash: DEFAULT_CONCURRENT_HASH,
2626
statusCb() {},
2727
})

0 commit comments

Comments
 (0)