@modern-js/plugin-polyfill 1.2.4 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @modern-js/plugin-polyfill
2
2
 
3
+ ## 1.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 60f7d8bf: feat: add tests dir to npmignore
8
+
3
9
  ## 1.2.4
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.2.4",
14
+ "version": "1.2.5",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -43,8 +43,8 @@
43
43
  "ua-parser-js": "^0.7.28"
44
44
  },
45
45
  "devDependencies": {
46
- "@modern-js/server-core": "1.2.5",
47
- "@modern-js/types": "^1.3.6",
46
+ "@modern-js/server-core": "1.3.1",
47
+ "@modern-js/types": "^1.5.0",
48
48
  "@types/jest": "^26",
49
49
  "@types/lru-cache": "^5.1.1",
50
50
  "@types/mime-types": "^2.1.1",
@@ -53,7 +53,7 @@
53
53
  "@types/react-dom": "^17",
54
54
  "@types/ua-parser-js": "^0.7.36",
55
55
  "typescript": "^4",
56
- "@modern-js/core": "1.6.1",
56
+ "@modern-js/core": "1.8.0",
57
57
  "@scripts/build": "0.0.0",
58
58
  "jest": "^27",
59
59
  "@scripts/jest-config": "0.0.0"
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- extends: ['@modern-js'],
3
- parserOptions: {
4
- project: require.resolve('./tsconfig.json'),
5
- },
6
- };
@@ -1,53 +0,0 @@
1
- import type { NormalizedConfig } from '@modern-js/core';
2
- import cliPugin from '../src/cli';
3
- import serverPlugin from '../src';
4
- import { defaultPolyfill } from '../src/const';
5
-
6
- describe('plugin-static-hosting', () => {
7
- it('cli', () => {
8
- expect(cliPugin).toBeDefined();
9
- const instance = cliPugin();
10
- expect(instance.name).toBe('@modern-js/plugin-polyfill');
11
-
12
- const hooks: any = instance.setup?.({
13
- useResolvedConfigContext: () => {
14
- return {
15
- output: {},
16
- } as NormalizedConfig;
17
- },
18
- } as any);
19
-
20
- const params = { entrypoint: [], partials: [] };
21
- expect(hooks.htmlPartials(params)).toEqual(params);
22
- });
23
-
24
- it('server', async () => {
25
- expect(serverPlugin).toBeDefined();
26
- const instance = serverPlugin();
27
- expect(instance.name).toBe('@modern-js/plugin-polyfill');
28
-
29
- const hooks: any = instance.setup?.({} as any);
30
- const fn = hooks.preServerInit();
31
- expect(typeof fn).toBe('function');
32
-
33
- const errorContext = { url: '' };
34
- expect(await fn(errorContext, () => false)).toBeFalsy();
35
-
36
- const context = {
37
- url: defaultPolyfill,
38
- res: {
39
- setHeader: () => false,
40
- end: (result: string) => result,
41
- },
42
- headers: {
43
- 'user-agent':
44
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36',
45
- },
46
- };
47
-
48
- const res = await fn(context);
49
- expect(res).toMatch('modern polyfill');
50
- const res1 = await fn(context);
51
- expect(res1).toMatch('modern polyfill');
52
- });
53
- });
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "@modern-js/tsconfig/base",
3
- "compilerOptions": {
4
- "declaration": false,
5
- "jsx": "preserve",
6
- "baseUrl": "./",
7
- "isolatedModules": true
8
- }
9
- }