eitri-cli 1.11.0-beta.2 → 1.11.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.
@@ -22,7 +22,9 @@ serde_derive = "1.0.197"
22
22
  serde_json = "1.0.114"
23
23
  tokio = { version = "1.36.0", features = ["full"] }
24
24
  colored = "2.0"
25
+ notify = "6.1.1"
25
26
  chrono = "0.4.37"
27
+ notify-debouncer-full = "0.3.1"
26
28
  url = "2.5.0"
27
29
  urlencoding = "2.1.3"
28
30
  url-parse = "1.0.7"
@@ -5,3 +5,4 @@
5
5
 
6
6
  export function publish(environment: string, message: string): Promise<void>
7
7
  export function runTest(userJwt: string, userWorkspaceId: string, testPath: string): Promise<void>
8
+ export function doctor(): Promise<void>
@@ -295,7 +295,8 @@ if (!nativeBinding) {
295
295
  throw new Error(`Failed to load native binding`)
296
296
  }
297
297
 
298
- const { publish, runTest } = nativeBinding
298
+ const { publish, runTest, doctor } = nativeBinding
299
299
 
300
300
  module.exports.publish = publish
301
301
  module.exports.runTest = runTest
302
+ module.exports.doctor = doctor
package/index.js CHANGED
@@ -11,6 +11,8 @@ const debug = require('debug')('eitri:run')
11
11
 
12
12
 
13
13
  const run = async () => {
14
+ const NEW_CLI_VERSION = process.env.CLI_VERSION === "v2"
15
+
14
16
  debug("Iniciando run()")
15
17
  // Temporariamente necessário por conta de no contexto do Rust não saber o diretório atual, dessa forma exportando o fullPath do config é possível.
16
18
  // Quando se tornar uma CLI somente em rust no processo de instalação podemos declarar o caminho, como é via NPM pode ter caminhos variados de acordo com sistema de versionamento, NVM, Volta, ASDF é necessário a variável abaixo.
@@ -132,7 +134,12 @@ const run = async () => {
132
134
  program
133
135
  .command("doctor")
134
136
  .description("Valida as dependências externas para execução da CLI do Eitri")
135
- .action((cmdObj) => {
137
+ .action(async (cmdObj) => {
138
+ if(NEW_CLI_VERSION){
139
+ console.log("doctor (v2)")
140
+ const eitriCLIV2 = require('./eitri-cli-v2/index.js')
141
+ return await eitriCLIV2.doctor()
142
+ }
136
143
  require("./src/cmd/doctor")(cmdObj);
137
144
  });
138
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eitri-cli",
3
- "version": "1.11.0-beta.2",
3
+ "version": "1.11.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": {
@@ -48,15 +48,17 @@ class Http {
48
48
  this.token = token
49
49
  }
50
50
 
51
- setWorkspaceId(id){
51
+ setWorkspaceId(id) {
52
52
  this.workspaceId = id
53
53
  }
54
54
 
55
55
  getCookieSession(url) {
56
56
  return new Promise((resolve, reject) => {
57
- jar.getCookies(url, { allPaths: true }, function (err, cookies) {
57
+ const contextPath = process.env.FOUNDRY_CONTEXT_PATH || 'foundry'
58
+ jar.getCookies(url, { allPaths: true, }, function (err, cookies) {
58
59
  if (err) return reject(err)
59
- resolve(cookies.find((cookie) => cookie))
60
+ const cookie = cookies.find(c => c.path === `/${contextPath}`)
61
+ resolve(cookie)
60
62
  })
61
63
  })
62
64
  }