@paralect/hive 0.1.2 → 0.1.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.
package/cli/hive.js CHANGED
@@ -16,9 +16,27 @@ program
16
16
  .action(async (dirPath = '.') => {
17
17
  try {
18
18
  process.env.HIVE_SRC = path.resolve(process.cwd(), dirPath);
19
- // execCommand(`npm run dev --prefix ${path.resolve(__dirname, '../starter')}`);
19
+
20
+ const hiveProjectDir = path.resolve(process.env.HIVE_SRC, `../.hive`);
21
+ await execCommand(`mkdir -p ${hiveProjectDir}`);
22
+ await execCommand(`cp -r ${path.resolve(__dirname, '..')}/starter/ ${hiveProjectDir}`);
23
+
24
+ tsx.require(`${hiveProjectDir}/src/app.js`, __filename); // TSX doesn't work inside node_moduels
25
+ } catch (error) {
26
+ console.error('An error occurred:', error.message);
27
+ }
28
+ });
29
+
30
+ program
31
+ .command('prepare [dirPath]')
32
+ .description('Prepare Hive server')
33
+ .action(async (dirPath = '.') => {
34
+ try {
35
+ process.env.HIVE_SRC = path.resolve(process.cwd(), dirPath);
36
+ const hiveProjectDir = path.resolve(process.env.HIVE_SRC, `../.hive`);
20
37
 
21
- tsx.require('./../starter/src/app.js', __filename);
38
+ await execCommand(`mkdir -p ${hiveProjectDir}`);
39
+ await execCommand(`cp -r ${path.resolve(__dirname, '..')}/starter/. ${hiveProjectDir}`);
22
40
  } catch (error) {
23
41
  console.error('An error occurred:', error.message);
24
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paralect/hive",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -20,7 +20,7 @@
20
20
  "build-emails": "babel src/emails --out-dir src/emails/compiled",
21
21
  "dev": "tsx --watch src/app.js",
22
22
  "init-project": "./bin/init-project.sh",
23
- "start": "node src/app.js",
23
+ "start": "tsx src/app.js",
24
24
  "migrate": "node ./src/migrator.js",
25
25
  "schedule-dev": "nodemon --watch ./src ./src/scheduler ./src/scheduler.js",
26
26
  "schedule": "node ./src/scheduler.js",
@@ -22,6 +22,10 @@
22
22
  "baseUrl": "src",
23
23
  "paths": {
24
24
  "*": ["*"]
25
- }
25
+ },
26
26
  },
27
+ "include": [
28
+ "src/**/*",
29
+ ".hive/**/*"
30
+ ]
27
31
  }