@es-pkg/publish 1.0.8 → 1.0.9

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/cjs/index.js CHANGED
@@ -152,12 +152,14 @@ import_gulp.default.task("copy-info", (0, import_gulp.series)(async () => {
152
152
  json.types = [".ts", ".tsx"].includes(ext) ? type : `${dir}/${name}.d.ts`;
153
153
  }
154
154
  json.files = Array.from(/* @__PURE__ */ new Set([ESExists && es, CJSExists && cjs, IIFEExists && iife])).filter(Boolean);
155
- json.dependencies = Object.fromEntries(Object.entries(json.dependencies).map(([key, value]) => {
156
- if (value.startsWith("file://") || value.startsWith("workspace:")) {
157
- return [key, "latest"];
158
- }
159
- return [key, value];
160
- }));
155
+ if (json.dependencies) {
156
+ json.dependencies = Object.fromEntries(Object.entries(json.dependencies).map(([key, value]) => {
157
+ if (value.startsWith("file://") || value.startsWith("workspace:")) {
158
+ return [key, "latest"];
159
+ }
160
+ return [key, value];
161
+ }));
162
+ }
161
163
  let jsonStr = JSON.stringify(json, null, " ");
162
164
  const ex = import_fs.default.existsSync(`${import_config.config.publishDir}/`);
163
165
  if (!ex) {
package/esm/index.js CHANGED
@@ -122,12 +122,14 @@ gulp.task('copy-info', series(async () => {
122
122
  json.types = ['.ts', '.tsx'].includes(ext) ? type : `${dir}/${name}.d.ts`;
123
123
  }
124
124
  json.files = Array.from(new Set([ESExists && es, CJSExists && cjs, IIFEExists && iife])).filter(Boolean);
125
- json.dependencies = Object.fromEntries(Object.entries(json.dependencies).map(([key, value]) => {
126
- if (value.startsWith('file://') || value.startsWith('workspace:')) {
127
- return [key, 'latest'];
128
- }
129
- return [key, value];
130
- }));
125
+ if (json.dependencies) {
126
+ json.dependencies = Object.fromEntries(Object.entries(json.dependencies).map(([key, value]) => {
127
+ if (value.startsWith('file://') || value.startsWith('workspace:')) {
128
+ return [key, 'latest'];
129
+ }
130
+ return [key, value];
131
+ }));
132
+ }
131
133
  let jsonStr = JSON.stringify(json, null, "\t");
132
134
  const ex = fs.existsSync(`${config.publishDir}/`);
133
135
  if (!ex) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@es-pkg/publish",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "组件打包工具",
5
5
  "main": "cjs/index.js",
6
6
  "engines": {