@modern-js/plugin-bff 1.3.2 → 1.3.5

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/.eslintrc.js ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ extends: ['@modern-js'],
3
+ parserOptions: {
4
+ project: require.resolve('./tsconfig.json'),
5
+ },
6
+ ignorePatterns: ['types.d.ts'],
7
+ };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @modern-js/plugin-bff
2
2
 
3
+ ## 1.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 55e18278: chore: remove unused dependencies and devDependencies
8
+ - bdcf0865: fix: add default types for plugin bff
9
+ - bdcf0865: fix: Ignore \*.test.ts files for api dir build
10
+ - Updated dependencies [969f172f]
11
+ - Updated dependencies [4c792f68]
12
+ - Updated dependencies [4b5d4bf4]
13
+ - Updated dependencies [62f5b8c8]
14
+ - Updated dependencies [55e18278]
15
+ - Updated dependencies [4499a674]
16
+ - Updated dependencies [403f5169]
17
+ - Updated dependencies [a7f42f48]
18
+ - @modern-js/core@1.4.4
19
+ - @modern-js/utils@1.3.3
20
+ - @modern-js/babel-compiler@1.2.2
21
+
22
+ ## 1.3.4
23
+
24
+ ### Patch Changes
25
+
26
+ - 8f24a514: fix: allow reference typings to index file
27
+ - Updated dependencies [deeaa602]
28
+ - Updated dependencies [54786e58]
29
+ - @modern-js/utils@1.3.2
30
+ - @modern-js/core@1.4.3
31
+
32
+ ## 1.3.3
33
+
34
+ ### Patch Changes
35
+
36
+ - 272cab15: refactor server plugin manager
37
+ - Updated dependencies [d9cc5ea9]
38
+ - Updated dependencies [bd819a8d]
39
+ - Updated dependencies [ec4dbffb]
40
+ - Updated dependencies [d099e5c5]
41
+ - Updated dependencies [bada2879]
42
+ - Updated dependencies [24f616ca]
43
+ - Updated dependencies [bd819a8d]
44
+ - Updated dependencies [272cab15]
45
+ - @modern-js/core@1.4.0
46
+ - @modern-js/utils@1.3.0
47
+ - @modern-js/server-core@1.2.2
48
+
3
49
  ## 1.3.2
4
50
 
5
51
  ### Patch Changes
@@ -1,3 +1,4 @@
1
+ import "./types";
1
2
  import path from 'path';
2
3
  import fs from 'fs-extra';
3
4
  import { createPlugin, useAppContext, useResolvedConfigContext } from '@modern-js/core';
@@ -103,7 +104,7 @@ export default createPlugin(() => ({
103
104
  distDir,
104
105
  sourceDir: sourceAbsDir,
105
106
  extensions: FILE_EXTENSIONS,
106
- ignore: [`**/__tests__/**`, '**/typings/**', '*.d.ts']
107
+ ignore: [`**/__tests__/**`, '**/typings/**', '*.d.ts', '*.test.ts']
107
108
  }, babelConfig);
108
109
 
109
110
  if (await fs.pathExists(rootDir)) {
@@ -1 +1,2 @@
1
+ import "./types";
1
2
  export * from "./constants";
@@ -1,7 +1,6 @@
1
1
  import path from 'path';
2
- import { createPlugin } from '@modern-js/server-plugin';
2
+ import { createPlugin, useAppContext } from '@modern-js/server-core';
3
3
  import { injectAPIHandlerInfos } from '@modern-js/bff-utils';
4
- import { useAppContext } from '@modern-js/core';
5
4
  import { API_DIR, isProd, requireExistModule } from '@modern-js/utils';
6
5
  import { API_APP_NAME } from "./constants";
7
6
 
@@ -0,0 +1 @@
1
+ import '@modern-js/core';
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
+ require("./types");
9
+
8
10
  var _path = _interopRequireDefault(require("path"));
9
11
 
10
12
  var _fsExtra = _interopRequireDefault(require("fs-extra"));
@@ -126,7 +128,7 @@ var _default = (0, _core.createPlugin)(() => ({
126
128
  distDir,
127
129
  sourceDir: sourceAbsDir,
128
130
  extensions: FILE_EXTENSIONS,
129
- ignore: [`**/__tests__/**`, '**/typings/**', '*.d.ts']
131
+ ignore: [`**/__tests__/**`, '**/typings/**', '*.d.ts', '*.test.ts']
130
132
  }, babelConfig);
131
133
 
132
134
  if (await _fsExtra.default.pathExists(rootDir)) {
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
+ require("./types");
8
+
7
9
  var _constants = require("./constants");
8
10
 
9
11
  Object.keys(_constants).forEach(function (key) {
@@ -7,12 +7,10 @@ exports.default = void 0;
7
7
 
8
8
  var _path = _interopRequireDefault(require("path"));
9
9
 
10
- var _serverPlugin = require("@modern-js/server-plugin");
10
+ var _serverCore = require("@modern-js/server-core");
11
11
 
12
12
  var _bffUtils = require("@modern-js/bff-utils");
13
13
 
14
- var _core = require("@modern-js/core");
15
-
16
14
  var _utils = require("@modern-js/utils");
17
15
 
18
16
  var _constants = require("./constants");
@@ -37,11 +35,11 @@ const createTransformAPI = storage => ({
37
35
 
38
36
  });
39
37
 
40
- var _default = (0, _serverPlugin.createPlugin)(() => {
38
+ var _default = (0, _serverCore.createPlugin)(() => {
41
39
  const {
42
40
  appDirectory,
43
41
  distDirectory
44
- } = (0, _core.useAppContext)();
42
+ } = (0, _serverCore.useAppContext)();
45
43
  const root = (0, _utils.isProd)() ? distDirectory : appDirectory;
46
44
 
47
45
  const apiPath = _path.default.resolve(root || process.cwd(), _utils.API_DIR);
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ require("@modern-js/core");
@@ -1,13 +1,4 @@
1
- declare module '@modern-js/core' {
2
- interface UserConfig {
3
- bff?: {
4
- prefix?: string;
5
- requestCreator?: string;
6
- fetcher?: string;
7
- proxy: Record<string, any>;
8
- };
9
- }
10
- }
1
+ import './types';
11
2
 
12
3
  declare const _default: any;
13
4
 
@@ -1 +1,2 @@
1
+ import './types';
1
2
  export * from './constants';
@@ -0,0 +1,11 @@
1
+ import '@modern-js/core';
2
+ declare module '@modern-js/core' {
3
+ interface UserConfig {
4
+ bff?: {
5
+ prefix?: string;
6
+ requestCreator?: string;
7
+ fetcher?: string;
8
+ proxy: Record<string, any>;
9
+ };
10
+ }
11
+ }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.3.2",
14
+ "version": "1.3.5",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -51,23 +51,21 @@
51
51
  "dependencies": {
52
52
  "@babel/core": "7.16.7",
53
53
  "@babel/runtime": "^7",
54
- "@modern-js/babel-chain": "^1.2.1",
55
- "@modern-js/babel-compiler": "^1.2.1",
56
- "@modern-js/babel-preset-lib": "^1.2.1",
54
+ "@modern-js/babel-compiler": "^1.2.2",
57
55
  "@modern-js/create-request": "^1.2.1",
58
56
  "@modern-js/server-utils": "^1.2.1",
59
- "@modern-js/utils": "^1.2.2",
57
+ "@modern-js/utils": "^1.3.3",
60
58
  "fs-extra": "^10.0.0",
61
59
  "loader-utils": "^2.0.0"
62
60
  },
63
61
  "devDependencies": {
64
62
  "@modern-js/bff-utils": "^1.2.2",
65
- "@modern-js/core": "^1.3.2",
63
+ "@modern-js/core": "^1.4.4",
66
64
  "@scripts/build": "0.0.0",
67
- "@modern-js/plugin-analyze": "^1.2.1",
68
- "@modern-js/runtime": "^1.2.1",
69
- "@modern-js/server-plugin": "^1.2.1",
70
- "@modern-js/types": "^1.2.1",
65
+ "@modern-js/plugin-analyze": "^1.3.3",
66
+ "@modern-js/runtime": "^1.2.2",
67
+ "@modern-js/server-core": "^1.2.2",
68
+ "@modern-js/types": "^1.3.4",
71
69
  "@types/babel__core": "^7.1.15",
72
70
  "@types/fs-extra": "^9.0.13",
73
71
  "@types/jest": "^26",
@@ -83,8 +81,8 @@
83
81
  },
84
82
  "peerDependencies": {
85
83
  "@modern-js/bff-utils": "^1.2.2",
86
- "@modern-js/core": "^1.3.2",
87
- "@modern-js/server-plugin": "^1.2.1"
84
+ "@modern-js/core": "^1.4.4",
85
+ "@modern-js/server-core": "^1.2.2"
88
86
  },
89
87
  "modernConfig": {
90
88
  "output": {
@@ -94,8 +92,7 @@
94
92
  "sideEffects": false,
95
93
  "publishConfig": {
96
94
  "registry": "https://registry.npmjs.org/",
97
- "access": "public",
98
- "types": "./dist/types/index.d.ts"
95
+ "access": "public"
99
96
  },
100
97
  "scripts": {
101
98
  "new": "modern new",
@@ -1,5 +1,5 @@
1
1
  import path from 'path';
2
- import { serverManager } from '@modern-js/server-plugin';
2
+ import { serverManager } from '@modern-js/server-core';
3
3
  import { useAPIHandlerInfos } from '@modern-js/bff-utils';
4
4
  import plugin from '../src/server';
5
5
 
package/types.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ declare module '@modern-js/core' {
2
+ interface UserConfig {
3
+ bff?: Partial<{
4
+ prefix: string;
5
+ requestCreator: string;
6
+ fetcher: string;
7
+ proxy: Record<string, any>;
8
+ }>;
9
+ }
10
+ }