@ethlete/cli 0.1.1 → 0.2.1

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,20 @@
1
1
  # @ethlete/cli
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0328fb76`](https://github.com/ethlete-io/ethdk/commit/0328fb769ca53042835826c1967b8d2f25072d63) Thanks [@TomTomB](https://github.com/TomTomB)! - Dependency sync only
8
+
9
+ - Updated dependencies [[`0328fb76`](https://github.com/ethlete-io/ethdk/commit/0328fb769ca53042835826c1967b8d2f25072d63)]:
10
+ - @ethlete/dsp@0.1.2
11
+
12
+ ## 0.2.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [`9605da51`](https://github.com/ethlete-io/ethdk/commit/9605da5186a036ee052668a8c390be8332178398) Thanks [@TomTomB](https://github.com/TomTomB)! - Add release script
17
+
3
18
  ## 0.1.1
4
19
 
5
20
  ### Patch Changes
package/package.json CHANGED
@@ -1,18 +1,15 @@
1
1
  {
2
2
  "name": "@ethlete/cli",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "type": "commonjs",
5
5
  "bin": {
6
6
  "et": "./src/index.js"
7
7
  },
8
- "dependencies": {
9
- "jiti": "^1.18.2",
10
- "sucrase": "^3.32.0"
11
- },
12
8
  "peerDependencies": {
13
- "@ethlete/dsp": "0.1.1",
14
- "tslib": "2.5.0"
9
+ "@ethlete/dsp": "*",
10
+ "jiti": "1.20.0",
11
+ "sucrase": "3.34.0",
12
+ "tslib": "2.6.2"
15
13
  },
16
- "main": "./src/index.js",
17
- "types": "./src/index.d.ts"
14
+ "main": "./src/index.js"
18
15
  }
package/src/index.js CHANGED
@@ -8,8 +8,11 @@ const cli = (args) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
8
  case 'dsp':
9
9
  yield (0, lib_1.dsp)(args);
10
10
  break;
11
+ case 'release':
12
+ yield (0, lib_1.release)(args);
13
+ break;
11
14
  default:
12
- console.log(`No command found named ${cliFunctionArg}. Available commands are: dsp`);
15
+ console.log(`No command found named ${cliFunctionArg}. Available commands are: dsp, release`);
13
16
  break;
14
17
  }
15
18
  });
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/cli/src/index.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAE5B,MAAM,GAAG,GAAG,CAAO,IAAc,EAAE,EAAE;IACnC,MAAM,cAAc,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAE/B,QAAQ,cAAc,EAAE;QACtB,KAAK,KAAK;YACR,MAAM,IAAA,SAAG,EAAC,IAAI,CAAC,CAAC;YAChB,MAAM;QAER;YACE,OAAO,CAAC,GAAG,CAAC,0BAA0B,cAAc,+BAA+B,CAAC,CAAC;YACrF,MAAM;KACT;AACH,CAAC,CAAA,CAAC;AAEF,oDAAoD;AACpD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAExD,GAAG,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/cli/src/index.ts"],"names":[],"mappings":";;;AAAA,+BAAqC;AAErC,MAAM,GAAG,GAAG,CAAO,IAAc,EAAE,EAAE;IACnC,MAAM,cAAc,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAE/B,QAAQ,cAAc,EAAE;QACtB,KAAK,KAAK;YACR,MAAM,IAAA,SAAG,EAAC,IAAI,CAAC,CAAC;YAChB,MAAM;QAER,KAAK,SAAS;YACZ,MAAM,IAAA,aAAO,EAAC,IAAI,CAAC,CAAC;YACpB,MAAM;QAER;YACE,OAAO,CAAC,GAAG,CAAC,0BAA0B,cAAc,wCAAwC,CAAC,CAAC;YAC9F,MAAM;KACT;AACH,CAAC,CAAA,CAAC;AAEF,oDAAoD;AACpD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAExD,GAAG,CAAC,IAAI,CAAC,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from './dsp';
2
+ export * from './release';
package/src/lib/index.js CHANGED
@@ -2,4 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./dsp"), exports);
5
+ tslib_1.__exportStar(require("./release"), exports);
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/cli/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/cli/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB;AACtB,oDAA0B"}
@@ -0,0 +1 @@
1
+ export declare const release: (args: string[]) => Promise<void>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.release = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const child_process_1 = require("child_process");
6
+ const utils_1 = require("./utils");
7
+ const release = (args) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
+ const shouldForce = args.findIndex((arg) => arg.includes('--force') || arg.includes('-f')) !== -1;
9
+ const skipPush = args.findIndex((arg) => arg.includes('--skip-push') || arg.includes('-sp')) !== -1;
10
+ const status = (0, child_process_1.execSync)('git status --porcelain').toString();
11
+ if (status) {
12
+ if (shouldForce) {
13
+ console.warn('🚨 Proceed with caution 🚨 \n\nForcing release with uncommitted changes...\n');
14
+ }
15
+ else {
16
+ console.error('There are uncommitted changes, aborting...\n');
17
+ process.exit(1);
18
+ }
19
+ }
20
+ const answer = yield (0, utils_1.askQuestion)('You are about to release a new version. Make sure you are not releasing a version that has already been released on a different branch. \n\n Press enter to continue...\n');
21
+ if (answer !== '') {
22
+ console.error('Aborting...');
23
+ process.exit(1);
24
+ }
25
+ const changesetVersion = (0, child_process_1.execSync)('yarn changeset version').toString();
26
+ console.log(changesetVersion);
27
+ const changesetTag = (0, child_process_1.execSync)('yarn changeset tag').toString();
28
+ console.log(changesetTag);
29
+ (0, child_process_1.execSync)('git add .');
30
+ console.log('Committing release... 🚀 \n(This may take a while depending on your pre-commit hooks) \n');
31
+ (0, child_process_1.execSync)(`git commit -m "Release versions"`);
32
+ if (!skipPush) {
33
+ (0, child_process_1.execSync)('git push --follow-tags');
34
+ console.log('🚀 Release complete 🚀 Have a great day ❤️');
35
+ }
36
+ else {
37
+ console.log('🚀 Release complete without pushing the commit 🚀 Have a great day ❤️ ');
38
+ }
39
+ });
40
+ exports.release = release;
41
+ //# sourceMappingURL=release.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release.js","sourceRoot":"","sources":["../../../../../libs/cli/src/lib/release.ts"],"names":[],"mappings":";;;;AAAA,iDAAyC;AACzC,mCAAsC;AAE/B,MAAM,OAAO,GAAG,CAAO,IAAc,EAAE,EAAE;IAC9C,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAClG,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAEpG,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE,CAAC;IAE7D,IAAI,MAAM,EAAE;QACV,IAAI,WAAW,EAAE;YACf,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;SAC9F;aAAM;YACL,OAAO,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;YAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;KACF;IAED,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAW,EAC9B,2KAA2K,CAC5K,CAAC;IAEF,IAAI,MAAM,KAAK,EAAE,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,MAAM,gBAAgB,GAAG,IAAA,wBAAQ,EAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE,CAAC;IAEvE,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAE9B,MAAM,YAAY,GAAG,IAAA,wBAAQ,EAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE,CAAC;IAE/D,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE1B,IAAA,wBAAQ,EAAC,WAAW,CAAC,CAAC;IAEtB,OAAO,CAAC,GAAG,CAAC,0FAA0F,CAAC,CAAC;IAExG,IAAA,wBAAQ,EAAC,kCAAkC,CAAC,CAAC;IAE7C,IAAI,CAAC,QAAQ,EAAE;QACb,IAAA,wBAAQ,EAAC,wBAAwB,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;KAC3D;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC;KACvF;AACH,CAAC,CAAA,CAAC;AA5CW,QAAA,OAAO,WA4ClB"}
@@ -0,0 +1 @@
1
+ export declare const askQuestion: (question: string) => Promise<string>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.askQuestion = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const promises_1 = require("readline/promises");
6
+ const askQuestion = (question) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
+ const readline = (0, promises_1.createInterface)({
8
+ input: process.stdin,
9
+ output: process.stdout,
10
+ });
11
+ try {
12
+ return yield readline.question(question);
13
+ }
14
+ finally {
15
+ readline.close();
16
+ }
17
+ });
18
+ exports.askQuestion = askQuestion;
19
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../libs/cli/src/lib/utils.ts"],"names":[],"mappings":";;;;AAAA,gDAAoD;AAE7C,MAAM,WAAW,GAAG,CAAO,QAAgB,EAAE,EAAE;IACpD,MAAM,QAAQ,GAAG,IAAA,0BAAe,EAAC;QAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI;QACF,OAAO,MAAM,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;KAC1C;YAAS;QACR,QAAQ,CAAC,KAAK,EAAE,CAAC;KAClB;AACH,CAAC,CAAA,CAAC;AAXW,QAAA,WAAW,eAWtB"}