Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples
Submodule examples updated 139 files
4 changes: 2 additions & 2 deletions lib/commands/build/modules/storage/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { feedback } from 'azion/utils/node';

interface BucketMetadata {
name: string;
edgeAccess: 'read_only' | 'read_write' | 'restricted';
workloadsAccess: 'read_only' | 'read_write' | 'restricted';
sourceDir: string;
targetDir: string;
prefix: string;
Expand Down Expand Up @@ -139,7 +139,7 @@ const createStorageSymlink = async (

await saveBucketMetadata(storageName, {
name: storageName,
edgeAccess: storage.edgeAccess || 'read_only',
workloadsAccess: storage.workloadsAccess || 'read_only',
sourceDir,
targetDir: targetPath,
prefix,
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/config/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import type { AzionConfig } from 'azion/config';
* ef config create -k "functions[0]" -v '{"name": "auth", "path": "./functions/auth.js"}'
*
* # Create storage configuration
* ef config create -k "storage[0]" -v '{"name": "assets", "dir": "./public", "edgeAccess": "read_only"}'
* ef config create -k "storage[0]" -v '{"name": "assets", "dir": "./public", "workloadsAccess": "read_only"}'
*
* === READING CONFIGURATIONS ===
*
Expand Down Expand Up @@ -74,7 +74,7 @@ import type { AzionConfig } from 'azion/config';
*
* # Update array elements
* ef config update -k "functions[0].path" -v "./functions/updated-auth.js"
* ef config update -k "storage[0].edgeAccess" -v "read_write"
* ef config update -k "storage[0].workloadsAccess" -v "read_write"
*
* === DELETING CONFIGURATIONS ===
*
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/config/replace/replace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('replace.ts', () => {
name: "next-commerce-test9",
prefix: "20250923115113",
dir: "./.edge/assets",
edgeAccess: "read_write",
workloadsAccess: "read_write",
},
]
});
Expand Down
3 changes: 2 additions & 1 deletion lib/commands/dev/command.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { server } from '#env';

/*
* @function devCommand
* @description A command to start the development server.
Expand All @@ -18,7 +20,6 @@ export async function devCommand({
functionName?: string;
}) {
const parsedPort = parseInt(port, 10);
const { server } = await import('#env');

const entryPoint = entry || null;

Expand Down
1 change: 1 addition & 0 deletions lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const DIRECTORIES = {
OUTPUT_MANIFEST_PATH: join('.edge', 'manifest.json'),
OUTPUT_ENV_VARS_PATH: join('.edge', '.env'),
OUTPUT_STORAGE_METADATA_PATH: join('.edge', 'storage', 'metadata.json'),
OUTPUT_KV_PATH: join('.edge', 'kv'),
} as const;

/** Default build configuration values */
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"name": "edge-functions",
"version": "7.1.0-stage.1",
"description": "Tool to launch and build JavaScript/Frameworks. This tool automates polyfills for Edge Computing and assists in creating Workers, notably for the Azion platform.",
"main": "dist/main.js",
"module": "dist/main.ts",
"index": "dist/index.js",
"module": "dist/index.js",
"type": "module",
"bin": {
"azbundler": "dist/main.js",
"edge-functions": "dist/main.js",
"ef": "dist/main.js"
"azbundler": "dist/index.js",
"edge-functions": "dist/index.js",
"ef": "dist/index.js"
},
"scripts": {
"build": "tsup --config ./tsup.config.ts",
"build": "vite build",
"task:reports": "node tasks/process-reports-e2e.js",
"task:reports-nodejs-apis": "node tasks/process-reports-nodejs-apis.js",
"lint": "eslint .",
Expand Down Expand Up @@ -87,8 +87,8 @@
"tmp": "^0.2.1",
"ts-jest": "^29.2.6",
"ts-node": "^10.9.2",
"tsup": "^8.3.6",
"typescript-eslint": "^7.16.0"
"typescript-eslint": "^7.16.0",
"vite": "^7.3.1"
},
"repository": {
"type": "git",
Expand Down
15 changes: 0 additions & 15 deletions tsup.config.ts

This file was deleted.

65 changes: 65 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { resolve } from 'path';
import { defineConfig } from 'vite';
import { chmod } from 'fs/promises';

export default defineConfig({
plugins: [
{
name: 'make-executable',
closeBundle: async () => {
await chmod(resolve(__dirname, 'dist/index.js'), 0o755);
},
},
],
resolve: {
alias: {
'#root': resolve(__dirname, './'),
'#lib': resolve(__dirname, './lib'),
'#types': resolve(__dirname, './lib/types.ts'),
'#utils': resolve(__dirname, './lib/utils.ts'),
'#build': resolve(__dirname, './lib/build/build.ts'),
'#env': resolve(__dirname, './lib/env/index.ts'),
'#constants': resolve(__dirname, './lib/constants.ts'),
'#commands': resolve(__dirname, './lib/commands/index.ts'),
},
},
build: {
target: 'node18',
ssr: true,
lib: {
entry: {
index: resolve(__dirname, 'lib/main.ts'),
},
formats: ['es'],
fileName: (_, entryName) => {
return `${entryName}.js`;
},
},
rollupOptions: {
external: (id) => {
if (id.includes('node_modules')) return true;

const deps = [
'@edge-runtime/primitives',
'@netlify/framework-info',
'azion',
'chokidar',
'commander',
'cosmiconfig',
'cosmiconfig-typescript-loader',
'edge-runtime',
'lodash',
'prettier',
'semver',
'typescript',
];

return deps.some((dep) => id === dep || id.startsWith(`${dep}/`));
},
output: {
exports: 'named',
},
},
minify: true,
},
});
Loading