@paralect/hive 0.0.4 → 0.0.6
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/cli/helpers/axiosAuth.js
CHANGED
|
@@ -3,8 +3,7 @@ const axios = require('axios');
|
|
|
3
3
|
module.exports = (options) => {
|
|
4
4
|
return axios({
|
|
5
5
|
...options,
|
|
6
|
-
|
|
7
|
-
url: options.url.startsWith('http') ? options.url : `http://localhost:3001/${options.url}`,
|
|
6
|
+
url: options.url.startsWith('http') ? options.url : `https://hive-api-test.paralect.co/${options.url}`,
|
|
8
7
|
headers: {
|
|
9
8
|
...(options?.headers || {}),
|
|
10
9
|
...(process.env.HIVE_TOKEN ? { Authorization: `Bearer ${process.env.HIVE_TOKEN}` } : {})}
|
|
@@ -24,6 +24,7 @@ module.exports = async () => {
|
|
|
24
24
|
|
|
25
25
|
const { token, user } = (await axios({ url: `https://hive-api-test.paralect.co/auth/verify-login`, method: 'post', data: { email, code } })).data;
|
|
26
26
|
|
|
27
|
+
process.env.HIVE_TOKEN = token;
|
|
27
28
|
console.log(`
|
|
28
29
|
You're now logged into Hive! Welcome 🐝
|
|
29
30
|
|
|
@@ -39,7 +39,7 @@ module.exports = async () => {
|
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
dependencies: {
|
|
42
|
-
"@paralect/hive": "^0.0.
|
|
42
|
+
"@paralect/hive": "^0.0.6"
|
|
43
43
|
},
|
|
44
44
|
devDependencies: {
|
|
45
45
|
"nodemon": "^3.1.4"
|
|
@@ -51,11 +51,11 @@ module.exports = async () => {
|
|
|
51
51
|
|
|
52
52
|
fs.writeFileSync(projectConfigPath, `module.exports = { projectId: '${project._id}' } `);
|
|
53
53
|
|
|
54
|
-
const projectEnvPath = path.resolve(process.env.HIVE_SRC, './config/.env');
|
|
54
|
+
const projectEnvPath = path.resolve(process.env.HIVE_SRC, './app-config/.env');
|
|
55
55
|
|
|
56
56
|
if (project?.envs?.staging) {
|
|
57
|
-
if (!fs.existsSync(path.resolve(process.env.HIVE_SRC, './config'))) {
|
|
58
|
-
fs.mkdirSync(path.resolve(process.env.HIVE_SRC, './config'));
|
|
57
|
+
if (!fs.existsSync(path.resolve(process.env.HIVE_SRC, './app-config'))) {
|
|
58
|
+
fs.mkdirSync(path.resolve(process.env.HIVE_SRC, './app-config'));
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
fs.writeFileSync(projectEnvPath, Object.keys(project.envs.staging).map(key => `${key}=${project.envs.staging[key]}`).join('\n'));
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ require("dotenv").config({ path: `${__dirname}/.env` });
|
|
|
4
4
|
require("dotenv").config({ path: `${__dirname}/.env.app` });
|
|
5
5
|
|
|
6
6
|
if (process.env.HIVE_SRC) {
|
|
7
|
+
require("dotenv").config({ path: `${process.env.HIVE_SRC}/app-config/.env` });
|
|
7
8
|
require("dotenv").config({ path: `${process.env.HIVE_SRC}/app-config/.env.app` });
|
|
8
9
|
}
|
|
9
10
|
|