5htp 0.0.8-3 → 0.0.9-1
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "5htp",
|
|
3
3
|
"description": "5-HTP, scientifically called 5-Hydroxytryptophan, is the precursor of happiness neurotransmitter.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9-1",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/5htp-cli.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"replace-once": "^1.0.0",
|
|
73
73
|
"speed-measure-webpack-plugin": "^1.5.0",
|
|
74
74
|
"terser-webpack-plugin": "^5.2.4",
|
|
75
|
-
"ts-alias": "^0.0.5",
|
|
75
|
+
"ts-alias": "^0.0.5-1",
|
|
76
76
|
"ts-node": "^10.9.1",
|
|
77
77
|
"tslog": "^3.3.4",
|
|
78
78
|
"webfont": "^11.2.26",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*----------------------------------
|
|
2
|
+
- DEPENDANCES
|
|
3
|
+
----------------------------------*/
|
|
4
|
+
|
|
5
|
+
// Npm
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import fs from 'fs-extra';
|
|
8
|
+
|
|
9
|
+
// App
|
|
10
|
+
import type App from '../../../app';
|
|
11
|
+
|
|
12
|
+
/*----------------------------------
|
|
13
|
+
- TYPES
|
|
14
|
+
----------------------------------*/
|
|
15
|
+
|
|
16
|
+
/*----------------------------------
|
|
17
|
+
- UTTILS
|
|
18
|
+
----------------------------------*/
|
|
19
|
+
export const fixNpmLinkIssues = ( app: App ) => {
|
|
20
|
+
|
|
21
|
+
const corePath = path.join(app.paths.root, '/node_modules/5htp-core');
|
|
22
|
+
if (!fs.lstatSync( corePath ).isSymbolicLink())
|
|
23
|
+
return;
|
|
24
|
+
|
|
25
|
+
console.info(`Fix NPM link issues ...`);
|
|
26
|
+
|
|
27
|
+
const appModules = path.join(app.paths.root, 'node_modules');
|
|
28
|
+
const coreModules = path.join(corePath, 'node_modules');
|
|
29
|
+
|
|
30
|
+
// When the 5htp package is installed from npm link,
|
|
31
|
+
// Modules are installed locally and not glbally as with with the 5htp package from NPM.
|
|
32
|
+
// So we need to symbilnk the http-core node_modules in one of the parents of server.js.
|
|
33
|
+
// It avoids errors like: "Error: Cannot find module 'intl'"
|
|
34
|
+
fs.symlinkSync( coreModules, path.join(app.paths.bin, 'node_modules') );
|
|
35
|
+
|
|
36
|
+
// Same problem: when 5htp-core is installed via npm link,
|
|
37
|
+
// Typescript doesn't detect React and shows mission JSX errors
|
|
38
|
+
const preactCoreModule = path.join(coreModules, 'preact');
|
|
39
|
+
const preactAppModule = path.join(appModules, 'preact');
|
|
40
|
+
const reactAppModule = path.join(appModules, 'react');
|
|
41
|
+
|
|
42
|
+
if (!fs.existsSync( preactAppModule ))
|
|
43
|
+
fs.symlinkSync( preactCoreModule, preactAppModule );
|
|
44
|
+
if (!fs.existsSync( reactAppModule ))
|
|
45
|
+
fs.symlinkSync( path.join(preactCoreModule, 'compat'), reactAppModule );
|
|
46
|
+
}
|
package/src/compiler/index.ts
CHANGED
|
@@ -14,9 +14,9 @@ const smp = new SpeedMeasurePlugin({ disable: true });
|
|
|
14
14
|
import createServerConfig from './server';
|
|
15
15
|
import createClientConfig from './client';
|
|
16
16
|
import { TCompileMode } from './common';
|
|
17
|
+
import { fixNpmLinkIssues } from './common/utils/fixNpmLink';
|
|
17
18
|
|
|
18
19
|
// types
|
|
19
|
-
|
|
20
20
|
import type App from '../app';
|
|
21
21
|
|
|
22
22
|
type TCompilerCallback = () => void
|
|
@@ -54,14 +54,13 @@ export default async function createCompilers(
|
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
);
|
|
57
|
+
/* FIX issue with npm link
|
|
58
|
+
When we install a module with npm link, this module's deps are not installed in the parent project scope
|
|
59
|
+
Which causes some issues:
|
|
60
|
+
- The module's deps are not found by Typescript
|
|
61
|
+
- Including React, so VSCode shows that JSX is missing
|
|
62
|
+
*/
|
|
63
|
+
fixNpmLinkIssues(app);
|
|
65
64
|
|
|
66
65
|
// Create compilers
|
|
67
66
|
const multiCompiler = webpack([
|