mushroom-cli 1.2.0-alpha.13 → 1.2.0-alpha.14

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/README.md CHANGED
@@ -226,6 +226,12 @@ New features:
226
226
 
227
227
  - Support type for View result
228
228
 
229
+ ### 1.1.1
230
+
231
+ Improvement:
232
+
233
+ - `mushroom-cli update tsCode` can read the configuration in mushroom-config.json file
234
+
229
235
  ### 1.1.0
230
236
 
231
237
  Support MushroomServer 0.2.25.4 or later
@@ -1,5 +1,6 @@
1
1
  import fetch from 'node-fetch';
2
2
  export default async function checkUpdate() {
3
3
  const res = await fetch('https://registry.npmjs.org/mushroom-cli/');
4
- return await res.json();
4
+ const data = await res.json();
5
+ return data;
5
6
  }
@@ -1,6 +1,20 @@
1
1
  import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
2
4
  import * as common from '../common.js';
3
- import packageJson from '../../package.json' assert { type: 'json' };
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+ function getPackageVersion() {
8
+ try {
9
+ const content = fs.readFileSync(path.join(__dirname, '../package.json')).toString();
10
+ const pkg = JSON.parse(content);
11
+ return pkg.version;
12
+ }
13
+ catch {
14
+ return '<!unable to get package version>';
15
+ }
16
+ }
17
+ const packageVersion = getPackageVersion();
4
18
  const newLine = '\n';
5
19
  const header = `// NOTE: Please do not modify this file
6
20
  // NOTE: Version and compatibility information: please see in Info.cs file
@@ -208,42 +222,36 @@ function generateCSharpClassMongoDb(source, className, fields, isRoot, descripti
208
222
  /// </summary>
209
223
  `;
210
224
  if (isRoot && fieldName === 'id') {
211
- content += ` [MongoDB.Bson.Serialization.Attributes.BsonId${field.type === 'AutoId' && source.idType === 'GUID' ? '(IdGenerator = typeof(MongoDB.Bson.Serialization.IdGenerators.GuidGenerator))' : ''}]${newLine}`;
225
+ content += ` [MongoDB.Bson.Serialization.Attributes.BsonId${field.type === 'AutoId' && source.idType === 'GUID' ? '(IdGenerator = typeof(MongoDB.Bson.Serialization.IdGenerators.GuidGenerator))' : ''}]\n`;
212
226
  }
213
227
  content += ` [MongoDB.Bson.Serialization.Attributes.BsonElement("${isRoot && fieldName === 'id' ? '_id' : fieldName}")]
214
228
  [MongoDB.Bson.Serialization.Attributes.BsonIgnoreIfNull]
215
229
  [Newtonsoft.Json.JsonProperty(PropertyName = "${fieldName}", NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore${type === 'System.DateTime' ? ', DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore' : ''})]
216
230
  `;
217
231
  if ((field.type === 'AutoId' || field.type === 'IdRef') && source.idType === 'ObjectId') {
218
- content +=
219
- ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]' + newLine;
232
+ content += ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]\n';
220
233
  }
221
234
  if (field.type === 'AutoId' && source.idType === 'GUID') {
222
- content +=
223
- ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.String)]' + newLine;
235
+ content += ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.String)]\n';
224
236
  }
225
237
  if (field.type === 'datetime') {
226
238
  content +=
227
- ' [MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = System.DateTimeKind.Local)]' +
228
- newLine;
239
+ ' [MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = System.DateTimeKind.Local)]\n';
229
240
  }
230
241
  if (field.type === 'array' && field.items) {
231
242
  if ((field.items.type === 'AutoId' || field.items.type === 'IdRef') && source.idType === 'ObjectId') {
232
243
  content +=
233
- ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]' +
234
- newLine;
244
+ ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]\n';
235
245
  }
236
246
  if (field.items.type === 'AutoId' && source.idType === 'GUID') {
237
- content +=
238
- ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.String)]' + newLine;
247
+ content += ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.String)]\n';
239
248
  }
240
249
  if (field.items.type === 'datetime') {
241
250
  content +=
242
- ' [MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = System.DateTimeKind.Local)]' +
243
- newLine;
251
+ ' [MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = System.DateTimeKind.Local)]\n';
244
252
  }
245
253
  }
246
- content += ` public ${type} ${propertyName} { get; set; }${newLine}${newLine}`;
254
+ content += ` public ${type} ${propertyName} { get; set; }\n\n`;
247
255
  strEnumClasses += generateEnumClass(source, out, field, `${className.toUpperCase()}_${propertyName.toUpperCase()}_ENUM`);
248
256
  }
249
257
  content += ` [MongoDB.Bson.Serialization.Attributes.BsonExtraElements]
@@ -299,7 +307,7 @@ export function genCSharpMongoDbClasses(args, projectName, project, alias, sourc
299
307
  collectionNames += ` public static string ${className}CollectionName => "${entities[entityName].storageName}";
300
308
  public static IMongoCollection<Resources.${className}> ${className}Collection => GetDatabase().GetCollection<Resources.${className}>(${className}CollectionName);
301
309
  `;
302
- resourceNames += ` public static string ${className} => "${entityName}";${newLine}`;
310
+ resourceNames += ` public static string ${className} => "${entityName}";\n`;
303
311
  strClasses += generateCSharpClassMongoDb(source, className, entities[entityName].fields, true, entities[entityName].description, out);
304
312
  const actions = entities[entityName].actions || {};
305
313
  for (const actionName in actions) {
@@ -400,26 +408,22 @@ export function genCSharpMongoDbClasses(args, projectName, project, alias, sourc
400
408
  const delegators = groupCSharpMethodHandlerByMethod(out.delegators);
401
409
  const strDelegatorReferences = Object.keys(delegators)
402
410
  .map((method) => delegators[method].map((ev) => ` // ${ev.source}`).join(newLine) +
403
- newLine +
404
- ` RegisterCustomMethod(${getCSharpFunc(method, delegators[method][0].type)});`)
411
+ `\n RegisterCustomMethod(${getCSharpFunc(method, delegators[method][0].type)});`)
405
412
  .join(newLine);
406
413
  const viewHandlers = groupCSharpMethodHandlerByMethod(out.viewHandlers);
407
414
  const strViewHandlerReferences = Object.keys(viewHandlers)
408
415
  .map((method) => viewHandlers[method].map((ev) => ` // ${ev.source}`).join(newLine) +
409
- newLine +
410
- ` RegisterCustomViewMethod(${getCSharpFunc(method, viewHandlers[method][0].type)});`)
416
+ `\n RegisterCustomViewMethod(${getCSharpFunc(method, viewHandlers[method][0].type)});`)
411
417
  .join(newLine);
412
418
  const vnTextChannels = groupCSharpMethodHandlerByMethod(out.vnTextChannels);
413
419
  const strVnTextChannels = Object.keys(vnTextChannels)
414
420
  .map((method) => vnTextChannels[method].map((channel) => ` // ${channel.source}`).join(newLine) +
415
- newLine +
416
- ` RegisterCustomVnTextBuilderMethod(${getCSharpFunc(method, vnTextChannels[method][0].type)});`)
421
+ `\n RegisterCustomVnTextBuilderMethod(${getCSharpFunc(method, vnTextChannels[method][0].type)});`)
417
422
  .join(newLine);
418
423
  const eventHandlers = groupCSharpMethodHandlerByMethod(out.eventHandlers);
419
424
  const strEventHandlerReferences = Object.keys(eventHandlers)
420
425
  .map((method) => eventHandlers[method].map((ev) => ` // ${ev.source}`).join(newLine) +
421
- newLine +
422
- ` RegisterEvent(${getCSharpFunc(method, eventHandlers[method][0].type)});`)
426
+ `\n RegisterEvent(${getCSharpFunc(method, eventHandlers[method][0].type)});`)
423
427
  .join(newLine);
424
428
  const strJobReferences = Array.isArray(source.jobs)
425
429
  ? source.jobs
@@ -431,7 +435,7 @@ export function genCSharpMongoDbClasses(args, projectName, project, alias, sourc
431
435
  .map((job) => ` RegisterJob<${job.action.substring(4).split(',')[0]}>();`)
432
436
  .join(newLine)
433
437
  : '';
434
- const code = `// This file was generated by Mushroom CLI ${packageJson.version} (https://www.npmjs.com/package/mushroom-cli), please do not modify
438
+ const code = `// This file was generated by Mushroom CLI ${packageVersion} (https://www.npmjs.com/package/mushroom-cli), please do not modify
435
439
 
436
440
  // NOTE: Compatible with Mushroom Server version 0.2.18 or higher (https://www.nuget.org/packages/Mushroom/)
437
441
 
@@ -563,39 +567,33 @@ function generateCSharpClassMongoDbToFolder(source, className, fields, isRoot, d
563
567
  /// </summary>
564
568
  `;
565
569
  if (isRoot && fieldName === 'id') {
566
- content += ` [MongoDB.Bson.Serialization.Attributes.BsonId${field.type === 'AutoId' && source.idType === 'GUID' ? '(IdGenerator = typeof(MongoDB.Bson.Serialization.IdGenerators.GuidGenerator))' : ''}]${newLine}`;
570
+ content += ` [MongoDB.Bson.Serialization.Attributes.BsonId${field.type === 'AutoId' && source.idType === 'GUID' ? '(IdGenerator = typeof(MongoDB.Bson.Serialization.IdGenerators.GuidGenerator))' : ''}]\n`;
567
571
  }
568
572
  content += ` [MongoDB.Bson.Serialization.Attributes.BsonElement("${isRoot && fieldName === 'id' ? '_id' : fieldName}")]
569
573
  [MongoDB.Bson.Serialization.Attributes.BsonIgnoreIfNull]
570
574
  [Newtonsoft.Json.JsonProperty(PropertyName = "${fieldName}", NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore${type === 'System.DateTime' ? ', DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore' : ''})]
571
575
  `;
572
576
  if ((field.type === 'AutoId' || field.type === 'IdRef') && source.idType === 'ObjectId') {
573
- content +=
574
- ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]' + newLine;
577
+ content += ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]\n';
575
578
  }
576
579
  if (field.type === 'AutoId' && source.idType === 'GUID') {
577
- content +=
578
- ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.String)]' + newLine;
580
+ content += ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.String)]\n';
579
581
  }
580
582
  if (field.type === 'datetime') {
581
583
  content +=
582
- ' [MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = System.DateTimeKind.Local)]' +
583
- newLine;
584
+ ' [MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = System.DateTimeKind.Local)]\n';
584
585
  }
585
586
  if (field.type === 'array') {
586
587
  if ((field.items?.type === 'AutoId' || field.items?.type === 'IdRef') && source.idType === 'ObjectId') {
587
588
  content +=
588
- ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]' +
589
- newLine;
589
+ ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)]\n';
590
590
  }
591
591
  if (field.items?.type === 'AutoId' && source.idType === 'GUID') {
592
- content +=
593
- ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.String)]' + newLine;
592
+ content += ' [MongoDB.Bson.Serialization.Attributes.BsonRepresentation(MongoDB.Bson.BsonType.String)]\n';
594
593
  }
595
594
  if (field.items?.type === 'datetime') {
596
595
  content +=
597
- ' [MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = System.DateTimeKind.Local)]' +
598
- newLine;
596
+ ' [MongoDB.Bson.Serialization.Attributes.BsonDateTimeOptions(Kind = System.DateTimeKind.Local)]\n';
599
597
  }
600
598
  }
601
599
  content += ` public ${type} ${propertyName} { get; set; }
@@ -776,26 +774,22 @@ function genCSharpMongoDbClassesToFolder(projectName, alias, source, aliasProjec
776
774
  const delegators = groupCSharpMethodHandlerByMethod(out.delegators);
777
775
  const strDelegatorReferences = Object.keys(delegators)
778
776
  .map((method) => delegators[method].map((ev) => ` // ${ev.source}`).join(newLine) +
779
- newLine +
780
- ` RegisterCustomMethod(${getCSharpFunc(method, delegators[method][0].type)});`)
777
+ `\n RegisterCustomMethod(${getCSharpFunc(method, delegators[method][0].type)});`)
781
778
  .join(newLine);
782
779
  const viewHandlers = groupCSharpMethodHandlerByMethod(out.viewHandlers);
783
780
  const strViewHandlerReferences = Object.keys(viewHandlers)
784
781
  .map((method) => viewHandlers[method].map((ev) => ` // ${ev.source}`).join(newLine) +
785
- newLine +
786
- ` RegisterCustomViewMethod(${getCSharpFunc(method, viewHandlers[method][0].type)});`)
782
+ `\n RegisterCustomViewMethod(${getCSharpFunc(method, viewHandlers[method][0].type)});`)
787
783
  .join(newLine);
788
784
  const vnTextChannels = groupCSharpMethodHandlerByMethod(out.vnTextChannels);
789
785
  const strVnTextChannels = Object.keys(vnTextChannels)
790
786
  .map((method) => vnTextChannels[method].map((channel) => ` // ${channel.source}`).join(newLine) +
791
- newLine +
792
- ` RegisterCustomVnTextBuilderMethod(${getCSharpFunc(method, vnTextChannels[method][0].type)});`)
787
+ `\n RegisterCustomVnTextBuilderMethod(${getCSharpFunc(method, vnTextChannels[method][0].type)});`)
793
788
  .join(newLine);
794
789
  const eventHandlers = groupCSharpMethodHandlerByMethod(out.eventHandlers);
795
790
  const strEventHandlerReferences = Object.keys(eventHandlers)
796
791
  .map((method) => eventHandlers[method].map((ev) => ` // ${ev.source}`).join(newLine) +
797
- newLine +
798
- ` RegisterEvent(${getCSharpFunc(method, eventHandlers[method][0].type)});`)
792
+ `\n RegisterEvent(${getCSharpFunc(method, eventHandlers[method][0].type)});`)
799
793
  .join(newLine);
800
794
  const strJobReferences = Array.isArray(source.jobs)
801
795
  ? source.jobs
@@ -871,7 +865,8 @@ ${strJobReferences}
871
865
  }
872
866
  #endif
873
867
  `;
874
- const infoFileContent = `// Mushroom CLI version: ${packageJson.version}${newLine}// Compatible with Mushroom Server version: 0.2.25.4 or higher (https://www.nuget.org/packages/Mushroom/)
868
+ const infoFileContent = `// Mushroom CLI version: ${packageVersion}
869
+ // Compatible with Mushroom Server version: 0.2.25.4 or higher (https://www.nuget.org/packages/Mushroom/)
875
870
  // For Mushroom Server 0.2.18 to 0.2.25.4: Please remove all FindById methods in DbConnector.cs`;
876
871
  fs.writeFileSync(aliasProject.output + '/DbConnector.cs', dbConnectorFileContent);
877
872
  fs.writeFileSync(aliasProject.output + '/ResourceNames.cs', resourceNamesFileContent);
@@ -928,7 +923,7 @@ function generateCSharpClassDriver(source, className, fields, description, out)
928
923
  out.strEnumClasses ?? (out.strEnumClasses = '');
929
924
  out.strEnumClasses += strEnumClasses;
930
925
  }
931
- content += ' }' + newLine;
926
+ content += ' }\n';
932
927
  return strClasses + newLine + content;
933
928
  }
934
929
  export function genCSharpDriver(args, projectName, project, alias, source) {
@@ -949,8 +944,8 @@ export function genCSharpDriver(args, projectName, project, alias, source) {
949
944
  for (const entityName in entities) {
950
945
  const className = toCSharpName(entityName);
951
946
  strClasses += generateCSharpClassDriver(source, className, entities[entityName].fields, entities[entityName].description, out);
952
- codeStaticCtor += ` ${className} = new ${className}Connector(client);${newLine}`;
953
- codeStaticProperties += ` public static ${className}Connector ${className} { get; }${newLine}${newLine}`;
947
+ codeStaticCtor += ` ${className} = new ${className}Connector(client);\n`;
948
+ codeStaticProperties += ` public static ${className}Connector ${className} { get; }\n\n`;
954
949
  const entity = entities[entityName];
955
950
  codeConnectors += ` ${accessModifier} partial class ${className}Connector : MushroomDriver.MushroomResourceConnector<${className}>
956
951
  {
@@ -1187,11 +1182,11 @@ export function genCSharpDriver(args, projectName, project, alias, source) {
1187
1182
 
1188
1183
  ${viewExtraClass}`;
1189
1184
  }
1190
- codeConnectors += ' }' + newLine + newLine;
1185
+ codeConnectors += ' }\n\n';
1191
1186
  }
1192
1187
  if (out.strEnumClasses)
1193
1188
  strEnumClasses += out.strEnumClasses;
1194
- const code = `// This file was generated by Mushroom CLI ${packageJson.version} (https://www.npmjs.com/package/mushroom-cli), please do not modify
1189
+ const code = `// This file was generated by Mushroom CLI ${packageVersion} (https://www.npmjs.com/package/mushroom-cli), please do not modify
1195
1190
 
1196
1191
  // Require package: Mushroom.Driver version 1.4.0 or later (https://www.nuget.org/packages/Mushroom.Driver/)
1197
1192
 
@@ -1,10 +1,23 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
+ import { fileURLToPath } from 'url';
3
4
  import targz from 'targz';
4
5
  import * as common from '../common.js';
5
6
  import * as javascriptDriverGenerator from './gen-js-driver.js';
6
7
  import * as typescriptDriverGenerator from './gen-ts-driver.js';
7
- import packageJson from '../../package.json' assert { type: 'json' };
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+ function getPackageVersion() {
11
+ try {
12
+ const content = fs.readFileSync(path.join(__dirname, '../package.json')).toString();
13
+ const pkg = JSON.parse(content);
14
+ return pkg.version;
15
+ }
16
+ catch {
17
+ return '<!unable to get package version>';
18
+ }
19
+ }
20
+ const packageVersion = getPackageVersion();
8
21
  function compressAsync(src, dest, folderName) {
9
22
  return new Promise((resolve, reject) => {
10
23
  const options = {
@@ -35,7 +48,7 @@ export default async function genJavascriptDriverTarball(args, projectName, proj
35
48
  let tarballName = aliasProject.tarballName ? aliasProject.tarballName : projectName;
36
49
  tarballName = tarballName.toLowerCase().replace(/[^a-z-]/g, '-');
37
50
  const dirPath = path.join(path.dirname(aliasProject.output), tarballName);
38
- const versionGroup = packageJson.version.match(/([^-]+)(-(\w+).*)?/);
51
+ const versionGroup = packageVersion.match(/([^-]+)(-(\w+).*)?/);
39
52
  const currentDistTag = versionGroup?.[3] ? versionGroup[3] : 'latest';
40
53
  const dependencies = [`"mushroomjs": "${currentDistTag}"`];
41
54
  if (Array.isArray(aliasProject.features) && aliasProject.features.includes('auth')) {
@@ -30,7 +30,8 @@ export default function initJson(args) {
30
30
  common.logInfo('Fetch https://api.siten.vn/gen/template/template-def.json');
31
31
  fetch('https://api.siten.vn/gen/template/template-def.json')
32
32
  .then((res) => res.json())
33
- .then((templateConfig) => {
33
+ .then((templateDefination) => {
34
+ const templateConfig = templateDefination;
34
35
  const info = {};
35
36
  templateConfig.fields.forEach((field) => {
36
37
  while (true) {
@@ -10,10 +10,10 @@ function fetchFromGit() {
10
10
  '--single-branch',
11
11
  ]);
12
12
  git.stdout.on('data', (data) => {
13
- common.logInfo('GIT:', data);
13
+ common.logInfo('GIT:', data?.toString());
14
14
  });
15
15
  git.stderr.on('data', (data) => {
16
- common.logError('GIT:', data);
16
+ common.logError('GIT:', data?.toString());
17
17
  });
18
18
  git.on('close', (code) => {
19
19
  if (code) {
package/dist/mr.js CHANGED
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import { fileURLToPath } from 'url';
2
5
  import * as common from './common.js';
3
6
  import init from './init.js';
4
7
  import config from './config.js';
@@ -6,11 +9,23 @@ import gen from './gen.js';
6
9
  import merge from './merge.js';
7
10
  import update from './update.js';
8
11
  import help from './help.js';
9
- import pkg from '../package.json' assert { type: 'json' };
10
12
  import checkUpdate from './check-update.js';
11
- const versionGroup = pkg.version.match(/([^-]+)(-(\w+).*)?/);
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = path.dirname(__filename);
15
+ function getPackageVersion() {
16
+ try {
17
+ const content = fs.readFileSync(path.join(__dirname, '../package.json')).toString();
18
+ const pkg = JSON.parse(content);
19
+ return pkg.version;
20
+ }
21
+ catch {
22
+ return '<!unable to get package version>';
23
+ }
24
+ }
25
+ const packageVersion = getPackageVersion();
26
+ const versionGroup = packageVersion.match(/([^-]+)(-(\w+).*)?/);
12
27
  const currentDistTag = versionGroup?.[3] ? versionGroup[3] : 'latest';
13
- common.logInfo('Mushroom CLI version', pkg.version);
28
+ common.logInfo('Mushroom CLI version', packageVersion);
14
29
  async function run(args) {
15
30
  let debugMode = false;
16
31
  if (args.indexOf('--debug') !== -1) {
@@ -62,7 +77,9 @@ async function run(args) {
62
77
  if (checkUpdateTask !== null)
63
78
  try {
64
79
  const data = await checkUpdateTask;
65
- if (data['dist-tags'] && data['dist-tags'][currentDistTag] && data['dist-tags'][currentDistTag] !== pkg.version) {
80
+ if (data['dist-tags'] &&
81
+ data['dist-tags'][currentDistTag] &&
82
+ data['dist-tags'][currentDistTag] !== packageVersion) {
66
83
  common.logWarning(`YOUR mushroom-cli VERSION IS NOT LATEST (dist-tags: ${currentDistTag}). PLEASE RUN: npm i mushroom-cli@${data['dist-tags'][currentDistTag]} OR yarn add mushroom-cli@^${data['dist-tags'][currentDistTag]}`);
67
84
  }
68
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mushroom-cli",
3
- "version": "1.2.0-alpha.13",
3
+ "version": "1.2.0-alpha.14",
4
4
  "description": "Mushroom CLI",
5
5
  "main": "dist/mr.js",
6
6
  "type": "module",
@@ -8,7 +8,7 @@
8
8
  "build": "tsc && copyfiles -u 2 ./src/docs/* ./dist/docs/",
9
9
  "format": "prettier --write \"**/*.{ts,js,json,md}\"",
10
10
  "lint": "eslint ./src",
11
- "release": "npm publish --access public --tag alpha",
11
+ "release": "npm run build && npm publish --access public --tag alpha",
12
12
  "prepare": "husky install"
13
13
  },
14
14
  "files": [
@@ -24,13 +24,12 @@
24
24
  },
25
25
  "author": "suco2007",
26
26
  "license": "ISC",
27
- "dependencies-comments": "node-fetch: 2.x; open: 8.x",
28
27
  "dependencies": {
29
- "jsdom": "^24.1.1",
28
+ "jsdom": "^25.0.0",
30
29
  "json5": "^2.2.3",
31
30
  "minify": "^11.4.0",
32
- "node-fetch": "^2.7.0",
33
- "open": "^8.4.2",
31
+ "node-fetch": "^3.3.2",
32
+ "open": "^10.1.0",
34
33
  "readline-sync": "^1.4.10",
35
34
  "targz": "^1.0.1"
36
35
  },