Skip to content

Commit 4816b70

Browse files
feat: update edge functions bundling to Deno 2.x (#6716)
1 parent 8b061d4 commit 4816b70

File tree

18 files changed

+379
-385
lines changed

18 files changed

+379
-385
lines changed

.github/workflows/workflow.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,12 @@ jobs:
5454
os: [ubuntu-24.04, macos-14, windows-2025]
5555
node-version: ['22']
5656
# Must include the minimum deno version from the `DENO_VERSION_RANGE` constant in `node/bridge.ts`.
57-
# We're adding v2.4.2 here because it's needed for the upcoming nimble release, so we can test
58-
# those workflows ahead of time before we can update the base version across the board.
59-
deno-version: ['v1.39.0', 'v2.2.4', 'v2.4.2']
57+
deno-version: ['v2.4.2']
6058
include:
6159
- os: ubuntu-24.04
6260
# Earliest supported version
6361
node-version: '18.14.0'
64-
deno-version: 'v2.2.4'
62+
deno-version: 'v2.4.2'
6563
fail-fast: false
6664
steps:
6765
# Sets an output parameter if this is a release PR
@@ -159,7 +157,7 @@ jobs:
159157
- name: Setup Deno
160158
uses: denoland/setup-deno@v1
161159
with:
162-
deno-version: v2.2.4
160+
deno-version: v2.4.2
163161
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
164162
- name: Node.js ${{ matrix.node-version }}
165163
uses: actions/setup-node@v5

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default tseslint.config(
7878

7979
// Project-specific rules
8080
{
81-
ignores: ['packages/**/dist', 'packages/**/lib'],
81+
ignores: ['packages/**/dist', 'packages/**/lib', 'packages/edge-bundler/deno/**'],
8282
},
8383
{
8484
files: ['**/*.?(c|m)ts?(x)'],

eslint_temporary_suppressions.js

Lines changed: 0 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,266 +1707,6 @@ export default [
17071707
'@typescript-eslint/no-explicit-any': 'off',
17081708
},
17091709
},
1710-
{
1711-
files: ['packages/edge-bundler/deno/bundle.ts'],
1712-
rules: {
1713-
'@typescript-eslint/no-unsafe-assignment': 'off',
1714-
'@typescript-eslint/no-unsafe-member-access': 'off',
1715-
'@typescript-eslint/no-unsafe-argument': 'off',
1716-
},
1717-
},
1718-
{
1719-
files: ['packages/edge-bundler/deno/config.ts'],
1720-
rules: {
1721-
'n/no-missing-import': 'off',
1722-
'@typescript-eslint/no-unsafe-assignment': 'off',
1723-
'@typescript-eslint/no-unsafe-member-access': 'off',
1724-
'@typescript-eslint/no-unsafe-argument': 'off',
1725-
'@typescript-eslint/no-unsafe-call': 'off',
1726-
},
1727-
},
1728-
{
1729-
files: ['packages/edge-bundler/deno/vendor/deno.land/[email protected]/_util/os.ts'],
1730-
rules: {
1731-
'@typescript-eslint/no-unsafe-assignment': 'off',
1732-
'@typescript-eslint/no-explicit-any': 'off',
1733-
'@typescript-eslint/no-unsafe-member-access': 'off',
1734-
'@typescript-eslint/no-unsafe-return': 'off',
1735-
'n/no-unsupported-features/node-builtins': 'off',
1736-
'@typescript-eslint/no-unsafe-call': 'off',
1737-
},
1738-
},
1739-
{
1740-
files: ['packages/edge-bundler/deno/vendor/deno.land/[email protected]/path/_util.ts'],
1741-
rules: {
1742-
'@typescript-eslint/no-non-null-assertion': 'off',
1743-
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
1744-
'@typescript-eslint/prefer-nullish-coalescing': 'off',
1745-
},
1746-
},
1747-
{
1748-
files: ['packages/edge-bundler/deno/vendor/deno.land/[email protected]/path/glob.ts'],
1749-
rules: {
1750-
'@typescript-eslint/no-unnecessary-condition': 'off',
1751-
'@typescript-eslint/no-non-null-assertion': 'off',
1752-
},
1753-
},
1754-
{
1755-
files: ['packages/edge-bundler/deno/vendor/deno.land/[email protected]/path/posix.ts'],
1756-
rules: {
1757-
'@typescript-eslint/no-unsafe-assignment': 'off',
1758-
'@typescript-eslint/no-explicit-any': 'off',
1759-
'@typescript-eslint/no-unsafe-member-access': 'off',
1760-
'@typescript-eslint/no-unsafe-call': 'off',
1761-
'@typescript-eslint/no-unnecessary-condition': 'off',
1762-
},
1763-
},
1764-
{
1765-
files: ['packages/edge-bundler/deno/vendor/deno.land/[email protected]/path/win32.ts'],
1766-
rules: {
1767-
'@typescript-eslint/no-unsafe-assignment': 'off',
1768-
'@typescript-eslint/no-explicit-any': 'off',
1769-
'@typescript-eslint/no-unsafe-member-access': 'off',
1770-
'@typescript-eslint/no-unsafe-call': 'off',
1771-
'@typescript-eslint/no-unnecessary-condition': 'off',
1772-
'@typescript-eslint/no-non-null-assertion': 'off',
1773-
'@typescript-eslint/prefer-regexp-exec': 'off',
1774-
},
1775-
},
1776-
{
1777-
files: ['packages/edge-bundler/deno/vendor/deno.land/[email protected]/async/deferred.ts'],
1778-
rules: {
1779-
'@typescript-eslint/no-explicit-any': 'off',
1780-
},
1781-
},
1782-
{
1783-
files: ['packages/edge-bundler/deno/vendor/deno.land/[email protected]/async/mux_async_iterator.ts'],
1784-
rules: {
1785-
'@typescript-eslint/no-explicit-any': 'off',
1786-
'@typescript-eslint/no-floating-promises': 'off',
1787-
'@typescript-eslint/no-unsafe-assignment': 'off',
1788-
'@typescript-eslint/prefer-for-of': 'off',
1789-
},
1790-
},
1791-
{
1792-
files: ['packages/edge-bundler/deno/vendor/deno.land/[email protected]/async/pool.ts'],
1793-
rules: {
1794-
'n/no-unsupported-features/node-builtins': 'off',
1795-
'@typescript-eslint/no-floating-promises': 'off',
1796-
'@typescript-eslint/no-unsafe-argument': 'off',
1797-
},
1798-
},
1799-
{
1800-
files: ['packages/edge-bundler/deno/vendor/deno.land/[email protected]/async/tee.ts'],
1801-
rules: {
1802-
'@typescript-eslint/no-unsafe-assignment': 'off',
1803-
'@typescript-eslint/no-explicit-any': 'off',
1804-
'@typescript-eslint/no-unnecessary-condition': 'off',
1805-
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
1806-
},
1807-
},
1808-
{
1809-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/data_local_dir/mod.ts'],
1810-
rules: {
1811-
'@typescript-eslint/no-unsafe-member-access': 'off',
1812-
'@typescript-eslint/no-unsafe-assignment': 'off',
1813-
'@typescript-eslint/no-unsafe-call': 'off',
1814-
'@typescript-eslint/no-unsafe-return': 'off',
1815-
'@typescript-eslint/restrict-template-expressions': 'off',
1816-
},
1817-
},
1818-
{
1819-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/eszip_wasm.generated.js'],
1820-
rules: {
1821-
'@typescript-eslint/no-unused-vars': 'off',
1822-
'@typescript-eslint/no-array-constructor': 'off',
1823-
'n/no-missing-import': 'off',
1824-
},
1825-
},
1826-
{
1827-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/loader.ts'],
1828-
rules: {
1829-
'@typescript-eslint/no-unsafe-assignment': 'off',
1830-
'@typescript-eslint/no-unsafe-call': 'off',
1831-
'@typescript-eslint/no-unsafe-member-access': 'off',
1832-
},
1833-
},
1834-
{
1835-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/mod.ts'],
1836-
rules: {
1837-
'n/no-missing-import': 'off',
1838-
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
1839-
'@typescript-eslint/prefer-promise-reject-errors': 'off',
1840-
},
1841-
},
1842-
{
1843-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/deps.ts'],
1844-
rules: {
1845-
'n/no-missing-import': 'off',
1846-
},
1847-
},
1848-
{
1849-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/misc.ts'],
1850-
rules: {
1851-
'@typescript-eslint/no-unsafe-assignment': 'off',
1852-
'@typescript-eslint/no-unsafe-call': 'off',
1853-
'@typescript-eslint/no-unsafe-member-access': 'off',
1854-
'@typescript-eslint/no-unsafe-return': 'off',
1855-
},
1856-
},
1857-
{
1858-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/decorator.ts'],
1859-
rules: {
1860-
'@typescript-eslint/no-explicit-any': 'off',
1861-
'@typescript-eslint/no-unsafe-return': 'off',
1862-
},
1863-
},
1864-
{
1865-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/options.ts'],
1866-
rules: {
1867-
'@typescript-eslint/no-explicit-any': 'off',
1868-
},
1869-
},
1870-
{
1871-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/retry.ts'],
1872-
rules: {
1873-
'@typescript-eslint/no-unused-vars': 'off',
1874-
'@typescript-eslint/no-non-null-assertion': 'off',
1875-
'@typescript-eslint/no-unsafe-call': 'off',
1876-
'@typescript-eslint/no-unsafe-argument': 'off',
1877-
},
1878-
},
1879-
{
1880-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/tooManyTries.ts'],
1881-
rules: {
1882-
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
1883-
},
1884-
},
1885-
{
1886-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/utils/untilDefined/decorators.ts'],
1887-
rules: {
1888-
'@typescript-eslint/no-explicit-any': 'off',
1889-
},
1890-
},
1891-
{
1892-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/utils/untilDefined/retry.ts'],
1893-
rules: {
1894-
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
1895-
'@typescript-eslint/no-non-null-assertion': 'off',
1896-
},
1897-
},
1898-
{
1899-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/utils/untilResponse/decorators.ts'],
1900-
rules: {
1901-
'@typescript-eslint/no-explicit-any': 'off',
1902-
},
1903-
},
1904-
{
1905-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/utils/untilResponse/retry.ts'],
1906-
rules: {
1907-
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
1908-
},
1909-
},
1910-
{
1911-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/utils/untilTruthy/decorators.ts'],
1912-
rules: {
1913-
'@typescript-eslint/no-explicit-any': 'off',
1914-
},
1915-
},
1916-
{
1917-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/retry/utils/untilTruthy/retry.ts'],
1918-
rules: {
1919-
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
1920-
'@typescript-eslint/no-explicit-any': 'off',
1921-
},
1922-
},
1923-
{
1924-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/wait/decorators.ts'],
1925-
rules: {
1926-
'@typescript-eslint/no-explicit-any': 'off',
1927-
'@typescript-eslint/no-unsafe-return': 'off',
1928-
},
1929-
},
1930-
{
1931-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/wait/timeoutError.ts'],
1932-
rules: {
1933-
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
1934-
},
1935-
},
1936-
{
1937-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/wait/wait.ts'],
1938-
rules: {
1939-
'@typescript-eslint/no-unsafe-assignment': 'off',
1940-
'@typescript-eslint/no-unsafe-call': 'off',
1941-
'@typescript-eslint/no-unsafe-member-access': 'off',
1942-
},
1943-
},
1944-
{
1945-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/cache.ts'],
1946-
rules: {
1947-
'n/no-missing-import': 'off',
1948-
'@typescript-eslint/no-unsafe-call': 'off',
1949-
'@typescript-eslint/no-unsafe-member-access': 'off',
1950-
'@typescript-eslint/no-unsafe-assignment': 'off',
1951-
'@typescript-eslint/restrict-template-expressions': 'off',
1952-
'n/no-unsupported-features/node-builtins': 'off',
1953-
'@typescript-eslint/no-non-null-assertion': 'off',
1954-
'@typescript-eslint/prefer-regexp-exec': 'off',
1955-
'@typescript-eslint/no-unnecessary-condition': 'off',
1956-
},
1957-
},
1958-
{
1959-
files: ['packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/loader.ts'],
1960-
rules: {
1961-
'@typescript-eslint/no-unnecessary-condition': 'off',
1962-
'@typescript-eslint/return-await': 'off',
1963-
'@typescript-eslint/no-explicit-any': 'off',
1964-
'@typescript-eslint/no-unsafe-member-access': 'off',
1965-
'@typescript-eslint/no-unsafe-assignment': 'off',
1966-
'@typescript-eslint/no-unsafe-call': 'off',
1967-
'@typescript-eslint/no-unsafe-argument': 'off',
1968-
},
1969-
},
19701710
{
19711711
files: ['packages/edge-bundler/node/bridge.test.ts'],
19721712
rules: {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { loadESZIP } from 'https://deno.land/x/[email protected]/eszip.ts'
2+
3+
const [functionPath, destPath] = Deno.args
4+
5+
const eszip = await loadESZIP(functionPath)
6+
7+
await eszip.extract(destPath)

packages/edge-bundler/deno/lib/stage2.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const stage2Loader = (
105105
}
106106
}
107107

108-
const writeStage2 = async ({
108+
export const writeStage2 = async ({
109109
basePath,
110110
destPath,
111111
externals,
@@ -122,5 +122,3 @@ const writeStage2 = async ({
122122

123123
return await Deno.writeFile(destPath, bytes)
124124
}
125-
126-
export { writeStage2 }

0 commit comments

Comments
 (0)