Add plugin packages for go/python/ruby (#6961)

* Add plugin packages

* Fix usage

* Fix build

* Fix workspace linking to build-utils
This commit is contained in:
Steven
2021-11-09 12:48:40 -05:00
committed by GitHub
parent af097c2c06
commit 144e890bfa
14 changed files with 160 additions and 4 deletions

View File

@@ -12,7 +12,7 @@ import minimatch from 'minimatch';
* @param buildRuntime - a legacy build() function from a Runtime * @param buildRuntime - a legacy build() function from a Runtime
* @param ext - the file extension, for example `.py` * @param ext - the file extension, for example `.py`
*/ */
export async function convertRuntimeToPlugin( export function convertRuntimeToPlugin(
buildRuntime: (options: BuildOptions) => Promise<{ output: Lambda }>, buildRuntime: (options: BuildOptions) => Promise<{ output: Lambda }>,
ext: string ext: string
) { ) {

View File

@@ -82,6 +82,7 @@ export { detectFramework } from './detect-framework';
export { DetectorFilesystem } from './detectors/filesystem'; export { DetectorFilesystem } from './detectors/filesystem';
export { readConfigFile } from './fs/read-config-file'; export { readConfigFile } from './fs/read-config-file';
export { normalizePath } from './fs/normalize-path'; export { normalizePath } from './fs/normalize-path';
export { convertRuntimeToPlugin } from './convert-runtime-to-plugin';
export * from './schemas'; export * from './schemas';
export * from './types'; export * from './types';

View File

@@ -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"
}
}

View File

@@ -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;

View File

@@ -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"
}
}

View File

@@ -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"
}
}

View File

@@ -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;

View File

@@ -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"
}
}

View File

@@ -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"
}
}

View File

@@ -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;

View File

@@ -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"
}
}

View File

@@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"declaration": false, "declaration": true,
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["esnext"], "lib": ["esnext"],
"module": "commonjs", "module": "commonjs",

View File

@@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"declaration": false, "declaration": true,
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["esnext"], "lib": ["esnext"],
"module": "commonjs", "module": "commonjs",

5
utils/run.js vendored
View File

@@ -10,11 +10,14 @@ const allPackages = [
'middleware', 'middleware',
'client', 'client',
'node-bridge', 'node-bridge',
'plugin-node',
'node', 'node',
'go', 'go',
'python', 'python',
'ruby', 'ruby',
'plugin-go',
'plugin-node',
'plugin-python',
'plugin-ruby',
'cli', 'cli',
]; ];