@celljs/vercel-adapter 3.9.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/vercel-adapter",
3
- "version": "3.9.0",
3
+ "version": "4.1.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "cell-component"
@@ -20,8 +20,7 @@
20
20
  "lib",
21
21
  "esm",
22
22
  "src",
23
- "cell.yml",
24
- "cell-remote.yml"
23
+ "cell.yml"
25
24
  ],
26
25
  "scripts": {
27
26
  "build": "tsc -b && bun ../../scripts/build-esm.ts",
@@ -30,45 +29,38 @@
30
29
  "watch": "tsc -b -w --preserveWatchOutput"
31
30
  },
32
31
  "dependencies": {
33
- "@celljs/cli-common": "3.9.0",
34
- "@celljs/core": "3.9.0",
35
- "@celljs/web": "3.9.0",
36
- "chalk": "^4.1.0",
37
- "command-exists": "^1.2.9",
38
- "express": "^4.17.1",
39
- "fs-extra": "^9.0.13",
40
- "tslib": "^2.8.0"
41
- },
42
- "devDependencies": {
43
- "@celljs/cli-service": "3.9.0"
32
+ "@celljs/core": "4.1.0",
33
+ "@celljs/web": "4.1.0",
34
+ "express": "^4.22.3"
44
35
  },
45
36
  "publishConfig": {
46
37
  "access": "public"
47
38
  },
48
39
  "exports": {
49
40
  ".": {
50
- "webpack": "./lib/node/index.js",
51
41
  "import": "./esm/node/index.js",
52
42
  "default": "./lib/node/index.js"
53
43
  },
54
44
  "./package.json": "./package.json",
55
- "./lib/hooks/*.js": "./lib/hooks/*.js",
56
- "./lib/hooks/*": "./lib/hooks/*.js",
57
45
  "./lib/node": {
58
- "webpack": "./lib/node/index.js",
59
46
  "import": "./esm/node/index.js",
60
47
  "default": "./lib/node/index.js"
61
48
  },
62
49
  "./lib/*.js": {
63
- "webpack": "./lib/*.js",
64
50
  "import": "./esm/*.js",
65
51
  "default": "./lib/*.js"
66
52
  },
67
53
  "./lib/*": {
68
- "webpack": "./lib/*.js",
69
54
  "import": "./esm/*.js",
70
55
  "default": "./lib/*.js"
71
56
  },
72
57
  "./*": "./*"
58
+ },
59
+ "cell": {
60
+ "modules": {
61
+ "backend": [
62
+ "lib/node/module"
63
+ ]
64
+ }
73
65
  }
74
66
  }
package/cell-remote.yml DELETED
@@ -1,10 +0,0 @@
1
- cell:
2
- vercel:
3
- config:
4
- version: 2
5
- builds:
6
- - src: ${ 'dist/backend/**' | onTarget('backend') || 'dist/frontend/**' }
7
- use: ${ '@vercel/node' | onTarget('backend') || '@vercel/static' }
8
- routes:
9
- - src: ${ '/api' | onTarget('backend') || '/(.*).js' }
10
- dest: ${ 'dist/backend/index.js' | onTarget('backend') || 'dist/frontend/$1.js' }
@@ -1,4 +0,0 @@
1
- import { BuildContext } from '@celljs/cli-common';
2
- export default _default;
3
- declare function _default(context: BuildContext): Promise<void>;
4
- //# sourceMappingURL=build.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/hooks/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyD,MAAM,oBAAoB,CAAC;;0BAInF,OAAO,EAAE,YAAY"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const cli_common_1 = require("@celljs/cli-common");
4
- const path_1 = require("path");
5
- const fs_extra_1 = require("fs-extra");
6
- exports.default = async (context) => {
7
- const { cfg } = context;
8
- let vercelConfig = {};
9
- for (const target of [cli_common_1.BACKEND_TARGET, cli_common_1.FRONTEND_TARGET]) {
10
- if (cli_common_1.ConfigUtil.support(cfg, target)) {
11
- const config = cli_common_1.ConfigUtil.getCellConfig(cfg, target).vercel.config;
12
- if (target === cli_common_1.BACKEND_TARGET) {
13
- vercelConfig = cli_common_1.ConfigUtil.merge(config, vercelConfig);
14
- }
15
- else {
16
- vercelConfig = cli_common_1.ConfigUtil.merge(vercelConfig, config);
17
- }
18
- }
19
- }
20
- if (!cli_common_1.ConfigUtil.support(cfg, cli_common_1.FRONTEND_TARGET)) {
21
- vercelConfig.routes.push({
22
- src: '/.*',
23
- dest: 'dist/backend/index.js'
24
- });
25
- }
26
- await (0, fs_extra_1.ensureDir)(cli_common_1.PathUtil.getProjectHomePath());
27
- const configPath = (0, path_1.resolve)(cli_common_1.PathUtil.getProjectHomePath(), 'vercel.json');
28
- await (0, fs_extra_1.writeJSON)(configPath, vercelConfig, { spaces: 2 });
29
- };
30
- //# sourceMappingURL=build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/hooks/build.ts"],"names":[],"mappings":";;AAAA,mDAAyG;AACzG,+BAA+B;AAC/B,uCAAgD;kBAEjC,KAAK,EAAE,OAAqB,EAAE,EAAE;IAC3C,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IACxB,IAAI,YAAY,GAAQ,EAAE,CAAC;IAE3B,KAAK,MAAM,MAAM,IAAI,CAAE,2BAAc,EAAE,4BAAe,CAAE,EAAE,CAAC;QACvD,IAAI,uBAAU,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,MAAM,GAAG,uBAAU,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YACnE,IAAI,MAAM,KAAK,2BAAc,EAAE,CAAC;gBAC5B,YAAY,GAAG,uBAAU,CAAC,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YAC1D,CAAC;iBAAM,CAAC;gBACJ,YAAY,GAAG,uBAAU,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YAC1D,CAAC;QACL,CAAC;IACL,CAAC;IAED,IAAI,CAAC,uBAAU,CAAC,OAAO,CAAC,GAAG,EAAE,4BAAe,CAAC,EAAE,CAAC;QAC5C,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC;YACrB,GAAG,EAAE,KAAK;YACV,IAAI,EAAE,uBAAuB;SAChC,CAAC,CAAC;IACP,CAAC;IACD,MAAM,IAAA,oBAAS,EAAC,qBAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,IAAA,cAAO,EAAC,qBAAQ,CAAC,kBAAkB,EAAE,EAAE,aAAa,CAAC,CAAC;IACzE,MAAM,IAAA,oBAAS,EAAC,UAAU,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7D,CAAC"}
@@ -1,4 +0,0 @@
1
- import { DeployContext } from '@celljs/cli-common';
2
- export default _default;
3
- declare function _default(context: DeployContext): Promise<void>;
4
- //# sourceMappingURL=deploy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/hooks/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAY,MAAM,oBAAoB,CAAC;;0BAMvC,OAAO,EAAE,aAAa"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const cli_common_1 = require("@celljs/cli-common");
4
- const path_1 = require("path");
5
- const chalk = require('chalk');
6
- const child_process_1 = require("child_process");
7
- const commandExists = require('command-exists');
8
- exports.default = async (context) => {
9
- const { pkg, prod } = context;
10
- console.log(`Deploying ${chalk.bold.yellow(pkg.pkg.name)} to Vercel...`);
11
- try {
12
- await commandExists('vercel');
13
- }
14
- catch (err) {
15
- console.log(chalk `The vercel command does not exist, please install it first: {yellow.bold npm i -g vercel}`);
16
- process.exit(-1);
17
- }
18
- const args = [];
19
- if (prod) {
20
- args.push('--prod');
21
- }
22
- args.push(...['--local-config', (0, path_1.join)(cli_common_1.PathUtil.getProjectHomePath(), 'vercel.json')]);
23
- (0, child_process_1.spawnSync)('vercel', { cwd: cli_common_1.PathUtil.getProjectHomePath(), stdio: 'inherit', shell: true });
24
- };
25
- //# sourceMappingURL=deploy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/hooks/deploy.ts"],"names":[],"mappings":";;AAAA,mDAA6D;AAC7D,+BAA4B;AAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,iDAA0C;AAC1C,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;kBAEjC,KAAK,EAAE,OAAsB,EAAE,EAAE;IAC5C,MAAM,EAAE,GAAG,EAAE,IAAI,EAAC,GAAG,OAAO,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACzE,IAAI,CAAC;QACD,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA,2FAA2F,CAAC,CAAC;QAC9G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IACD,MAAM,IAAI,GAAG,EAAE,CAAC;IAChB,IAAI,IAAI,EAAE,CAAC;QACP,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAA,WAAI,EAAC,qBAAQ,CAAC,kBAAkB,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACrF,IAAA,yBAAS,EAAC,QAAQ,EAAE,EAAE,GAAG,EAAE,qBAAQ,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC/F,CAAC"}
@@ -1,29 +0,0 @@
1
- import { BuildContext, FRONTEND_TARGET, BACKEND_TARGET, ConfigUtil, PathUtil } from '@celljs/cli-common';
2
- import { resolve } from 'path';
3
- import { writeJSON, ensureDir } from 'fs-extra';
4
-
5
- export default async (context: BuildContext) => {
6
- const { cfg } = context;
7
- let vercelConfig: any = {};
8
-
9
- for (const target of [ BACKEND_TARGET, FRONTEND_TARGET ]) {
10
- if (ConfigUtil.support(cfg, target)) {
11
- const config = ConfigUtil.getCellConfig(cfg, target).vercel.config;
12
- if (target === BACKEND_TARGET) {
13
- vercelConfig = ConfigUtil.merge(config, vercelConfig);
14
- } else {
15
- vercelConfig = ConfigUtil.merge(vercelConfig, config);
16
- }
17
- }
18
- }
19
-
20
- if (!ConfigUtil.support(cfg, FRONTEND_TARGET)) {
21
- vercelConfig.routes.push({
22
- src: '/.*',
23
- dest: 'dist/backend/index.js'
24
- });
25
- }
26
- await ensureDir(PathUtil.getProjectHomePath());
27
- const configPath = resolve(PathUtil.getProjectHomePath(), 'vercel.json');
28
- await writeJSON(configPath, vercelConfig, { spaces: 2 });
29
- };
@@ -1,22 +0,0 @@
1
- import { DeployContext, PathUtil } from '@celljs/cli-common';
2
- import { join } from 'path';
3
- const chalk = require('chalk');
4
- import { spawnSync } from 'child_process';
5
- const commandExists = require('command-exists');
6
-
7
- export default async (context: DeployContext) => {
8
- const { pkg, prod} = context;
9
- console.log(`Deploying ${chalk.bold.yellow(pkg.pkg.name)} to Vercel...`);
10
- try {
11
- await commandExists('vercel');
12
- } catch (err) {
13
- console.log(chalk`The vercel command does not exist, please install it first: {yellow.bold npm i -g vercel}`);
14
- process.exit(-1);
15
- }
16
- const args = [];
17
- if (prod) {
18
- args.push('--prod');
19
- }
20
- args.push(...['--local-config', join(PathUtil.getProjectHomePath(), 'vercel.json')]);
21
- spawnSync('vercel', { cwd: PathUtil.getProjectHomePath(), stdio: 'inherit', shell: true });
22
- };