diff --git a/packages/build-utils/src/convert-runtime-to-plugin.ts b/packages/build-utils/src/convert-runtime-to-plugin.ts index adb8f2d97..03db09f6e 100644 --- a/packages/build-utils/src/convert-runtime-to-plugin.ts +++ b/packages/build-utils/src/convert-runtime-to-plugin.ts @@ -12,7 +12,7 @@ import minimatch from 'minimatch'; * @param buildRuntime - a legacy build() function from a Runtime * @param ext - the file extension, for example `.py` */ -export async function convertRuntimeToPlugin( +export function convertRuntimeToPlugin( buildRuntime: (options: BuildOptions) => Promise<{ output: Lambda }>, ext: string ) { diff --git a/packages/build-utils/src/index.ts b/packages/build-utils/src/index.ts index 0986ea610..c950e190d 100644 --- a/packages/build-utils/src/index.ts +++ b/packages/build-utils/src/index.ts @@ -82,6 +82,7 @@ export { detectFramework } from './detect-framework'; export { DetectorFilesystem } from './detectors/filesystem'; export { readConfigFile } from './fs/read-config-file'; export { normalizePath } from './fs/normalize-path'; +export { convertRuntimeToPlugin } from './convert-runtime-to-plugin'; export * from './schemas'; export * from './types'; diff --git a/packages/plugin-go/package.json b/packages/plugin-go/package.json new file mode 100644 index 000000000..edfdf8697 --- /dev/null +++ b/packages/plugin-go/package.json @@ -0,0 +1,27 @@ +{ + "private": false, + "name": "vercel-plugin-go", + "version": "1.0.0-canary.0", + "main": "dist/index.js", + "license": "MIT", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "https://github.com/vercel/vercel.git", + "directory": "packages/vercel-plugin-go" + }, + "scripts": { + "build": "tsc", + "prepublishOnly": "tsc" + }, + "dependencies": { + "@vercel/build-utils": "2.12.3-canary.16", + "@vercel/go": "1.2.4-canary.3" + }, + "devDependencies": { + "@types/node": "*", + "typescript": "4.3.4" + } +} diff --git a/packages/plugin-go/src/index.ts b/packages/plugin-go/src/index.ts new file mode 100644 index 000000000..e6f0b15e0 --- /dev/null +++ b/packages/plugin-go/src/index.ts @@ -0,0 +1,6 @@ +import { convertRuntimeToPlugin } from '@vercel/build-utils'; +import * as go from '@vercel/go'; + +export const build = convertRuntimeToPlugin(go.build, '.go'); + +export const startDevServer = go.startDevServer; diff --git a/packages/plugin-go/tsconfig.json b/packages/plugin-go/tsconfig.json new file mode 100644 index 000000000..307708dfc --- /dev/null +++ b/packages/plugin-go/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "declaration": false, + "esModuleInterop": true, + "lib": ["esnext"], + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "dist", + "strict": true, + "target": "esnext" + } +} diff --git a/packages/plugin-python/package.json b/packages/plugin-python/package.json new file mode 100644 index 000000000..279f77dbf --- /dev/null +++ b/packages/plugin-python/package.json @@ -0,0 +1,27 @@ +{ + "private": false, + "name": "vercel-plugin-python", + "version": "1.0.0-canary.0", + "main": "dist/index.js", + "license": "MIT", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "https://github.com/vercel/vercel.git", + "directory": "packages/vercel-plugin-python" + }, + "scripts": { + "build": "tsc", + "prepublishOnly": "tsc" + }, + "dependencies": { + "@vercel/build-utils": "2.12.3-canary.16", + "@vercel/python": "2.0.6-canary.4" + }, + "devDependencies": { + "@types/node": "*", + "typescript": "4.3.4" + } +} diff --git a/packages/plugin-python/src/index.ts b/packages/plugin-python/src/index.ts new file mode 100644 index 000000000..ec3270cfc --- /dev/null +++ b/packages/plugin-python/src/index.ts @@ -0,0 +1,6 @@ +import { convertRuntimeToPlugin } from '@vercel/build-utils'; +import * as python from '@vercel/python'; + +export const build = convertRuntimeToPlugin(python.build, '.py'); + +//export const startDevServer = python.startDevServer; diff --git a/packages/plugin-python/tsconfig.json b/packages/plugin-python/tsconfig.json new file mode 100644 index 000000000..4671facee --- /dev/null +++ b/packages/plugin-python/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "declaration": false, + "esModuleInterop": true, + "lib": ["esnext"], + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "dist", + "types": ["node"], + "strict": true, + "target": "esnext" + } +} diff --git a/packages/plugin-ruby/package.json b/packages/plugin-ruby/package.json new file mode 100644 index 000000000..9985202f1 --- /dev/null +++ b/packages/plugin-ruby/package.json @@ -0,0 +1,27 @@ +{ + "private": false, + "name": "vercel-plugin-ruby", + "version": "1.0.0-canary.0", + "main": "dist/index.js", + "license": "MIT", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "https://github.com/vercel/vercel.git", + "directory": "packages/vercel-plugin-ruby" + }, + "scripts": { + "build": "tsc", + "prepublishOnly": "tsc" + }, + "dependencies": { + "@vercel/build-utils": "2.12.3-canary.16", + "@vercel/ruby": "1.2.8-canary.3" + }, + "devDependencies": { + "@types/node": "*", + "typescript": "4.3.4" + } +} diff --git a/packages/plugin-ruby/src/index.ts b/packages/plugin-ruby/src/index.ts new file mode 100644 index 000000000..ef9b42fec --- /dev/null +++ b/packages/plugin-ruby/src/index.ts @@ -0,0 +1,6 @@ +import { convertRuntimeToPlugin } from '@vercel/build-utils'; +import * as ruby from '@vercel/ruby'; + +export const build = convertRuntimeToPlugin(ruby.build, '.rb'); + +//export const startDevServer = ruby.startDevServer; diff --git a/packages/plugin-ruby/tsconfig.json b/packages/plugin-ruby/tsconfig.json new file mode 100644 index 000000000..4671facee --- /dev/null +++ b/packages/plugin-ruby/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "declaration": false, + "esModuleInterop": true, + "lib": ["esnext"], + "module": "commonjs", + "moduleResolution": "node", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "outDir": "dist", + "types": ["node"], + "strict": true, + "target": "esnext" + } +} diff --git a/packages/python/tsconfig.json b/packages/python/tsconfig.json index 4671facee..b16a98ed1 100644 --- a/packages/python/tsconfig.json +++ b/packages/python/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "declaration": false, + "declaration": true, "esModuleInterop": true, "lib": ["esnext"], "module": "commonjs", diff --git a/packages/ruby/tsconfig.json b/packages/ruby/tsconfig.json index 307708dfc..56e32aacb 100644 --- a/packages/ruby/tsconfig.json +++ b/packages/ruby/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "declaration": false, + "declaration": true, "esModuleInterop": true, "lib": ["esnext"], "module": "commonjs", diff --git a/utils/run.js b/utils/run.js index 285cde7b7..049741b11 100644 --- a/utils/run.js +++ b/utils/run.js @@ -10,11 +10,14 @@ const allPackages = [ 'middleware', 'client', 'node-bridge', - 'plugin-node', 'node', 'go', 'python', 'ruby', + 'plugin-go', + 'plugin-node', + 'plugin-python', + 'plugin-ruby', 'cli', ];