eitri-cli 1.10.0-beta.2 → 1.10.0-beta.4

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.
@@ -83,7 +83,7 @@ pipelines:
83
83
  - apt-get install -y gcc-mingw-w64
84
84
  - apt-get install -y curl
85
85
  - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
86
- - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
86
+ - rustup update
87
87
  - export PATH="/root/.cargo/bin:${PATH}"
88
88
  - rustup --version
89
89
  - export CC=o64-clang
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eitri-cli",
3
- "version": "1.10.0-beta.2",
3
+ "version": "1.10.0-beta.4",
4
4
  "description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -154,7 +154,7 @@ ${await targetService.getAppConfExampleSnippet()}
154
154
  LogVerbose(cmdObj.verbose, " ✓ Preparando os arquivos do seu Eitri-App...")
155
155
 
156
156
  const isDevMode = false
157
- await workspace.uploadZip(isDevMode);
157
+ await workspace.uploadCleanZip(isDevMode);
158
158
  LogVerbose(cmdObj.verbose, " ✓ Arquivos preparados")
159
159
 
160
160
  LogSuccess("6/6 ✓ Gerando versão do Eitri-App");
@@ -30,12 +30,12 @@ const HuginService = require("./HuginService");
30
30
  const EitriAppType = require("../model/EitriAppType");
31
31
  const chalk = require("chalk");
32
32
  const LibsService = require("./LibsService");
33
- const {LogSuccess} = require("../util/LogUtil");
33
+ const { LogSuccess } = require("../util/LogUtil");
34
34
  const vegvisirService = new VegvisirService()
35
35
  const huginService = new HuginService()
36
36
 
37
37
  class Workspace {
38
-
38
+
39
39
  constructor(blindGuardian, hashFolder) {
40
40
  const configService = require("./ConfigService");
41
41
  this.config = configService.get("workspace");
@@ -205,11 +205,11 @@ class Workspace {
205
205
 
206
206
  const { state, target: remoteTarget, eitriConf: remoteEitriConf } = setupData;
207
207
 
208
- if(!this.eitriAppService.validEitriConf(miniConf)) {
208
+ if (!this.eitriAppService.validEitriConf(miniConf)) {
209
209
  await this.eitriAppService.writeEitriConf(remoteEitriConf, miniConf, this.folder2watch);
210
210
  }
211
211
 
212
- await LibsService.validateLibsVersions({libs: state.libs, eitriAppConf: miniConf});
212
+ await LibsService.validateLibsVersions({ libs: state.libs, eitriAppConf: miniConf });
213
213
 
214
214
  this.printLibsVersion(state);
215
215
 
@@ -243,7 +243,7 @@ class Workspace {
243
243
  libVersionsOutput += ` ${lib.name} [${version}]`;
244
244
  }
245
245
  });
246
- console.log(" ",libVersionsOutput, "\n");
246
+ console.log(" ", libVersionsOutput, "\n");
247
247
  }
248
248
 
249
249
  async checkVersions() {
@@ -608,7 +608,7 @@ class Workspace {
608
608
  const allFiles = await this.listFilesInCorrectOrder();
609
609
  const files = allFiles.filter((f) => !f.endsWith("folder.hash"));
610
610
  const folderHash = allFiles.filter((f) => f.endsWith("folder.hash"));
611
-
611
+
612
612
  const hasServerless = files.find(file => file.includes(this.config.hugin.watchUserDir))
613
613
  if (hasServerless) {
614
614
  const serverlessFolderPath = path.join(this.folder2watch, this.config.hugin.watchUserDir)
@@ -617,7 +617,7 @@ class Workspace {
617
617
  serverlessZip.addLocalFolder(serverlessFolderPath, undefined, (fileName) => fileName.includes('.'))
618
618
  const now = Date.now()
619
619
  const tempZip = path.join(os.tmpdir(), `eitri-serverless-${now}.zip`)
620
- await serverlessZip.writeZipPromise(tempZip, {overwrite: true, perm: 777})
620
+ await serverlessZip.writeZipPromise(tempZip, { overwrite: true, perm: 777 })
621
621
 
622
622
  const data = {
623
623
  filePath: tempZip,
@@ -646,6 +646,53 @@ class Workspace {
646
646
  await this.transpile(folderHash);
647
647
  }
648
648
 
649
+ async uploadCleanZip(isDevMode) {
650
+ const admZip = new AdmZip();
651
+ await this.mkdirs([this.folder2watch, ...this.resourceFolders2watch]);
652
+ await this.rmAllServerFiles();
653
+ await this.hashFolder.updateHashFile();
654
+ const allFiles = await this.listFilesInCorrectOrder();
655
+ const filesWithoutTestJSAndTestTS = allFiles.filter(file => !file.endsWith('.test.js') && !file.endsWith('.test.ts'));
656
+ const files = filesWithoutTestJSAndTestTS.filter((f) => !f.endsWith("folder.hash"));
657
+ const folderHash = filesWithoutTestJSAndTestTS.filter((f) => f.endsWith("folder.hash"));
658
+
659
+ const hasServerless = files.find(file => file.includes(this.config.hugin.watchUserDir))
660
+ if (hasServerless) {
661
+ const serverlessFolderPath = path.join(this.folder2watch, this.config.hugin.watchUserDir)
662
+
663
+ const serverlessZip = new AdmZip()
664
+ serverlessZip.addLocalFolder(serverlessFolderPath, undefined, (fileName) => fileName.includes('.'))
665
+ const now = Date.now()
666
+ const tempZip = path.join(os.tmpdir(), `eitri-serverless-${now}.zip`)
667
+ await serverlessZip.writeZipPromise(tempZip, { overwrite: true, perm: 777 })
668
+
669
+ const data = {
670
+ filePath: tempZip,
671
+ // No upload do Zip é ignorado
672
+ relativePath: tempZip,
673
+ isDevMode,
674
+ }
675
+ await huginService.postServerless(data, this.getMiniConf());
676
+
677
+ }
678
+
679
+ admZip.addFile(
680
+ "__files_order.txt",
681
+ filesWithoutTestJSAndTestTS
682
+ .map((f) => f.split(this.folder2watch)[1].replace(/\\/g, "/"))
683
+ .join("\n")
684
+ );
685
+ admZip.addLocalFolder("./src");
686
+
687
+ const platform = process.platform;
688
+
689
+ const zipPath = await this.resolveOs(platform);
690
+ admZip.writeZip(zipPath);
691
+ await this.sendZip(zipPath);
692
+
693
+ await this.transpile(folderHash);
694
+ }
695
+
649
696
  async resolveOs(platform) {
650
697
  let tempDir = "";
651
698
  if (tempFolderPath[platform]) {