@modern-js/utils 1.16.0 → 1.17.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.
@@ -1,4 +1,4 @@
1
- export declare const createRuntimeExportsUtils: (pwd: any, namespace: string, ts?: any) => {
1
+ export declare const createRuntimeExportsUtils: (pwd?: any, namespace?: any) => {
2
2
  addExport: (statement: string) => void;
3
3
  getPath: () => string;
4
4
  };
@@ -20,9 +20,8 @@ const memo = (fn) => {
20
20
  return res;
21
21
  };
22
22
  };
23
- exports.createRuntimeExportsUtils = memo((pwd = '', namespace, ts = false) => {
24
- const entryExportFile = path_1.default.join(pwd, `.runtime-exports/${namespace ? `${namespace}.js` : 'index.js'}`);
25
- const entryExportTsFile = path_1.default.join(pwd, `.runtime-exports/${namespace ? `${namespace}.d.ts` : 'index.d.ts'}`);
23
+ exports.createRuntimeExportsUtils = memo((pwd = '', namespace = 'index') => {
24
+ const entryExportFile = path_1.default.join(pwd, `.runtime-exports/${namespace}.js`);
26
25
  // const ensure = () => {
27
26
  // if (!fs.existsSync(entryExportFile)) {
28
27
  // fs.outputFileSync(entryExportFile, '');
@@ -34,11 +33,8 @@ exports.createRuntimeExportsUtils = memo((pwd = '', namespace, ts = false) => {
34
33
  statement = (0, path_2.normalizeOutputPath)(statement);
35
34
  try {
36
35
  compiled_1.fs.ensureFileSync(entryExportFile);
37
- compiled_1.fs.ensureFileSync(entryExportTsFile);
38
36
  if (!compiled_1.fs.readFileSync(entryExportFile, 'utf8').includes(statement)) {
39
37
  compiled_1.fs.appendFileSync(entryExportFile, `${statement}\n`);
40
- ts &&
41
- compiled_1.fs.appendFileSync(entryExportTsFile, `${statement.replace('.js', '.d')}\n`);
42
38
  }
43
39
  }
44
40
  catch {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.16.0",
14
+ "version": "1.17.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/index.d.ts",
17
17
  "main": "./dist/index.js",
@@ -40,6 +40,7 @@
40
40
  "./webpack-chain": "./compiled/webpack-chain/index.js",
41
41
  "./tsconfig-paths": "./compiled/tsconfig-paths/index.js",
42
42
  "./better-ajv-errors": "./compiled/better-ajv-errors/index.js",
43
+ "./webpack-dev-middleware": "./compiled/webpack-dev-middleware/index.js",
43
44
  "./chain-id": "./dist/chainId.js"
44
45
  },
45
46
  "publishConfig": {
@@ -111,6 +112,9 @@
111
112
  "better-ajv-errors": [
112
113
  "./compiled/better-ajv-errors/index.d.ts"
113
114
  ],
115
+ "webpack-dev-middleware": [
116
+ "./compiled/webpack-dev-middleware/types/index.d.ts"
117
+ ],
114
118
  "chain-id": [
115
119
  "./dist/chainId.d.ts"
116
120
  ]
@@ -121,9 +125,9 @@
121
125
  "lodash": "^4.17.21"
122
126
  },
123
127
  "devDependencies": {
124
- "@modern-js/types": "1.16.0",
125
- "@scripts/build": "1.15.0",
126
- "@scripts/jest-config": "1.15.0",
128
+ "@modern-js/types": "1.17.0",
129
+ "@scripts/build": "1.17.0",
130
+ "@scripts/jest-config": "1.17.0",
127
131
  "@types/jest": "^27",
128
132
  "@types/node": "^14",
129
133
  "typescript": "^4",