@modern-js/server-utils 1.1.3-rc.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,20 +1,24 @@
1
1
  # @modern-js/server-utils
2
2
 
3
- ## 1.1.3-rc.0
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cfe11628: Make Modern.js self bootstraping
4
8
 
5
9
  ### Patch Changes
6
10
 
7
- - Updated dependencies [d927bc83]
8
- - Updated dependencies [d73ff455]
9
- - Updated dependencies [9c1ab865]
10
- - Updated dependencies [d73ff455]
11
- - Updated dependencies [d927bc83]
12
- - Updated dependencies [d73ff455]
13
- - Updated dependencies [d73ff455]
14
- - Updated dependencies [d73ff455]
15
- - @modern-js/utils@1.1.4-rc.0
16
- - @modern-js/babel-preset-lib@1.1.3-rc.0
17
- - @modern-js/plugin@1.1.2
11
+ - 146dcd85: modify server framework plugin hook types and hook context
12
+ - 146dcd85: modify server framework plugin hook types
13
+ - 146dcd85: fix test case in babel compiler
14
+ - 1ebc7ee2: fix: @babel/core version
15
+ - Updated dependencies [2da09c69]
16
+ - Updated dependencies [c3d46ee4]
17
+ - Updated dependencies [cfe11628]
18
+ - Updated dependencies [1ebc7ee2]
19
+ - @modern-js/utils@1.2.0
20
+ - @modern-js/babel-preset-lib@1.2.0
21
+ - @modern-js/plugin@1.2.0
18
22
 
19
23
  ## 1.1.2
20
24
 
@@ -1,3 +1 @@
1
- export * from "./middleware";
2
- export * from "./gather";
3
1
  export * from "./babel";
@@ -4,32 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var _middleware = require("./middleware");
8
-
9
- Object.keys(_middleware).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _middleware[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function () {
15
- return _middleware[key];
16
- }
17
- });
18
- });
19
-
20
- var _gather = require("./gather");
21
-
22
- Object.keys(_gather).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _gather[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function () {
28
- return _gather[key];
29
- }
30
- });
31
- });
32
-
33
7
  var _babel = require("./babel");
34
8
 
35
9
  Object.keys(_babel).forEach(function (key) {
@@ -1,3 +1 @@
1
- export * from "./middleware";
2
- export * from "./gather";
3
1
  export * from "./babel";
@@ -1,3 +1 @@
1
- export * from './middleware';
2
- export * from './gather';
3
1
  export * from './babel';
package/jest.config.js ADDED
@@ -0,0 +1,8 @@
1
+ const sharedConfig = require('@scripts/jest-config');
2
+
3
+ /** @type {import('@jest/types').Config.InitialOptions} */
4
+ module.exports = {
5
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
6
+ ...sharedConfig,
7
+ rootDir: __dirname,
8
+ };
package/modern.config.js CHANGED
@@ -1,15 +1,2 @@
1
1
  /** @type {import('@modern-js/module-tools').UserConfig} */
2
- module.exports = {
3
- testing: {
4
- jest: {
5
- collectCoverage: true,
6
- collectCoverageFrom: ['./src/**/*.ts'],
7
- coveragePathIgnorePatterns: ['/node_modules/'],
8
- testEnvironment: 'jsdom',
9
- moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'],
10
- transform: {
11
- '^.+\\.tsx?$': 'ts-jest',
12
- },
13
- },
14
- },
15
- };
2
+ module.exports = {};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.1.3-rc.0",
14
+ "version": "1.2.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -20,6 +20,7 @@
20
20
  "exports": {
21
21
  ".": {
22
22
  "node": {
23
+ "jsnext:source": "./src/index.ts",
23
24
  "import": "./dist/js/modern/index.js",
24
25
  "require": "./dist/js/node/index.js"
25
26
  },
@@ -28,21 +29,21 @@
28
29
  },
29
30
  "dependencies": {
30
31
  "@babel/compat-data": "^7.15.0",
31
- "@babel/core": "^7.15.0",
32
+ "@babel/core": "7.16.7",
32
33
  "@babel/plugin-proposal-class-properties": "^7.14.5",
33
34
  "@babel/plugin-proposal-decorators": "^7.15.4",
34
35
  "@babel/preset-env": "^7.15.0",
35
36
  "@babel/preset-typescript": "^7.15.0",
36
37
  "@babel/runtime": "^7",
37
- "@modern-js/babel-preset-lib": "^1.1.3-rc.0",
38
- "@modern-js/plugin": "^1.1.2",
39
- "@modern-js/utils": "^1.1.4-rc.0",
38
+ "@modern-js/babel-preset-lib": "^1.2.0",
39
+ "@modern-js/plugin": "^1.2.0",
40
+ "@modern-js/utils": "^1.2.0",
40
41
  "babel-plugin-module-resolver": "^4.1.0",
41
42
  "babel-plugin-transform-typescript-metadata": "^0.3.2",
42
43
  "json5": "^2.2.0"
43
44
  },
44
45
  "devDependencies": {
45
- "@modern-js/core": "^1.1.4-rc.0",
46
+ "@modern-js/core": "^1.3.0",
46
47
  "@types/babel__core": "^7.1.15",
47
48
  "@types/jest": "^26",
48
49
  "@types/node": "^14",
@@ -50,18 +51,20 @@
50
51
  "@types/react-dom": "^17",
51
52
  "ts-jest": "^27.0.4",
52
53
  "typescript": "^4",
53
- "@modern-js/plugin-testing": "^1.1.1",
54
- "@modern-js/module-tools": "^1.1.1"
54
+ "@scripts/build": "0.0.0",
55
+ "jest": "^27",
56
+ "@scripts/jest-config": "0.0.0"
55
57
  },
56
58
  "sideEffects": false,
57
59
  "publishConfig": {
58
60
  "registry": "https://registry.npmjs.org/",
59
- "access": "public"
61
+ "access": "public",
62
+ "types": "./dist/types/index.d.ts"
60
63
  },
61
64
  "scripts": {
62
65
  "new": "modern new",
63
66
  "build": "modern build",
64
- "test": "modern test --passWithNoTests"
67
+ "test": "jest --passWithNoTests"
65
68
  },
66
69
  "readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
67
70
  }
package/src/index.ts CHANGED
@@ -1,3 +1 @@
1
- export * from './middleware';
2
- export * from './gather';
3
1
  export * from './babel';
@@ -66,7 +66,7 @@ Object {
66
66
  "helpers": false,
67
67
  "regenerator": true,
68
68
  "useESModules": false,
69
- "version": "7.16.5",
69
+ "version": "7.16.7",
70
70
  },
71
71
  ],
72
72
  Array [
@@ -1,6 +1,6 @@
1
1
  import path from 'path';
2
+ import { resolveBabelConfig } from '../src';
2
3
  import { defaults } from './helpers';
3
- import { resolveBabelConfig } from '@/index';
4
4
 
5
5
  describe('babel', () => {
6
6
  it('resolveBabelConfig', () => {
@@ -1,4 +1,4 @@
1
- import { hook } from '../../..';
1
+ import { hook } from '../../../src';
2
2
 
3
3
  export default hook(({ addMiddleware }) => {
4
4
  addMiddleware('@koa/api');
@@ -1,4 +1,4 @@
1
- import { hook } from '../../..';
1
+ import { hook } from '../../../src';
2
2
 
3
3
  export default hook(({ addMiddleware }) => {
4
4
  addMiddleware('@koa/web');
@@ -5,9 +5,7 @@
5
5
  "jsx": "preserve",
6
6
  "baseUrl": "./",
7
7
  "isolatedModules": true,
8
- "paths": {
9
- "@/*": ["../src/*"]
10
- },
8
+ "paths": {},
11
9
  "types": ["node", "jest"]
12
10
  }
13
11
  }
package/tsconfig.json CHANGED
@@ -5,9 +5,7 @@
5
5
  "jsx": "preserve",
6
6
  "baseUrl": "./",
7
7
  "isolatedModules": true,
8
- "paths": {
9
- "@/*": ["./src/*"]
10
- },
8
+ "paths": {},
11
9
  "types": ["node", "jest"]
12
10
  },
13
11
  "include": ["src"]
@@ -1,35 +0,0 @@
1
- import path from 'path';
2
- import { createMiddlewareCollecter } from "./middleware";
3
- import { requireModule } from "./requireModule";
4
- const API_DIR_PATH = 'api';
5
- const API_APP_NAME = '_app';
6
- const SERVER_DIR_PATH = 'server';
7
- const WEB_APP_NAME = 'index';
8
- export const gather = pwd => {
9
- const {
10
- getMiddlewares,
11
- addAPIMiddleware,
12
- addWebMiddleware
13
- } = createMiddlewareCollecter();
14
- const apiPath = path.resolve(pwd, API_DIR_PATH);
15
- const apiAppPath = path.resolve(apiPath, API_APP_NAME);
16
- const serverPath = path.resolve(pwd, SERVER_DIR_PATH);
17
- const webAppPath = path.resolve(serverPath, WEB_APP_NAME);
18
- const apiAttacher = requireModule(apiAppPath);
19
-
20
- if (apiAttacher) {
21
- apiAttacher({
22
- addMiddleware: addAPIMiddleware
23
- });
24
- }
25
-
26
- const webAttacher = requireModule(webAppPath);
27
-
28
- if (webAttacher) {
29
- webAttacher({
30
- addMiddleware: addWebMiddleware
31
- });
32
- }
33
-
34
- return getMiddlewares();
35
- };
@@ -1,24 +0,0 @@
1
- export const createMiddlewareCollecter = () => {
2
- const webMiddlewares = [];
3
- const apiMiddlewares = [];
4
-
5
- const addWebMiddleware = input => {
6
- webMiddlewares.push(input);
7
- };
8
-
9
- const addAPIMiddleware = input => {
10
- apiMiddlewares.push(input);
11
- };
12
-
13
- const getMiddlewares = () => ({
14
- web: webMiddlewares,
15
- api: apiMiddlewares
16
- });
17
-
18
- return {
19
- getMiddlewares,
20
- addWebMiddleware,
21
- addAPIMiddleware
22
- };
23
- };
24
- export const hook = attacher => attacher;
@@ -1,24 +0,0 @@
1
- import { findExists } from '@modern-js/utils';
2
- const FILE_EXTENSIONS = ['.ts', '.js'];
3
- export const requireModule = filename => {
4
- const exist = findExists(FILE_EXTENSIONS.map(ext => `${filename}${ext}`));
5
-
6
- if (!exist) {
7
- return null;
8
- } // throw errors directly if require fail
9
-
10
-
11
- const mod = require(exist);
12
-
13
- return interopRequire(mod);
14
- };
15
-
16
- function interopRequire(obj) {
17
- return interopRequireDefault(obj).default;
18
- }
19
-
20
- function interopRequireDefault(obj) {
21
- return obj !== null && obj !== void 0 && obj.__esModule ? obj : {
22
- default: obj
23
- };
24
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.gather = void 0;
7
-
8
- var _path = _interopRequireDefault(require("path"));
9
-
10
- var _middleware = require("./middleware");
11
-
12
- var _requireModule = require("./requireModule");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- const API_DIR_PATH = 'api';
17
- const API_APP_NAME = '_app';
18
- const SERVER_DIR_PATH = 'server';
19
- const WEB_APP_NAME = 'index';
20
-
21
- const gather = pwd => {
22
- const {
23
- getMiddlewares,
24
- addAPIMiddleware,
25
- addWebMiddleware
26
- } = (0, _middleware.createMiddlewareCollecter)();
27
-
28
- const apiPath = _path.default.resolve(pwd, API_DIR_PATH);
29
-
30
- const apiAppPath = _path.default.resolve(apiPath, API_APP_NAME);
31
-
32
- const serverPath = _path.default.resolve(pwd, SERVER_DIR_PATH);
33
-
34
- const webAppPath = _path.default.resolve(serverPath, WEB_APP_NAME);
35
-
36
- const apiAttacher = (0, _requireModule.requireModule)(apiAppPath);
37
-
38
- if (apiAttacher) {
39
- apiAttacher({
40
- addMiddleware: addAPIMiddleware
41
- });
42
- }
43
-
44
- const webAttacher = (0, _requireModule.requireModule)(webAppPath);
45
-
46
- if (webAttacher) {
47
- webAttacher({
48
- addMiddleware: addWebMiddleware
49
- });
50
- }
51
-
52
- return getMiddlewares();
53
- };
54
-
55
- exports.gather = gather;
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.hook = exports.createMiddlewareCollecter = void 0;
7
-
8
- const createMiddlewareCollecter = () => {
9
- const webMiddlewares = [];
10
- const apiMiddlewares = [];
11
-
12
- const addWebMiddleware = input => {
13
- webMiddlewares.push(input);
14
- };
15
-
16
- const addAPIMiddleware = input => {
17
- apiMiddlewares.push(input);
18
- };
19
-
20
- const getMiddlewares = () => ({
21
- web: webMiddlewares,
22
- api: apiMiddlewares
23
- });
24
-
25
- return {
26
- getMiddlewares,
27
- addWebMiddleware,
28
- addAPIMiddleware
29
- };
30
- };
31
-
32
- exports.createMiddlewareCollecter = createMiddlewareCollecter;
33
-
34
- const hook = attacher => attacher;
35
-
36
- exports.hook = hook;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.requireModule = void 0;
7
-
8
- var _utils = require("@modern-js/utils");
9
-
10
- const FILE_EXTENSIONS = ['.ts', '.js'];
11
-
12
- const requireModule = filename => {
13
- const exist = (0, _utils.findExists)(FILE_EXTENSIONS.map(ext => `${filename}${ext}`));
14
-
15
- if (!exist) {
16
- return null;
17
- } // throw errors directly if require fail
18
-
19
-
20
- const mod = require(exist);
21
-
22
- return interopRequire(mod);
23
- };
24
-
25
- exports.requireModule = requireModule;
26
-
27
- function interopRequire(obj) {
28
- return interopRequireDefault(obj).default;
29
- }
30
-
31
- function interopRequireDefault(obj) {
32
- return obj !== null && obj !== void 0 && obj.__esModule ? obj : {
33
- default: obj
34
- };
35
- }
@@ -1,35 +0,0 @@
1
- import path from 'path';
2
- import { createMiddlewareCollecter } from "./middleware";
3
- import { requireModule } from "./requireModule";
4
- var API_DIR_PATH = 'api';
5
- var API_APP_NAME = '_app';
6
- var SERVER_DIR_PATH = 'server';
7
- var WEB_APP_NAME = 'index';
8
- export var gather = function gather(pwd) {
9
- var _createMiddlewareColl = createMiddlewareCollecter(),
10
- getMiddlewares = _createMiddlewareColl.getMiddlewares,
11
- addAPIMiddleware = _createMiddlewareColl.addAPIMiddleware,
12
- addWebMiddleware = _createMiddlewareColl.addWebMiddleware;
13
-
14
- var apiPath = path.resolve(pwd, API_DIR_PATH);
15
- var apiAppPath = path.resolve(apiPath, API_APP_NAME);
16
- var serverPath = path.resolve(pwd, SERVER_DIR_PATH);
17
- var webAppPath = path.resolve(serverPath, WEB_APP_NAME);
18
- var apiAttacher = requireModule(apiAppPath);
19
-
20
- if (apiAttacher) {
21
- apiAttacher({
22
- addMiddleware: addAPIMiddleware
23
- });
24
- }
25
-
26
- var webAttacher = requireModule(webAppPath);
27
-
28
- if (webAttacher) {
29
- webAttacher({
30
- addMiddleware: addWebMiddleware
31
- });
32
- }
33
-
34
- return getMiddlewares();
35
- };
@@ -1,28 +0,0 @@
1
- export var createMiddlewareCollecter = function createMiddlewareCollecter() {
2
- var webMiddlewares = [];
3
- var apiMiddlewares = [];
4
-
5
- var addWebMiddleware = function addWebMiddleware(input) {
6
- webMiddlewares.push(input);
7
- };
8
-
9
- var addAPIMiddleware = function addAPIMiddleware(input) {
10
- apiMiddlewares.push(input);
11
- };
12
-
13
- var getMiddlewares = function getMiddlewares() {
14
- return {
15
- web: webMiddlewares,
16
- api: apiMiddlewares
17
- };
18
- };
19
-
20
- return {
21
- getMiddlewares: getMiddlewares,
22
- addWebMiddleware: addWebMiddleware,
23
- addAPIMiddleware: addAPIMiddleware
24
- };
25
- };
26
- export var hook = function hook(attacher) {
27
- return attacher;
28
- };
@@ -1,26 +0,0 @@
1
- import { findExists } from '@modern-js/utils';
2
- var FILE_EXTENSIONS = ['.ts', '.js'];
3
- export var requireModule = function requireModule(filename) {
4
- var exist = findExists(FILE_EXTENSIONS.map(function (ext) {
5
- return "".concat(filename).concat(ext);
6
- }));
7
-
8
- if (!exist) {
9
- return null;
10
- } // throw errors directly if require fail
11
-
12
-
13
- var mod = require(exist);
14
-
15
- return interopRequire(mod);
16
- };
17
-
18
- function interopRequire(obj) {
19
- return interopRequireDefault(obj)["default"];
20
- }
21
-
22
- function interopRequireDefault(obj) {
23
- return obj !== null && obj !== void 0 && obj.__esModule ? obj : {
24
- "default": obj
25
- };
26
- }
@@ -1 +0,0 @@
1
- export declare const gather: (pwd: string) => import("./middleware").CollectMiddlewaresResult;
@@ -1,14 +0,0 @@
1
- export declare type CollectMiddlewaresResult = {
2
- web: any[];
3
- api: any[];
4
- };
5
- export declare const createMiddlewareCollecter: () => {
6
- getMiddlewares: () => CollectMiddlewaresResult;
7
- addWebMiddleware: (input: any) => void;
8
- addAPIMiddleware: (input: any) => void;
9
- };
10
- export declare type AttacherOptions = {
11
- addMiddleware: (...input: any[]) => void;
12
- };
13
- export declare type Attacher = (options: AttacherOptions) => void;
14
- export declare const hook: (attacher: Attacher) => Attacher;
@@ -1 +0,0 @@
1
- export declare const requireModule: (filename: string) => any;
package/src/gather.ts DELETED
@@ -1,30 +0,0 @@
1
- import path from 'path';
2
- import { createMiddlewareCollecter } from './middleware';
3
- import { requireModule } from './requireModule';
4
-
5
- const API_DIR_PATH = 'api';
6
- const API_APP_NAME = '_app';
7
- const SERVER_DIR_PATH = 'server';
8
- const WEB_APP_NAME = 'index';
9
-
10
- export const gather = (pwd: string) => {
11
- const { getMiddlewares, addAPIMiddleware, addWebMiddleware } =
12
- createMiddlewareCollecter();
13
-
14
- const apiPath = path.resolve(pwd, API_DIR_PATH);
15
- const apiAppPath = path.resolve(apiPath, API_APP_NAME);
16
- const serverPath = path.resolve(pwd, SERVER_DIR_PATH);
17
- const webAppPath = path.resolve(serverPath, WEB_APP_NAME);
18
-
19
- const apiAttacher = requireModule(apiAppPath);
20
- if (apiAttacher) {
21
- apiAttacher({ addMiddleware: addAPIMiddleware });
22
- }
23
-
24
- const webAttacher = requireModule(webAppPath);
25
- if (webAttacher) {
26
- webAttacher({ addMiddleware: addWebMiddleware });
27
- }
28
-
29
- return getMiddlewares();
30
- };
package/src/middleware.ts DELETED
@@ -1,35 +0,0 @@
1
- export type CollectMiddlewaresResult = {
2
- web: any[];
3
- api: any[];
4
- };
5
-
6
- export const createMiddlewareCollecter = () => {
7
- const webMiddlewares: any[] = [];
8
- const apiMiddlewares: any[] = [];
9
-
10
- const addWebMiddleware = (input: any) => {
11
- webMiddlewares.push(input);
12
- };
13
-
14
- const addAPIMiddleware = (input: any) => {
15
- apiMiddlewares.push(input);
16
- };
17
-
18
- const getMiddlewares = (): CollectMiddlewaresResult => ({
19
- web: webMiddlewares,
20
- api: apiMiddlewares,
21
- });
22
- return {
23
- getMiddlewares,
24
- addWebMiddleware,
25
- addAPIMiddleware,
26
- };
27
- };
28
-
29
- export type AttacherOptions = {
30
- addMiddleware: (...input: any[]) => void;
31
- };
32
-
33
- export type Attacher = (options: AttacherOptions) => void;
34
-
35
- export const hook = (attacher: Attacher) => attacher;
@@ -1,23 +0,0 @@
1
- import { findExists } from '@modern-js/utils';
2
-
3
- const FILE_EXTENSIONS = ['.ts', '.js'];
4
-
5
- export const requireModule = (filename: string) => {
6
- const exist = findExists(FILE_EXTENSIONS.map(ext => `${filename}${ext}`));
7
-
8
- if (!exist) {
9
- return null;
10
- }
11
-
12
- // throw errors directly if require fail
13
- const mod = require(exist);
14
- return interopRequire(mod);
15
- };
16
-
17
- function interopRequire(obj: any) {
18
- return interopRequireDefault(obj).default;
19
- }
20
-
21
- function interopRequireDefault(obj: any) {
22
- return obj?.__esModule ? obj : { default: obj };
23
- }
@@ -1,22 +0,0 @@
1
- import path from 'path';
2
- import { gather } from '@/index';
3
-
4
- describe('@modern-js/server-utils', () => {
5
- it('should work well', () => {
6
- const pwd = path.resolve(__dirname, './fixtures');
7
- const result = gather(pwd);
8
-
9
- expect(result.api.length).toBe(1);
10
- expect(result.api[0]).toBe('@koa/api');
11
- expect(result.web.length).toBe(1);
12
- expect(result.web[0]).toBe('@koa/web');
13
- });
14
-
15
- it('should get empty when pass a empty dir', () => {
16
- const pwd = path.resolve(__dirname, './fixtures/empty');
17
- const result = gather(pwd);
18
-
19
- expect(result.api.length).toBe(0);
20
- expect(result.web.length).toBe(0);
21
- });
22
- });