eitri-cli 1.5.0 → 1.5.1-beta.2

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.
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "cSpell.words": [
3
+ "bifrost",
3
4
  "eitri",
5
+ "luminus",
6
+ "miniapp",
4
7
  "Unmocked",
5
8
  "Vegvisir"
6
9
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eitri-cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.1-beta.2",
4
4
  "description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -115,7 +115,7 @@ module.exports = class VegvisirService {
115
115
  );
116
116
  const fileContent = await readFile(workspaceGlobalPath, "utf8");
117
117
  const workspace = JSON.parse(fileContent);
118
- console.log("Consutrindo de ", workspace.id)
118
+ console.log("Construindo de", workspace.id)
119
119
  workspace.id = validateUUID(this.workspaceId) ? this.workspaceId : workspace.id;
120
120
  return workspace;
121
121
  } catch (error) {
@@ -40,9 +40,23 @@ class WoodCoffee {
40
40
  return { projectPath };
41
41
  }
42
42
 
43
+ async readEitriAppConf(projectPath) {
44
+ let confPath = path.join(projectPath, "miniapp.conf.js");
45
+ if (fs.existsSync(confPath)) {
46
+ return require(confPath);
47
+ }
48
+ confPath = path.join(projectPath, "eitri-app.conf.js");
49
+ if (fs.existsSync(confPath)) {
50
+ return require(confPath)
51
+ }
52
+ confPath = path.join(projectPath, "eitri-app.conf.json");
53
+ if (fs.existsSync(confPath)) {
54
+ return JSON.parse(await fs.promises.readFile(confPath, "utf-8"));
55
+ }
56
+ }
43
57
  /**
44
58
  *
45
- * @returns Objeto que representa a estrutura de diretorios do projeto criado
59
+ * @returns Objeto que representa a estrutura de diretórios do projeto criado
46
60
  */
47
61
  async template(projectName, templateUrl, projectPath, target) {
48
62
  await this.downloadFromGithub(templateUrl, projectName, projectPath);
@@ -53,7 +67,7 @@ class WoodCoffee {
53
67
  "About.jsx"
54
68
  );
55
69
 
56
- const miniAppConf = require(path.join(projectPath, "miniapp.conf.js"));
70
+ const miniAppConf = await this.readEitriAppConf(projectPath)
57
71
 
58
72
  if (fs.existsSync(aboutJsxPath)) {
59
73
  try {
@@ -90,7 +104,7 @@ class WoodCoffee {
90
104
  ) {
91
105
  // 'O arquivo About.jsx baixado, não é um arquivo consistente.'
92
106
  throw new Error(
93
- "Faltam placeholders para exibicao da versao do components e client"
107
+ "Faltam placeholders para exibição da versão do components e client"
94
108
  );
95
109
  }
96
110
  return true;
@@ -236,8 +250,8 @@ class WoodCoffee {
236
250
  async writeEitriAppConf(project, conf) {
237
251
  const versions = await this._getLatestLibVersions();
238
252
  conf["version"] = "0.1.0";
239
- conf["eitri-app-components"] = versions.componentsVersion;
240
- conf["eitri-app-client"] = versions.appClientVersion;
253
+ conf["eitri-luminus"] = versions.componentsVersion;
254
+ conf["eitri-bifrost"] = versions.appClientVersion;
241
255
 
242
256
  let confString = `module.exports = ${JSON.stringify(conf, null, 4)}`;
243
257
  await writeFile(
@@ -245,9 +259,9 @@ class WoodCoffee {
245
259
  confString,
246
260
  "utf8"
247
261
  );
248
- const oldColfPath = path.join(project.projectPath, "miniapp.conf.js");
249
- if(fs.existsSync(oldColfPath)) {
250
- await rm(oldColfPath, {force: true})
262
+ const oldConfPath = path.join(project.projectPath, "miniapp.conf.js");
263
+ if(fs.existsSync(oldConfPath)) {
264
+ await rm(oldConfPath, {force: true})
251
265
  }
252
266
  }
253
267
 
@@ -258,7 +272,7 @@ class WoodCoffee {
258
272
  );
259
273
 
260
274
  const { data: eitriAppClient } = await axios.get(
261
- "https://cdn.83io.com.br/library/eitri-app-client/versions/index.json"
275
+ "https://cdn.83io.com.br/library/eitri-bifrost/versions/index.json"
262
276
  );
263
277
 
264
278
  return {