@faststore/cli 1.12.26 → 1.12.28

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
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.12.28](https://github.com/vtex/faststore/compare/v1.12.27...v1.12.28) (2022-11-09)
7
+
8
+
9
+ ### Features
10
+
11
+ * adds start command to serve stores ([#1511](https://github.com/vtex/faststore/issues/1511)) ([9ef30b5](https://github.com/vtex/faststore/commit/9ef30b5e83c3518240d65235c4f84394ab0fc4cd))
12
+
13
+
14
+
15
+ ## [1.12.27](https://github.com/vtex/faststore/compare/v1.12.26...v1.12.27) (2022-11-09)
16
+
17
+
18
+ ### Features
19
+
20
+ * add build command ([#1506](https://github.com/vtex/faststore/issues/1506)) ([f9dfa41](https://github.com/vtex/faststore/commit/f9dfa41998935e839b172cba5ec2eee760b06fb0))
21
+
22
+
23
+
6
24
  ## [1.12.26](https://github.com/vtex/faststore/compare/v1.12.25...v1.12.26) (2022-11-09)
7
25
 
8
26
 
@@ -1,4 +1,6 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import { Command } from '@oclif/core';
2
4
  export default class Build extends Command {
3
- run(): Promise<void>;
5
+ run(): Promise<import("child_process").SpawnSyncReturns<Buffer>>;
4
6
  }
@@ -1,9 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const child_process_1 = require("child_process");
5
+ const directory_1 = require("../utils/directory");
6
+ const generate_1 = require("../utils/generate");
4
7
  class Build extends core_1.Command {
5
8
  async run() {
6
- console.log('running build command');
9
+ await (0, generate_1.generate)({ setup: true });
10
+ return (0, child_process_1.spawnSync)(`yarn build`, {
11
+ shell: true,
12
+ cwd: directory_1.tmpDir,
13
+ stdio: 'inherit',
14
+ });
7
15
  }
8
16
  }
9
17
  exports.default = Build;
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":";;AAAA,sCAAqC;AAErC,MAAqB,KAAM,SAAQ,cAAO;IACxC,KAAK,CAAC,GAAG;QACP,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAA;IACtC,CAAC;CACF;AAJD,wBAIC"}
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":";;AAAA,sCAAqC;AACrC,iDAAyC;AACzC,kDAA2C;AAC3C,gDAA4C;AAE5C,MAAqB,KAAM,SAAQ,cAAO;IACxC,KAAK,CAAC,GAAG;QACP,MAAM,IAAA,mBAAQ,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;QAE/B,OAAO,IAAA,yBAAS,EAAC,YAAY,EAAE;YAC9B,KAAK,EAAE,IAAI;YACX,GAAG,EAAE,kBAAM;YACX,KAAK,EAAE,SAAS;SACjB,CAAC,CAAA;IACH,CAAC;CACF;AAVD,wBAUC"}
@@ -1,4 +1,5 @@
1
+ /// <reference types="node" />
1
2
  import { Command } from '@oclif/core';
2
3
  export default class Start extends Command {
3
- run(): Promise<void>;
4
+ run(): Promise<import("child_process").ChildProcess>;
4
5
  }
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const child_process_1 = require("child_process");
5
+ const fs_extra_1 = require("fs-extra");
6
+ const directory_1 = require("../utils/directory");
4
7
  class Start extends core_1.Command {
5
8
  async run() {
6
- console.log('running start command');
9
+ if (!(0, fs_extra_1.existsSync)(directory_1.tmpDir)) {
10
+ throw Error('The ".faststore" directory could not be found. If you are trying to serve your store, run "faststore build" first.');
11
+ }
12
+ return (0, child_process_1.spawn)(`yarn serve`, {
13
+ shell: true,
14
+ cwd: directory_1.tmpDir,
15
+ stdio: 'inherit',
16
+ });
7
17
  }
8
18
  }
9
19
  exports.default = Start;
@@ -1 +1 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":";;AAAA,sCAAqC;AAErC,MAAqB,KAAM,SAAQ,cAAO;IACxC,KAAK,CAAC,GAAG;QACP,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAA;IACtC,CAAC;CACF;AAJD,wBAIC"}
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":";;AAAA,sCAAqC;AACrC,iDAAqC;AACrC,uCAAqC;AACrC,kDAA2C;AAE3C,MAAqB,KAAM,SAAQ,cAAO;IACxC,KAAK,CAAC,GAAG;QACP,IAAI,CAAC,IAAA,qBAAU,EAAC,kBAAM,CAAC,EAAE;YACvB,MAAM,KAAK,CACT,oHAAoH,CACrH,CAAA;SACF;QAED,OAAO,IAAA,qBAAK,EAAC,YAAY,EAAE;YACzB,KAAK,EAAE,IAAI;YACX,GAAG,EAAE,kBAAM;YACX,KAAK,EAAE,SAAS;SACjB,CAAC,CAAA;IACJ,CAAC;CACF;AAdD,wBAcC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/cli",
3
- "version": "1.12.26",
3
+ "version": "1.12.28",
4
4
  "description": "FastStore CLI",
5
5
  "author": "Emerson Laurentino @emersonlaurentino",
6
6
  "bin": {
@@ -63,5 +63,5 @@
63
63
  "oclif"
64
64
  ],
65
65
  "types": "dist/index.d.ts",
66
- "gitHead": "32cff5b4951e5139209736e012a2dadadf1349cd"
66
+ "gitHead": "40fe63fe1e2e5164a46f515fcc49afc0452927a4"
67
67
  }