5htp 0.0.7-1 → 0.0.8-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.
- package/package.json +2 -2
- package/readme.md +30 -0
- package/skeleton/src/client/assets/theme.less +3 -3
- package/skeleton/src/client/pages/landing/_layout/index.less +1 -1
- package/skeleton/src/server/routes/general.ts +1 -1
- package/src/app/index.ts +17 -5
- package/src/commands/dev.ts +0 -3
- package/src/compiler/client/index.ts +1 -1
- package/src/compiler/common/files/images.ts +1 -1
- package/src/compiler/index.ts +26 -1
- package/src/paths.ts +3 -1
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.8-2",
|
|
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.
|
|
75
|
+
"ts-alias": "^0.0.5",
|
|
76
76
|
"ts-node": "^10.9.1",
|
|
77
77
|
"tslog": "^3.3.4",
|
|
78
78
|
"webfont": "^11.2.26",
|
package/readme.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 5-HTP Framework
|
|
2
|
+
|
|
3
|
+
Opinionated, Lightweight & Full Stack Typescript framework, designed for productivity, modularity and performance.
|
|
4
|
+
|
|
5
|
+
**/!\ This is a side-project. I cannot guarantee the maintenance.**
|
|
6
|
+
|
|
7
|
+
## Get Started
|
|
8
|
+
|
|
9
|
+
1. Install:
|
|
10
|
+
|
|
11
|
+
`npm i -g 5htp`
|
|
12
|
+
|
|
13
|
+
2. Create a project:
|
|
14
|
+
|
|
15
|
+
`5htp init`
|
|
16
|
+
|
|
17
|
+
3. Launch dev server:
|
|
18
|
+
|
|
19
|
+
`5htp dev`
|
|
20
|
+
|
|
21
|
+
4. Build for production:
|
|
22
|
+
|
|
23
|
+
`5htp build`
|
|
24
|
+
|
|
25
|
+
## To be done:
|
|
26
|
+
|
|
27
|
+
- Fix Typescript errors
|
|
28
|
+
- Improve stability
|
|
29
|
+
- Improve modularity
|
|
30
|
+
- Make it less opinionated
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
// Spacing
|
|
22
22
|
@spacing: 1.2em;
|
|
23
|
-
@
|
|
23
|
+
@spacing: @spacing;
|
|
24
24
|
@spacingLayout: @spacing * 2;
|
|
25
25
|
|
|
26
26
|
// Responsive
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
--pageWidth: @pageWidth;
|
|
59
59
|
--focusWidth: @focusWidth;
|
|
60
60
|
|
|
61
|
-
--
|
|
62
|
-
--
|
|
61
|
+
--cAccent: @c1;
|
|
62
|
+
--cAccent2: @c2;
|
|
63
63
|
|
|
64
64
|
--bgOverlay: fade(@c1 + #666, 70%);
|
|
65
65
|
|
package/src/app/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ export default class App {
|
|
|
32
32
|
src: cli.paths.appRoot + '/src',
|
|
33
33
|
bin: cli.paths.appRoot + '/bin',
|
|
34
34
|
data: cli.paths.appRoot + '/var/data',
|
|
35
|
-
public: cli.paths.appRoot + '/
|
|
35
|
+
public: cli.paths.appRoot + '/public',
|
|
36
36
|
pages: cli.paths.appRoot + '/src/client/pages',
|
|
37
37
|
cache: cli.paths.appRoot + '/src/.cache',
|
|
38
38
|
|
|
@@ -55,9 +55,21 @@ export default class App {
|
|
|
55
55
|
----------------------------------*/
|
|
56
56
|
|
|
57
57
|
public aliases = {
|
|
58
|
-
client: new TsAlias(
|
|
59
|
-
|
|
58
|
+
client: new TsAlias({
|
|
59
|
+
rootDir: this.paths.root + '/src/client',
|
|
60
|
+
modulesDir: [
|
|
61
|
+
cli.paths.appRoot + '/node_modules',
|
|
62
|
+
cli.paths.coreRoot + '/node_modules'
|
|
63
|
+
],
|
|
64
|
+
debug: false
|
|
65
|
+
}),
|
|
66
|
+
server: new TsAlias({
|
|
67
|
+
rootDir: this.paths.root + '/src/server',
|
|
68
|
+
modulesDir: [
|
|
69
|
+
cli.paths.appRoot + '/node_modules',
|
|
70
|
+
cli.paths.coreRoot + '/node_modules'
|
|
71
|
+
],
|
|
72
|
+
debug: false
|
|
73
|
+
}),
|
|
60
74
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
75
|
}
|
package/src/commands/dev.ts
CHANGED
|
@@ -36,9 +36,6 @@ export const run = () => new Promise<void>(async () => {
|
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
// Allow the dev servet to fetch the frameworg node modules
|
|
40
|
-
//fs.createSymlinkSync( cli.paths.core.cli + '/node_modules', app.paths.bin + '/node_modules', 'dir' );
|
|
41
|
-
|
|
42
39
|
multiCompiler.watch({
|
|
43
40
|
|
|
44
41
|
// https://webpack.js.org/configuration/watch/#watchoptions
|
|
@@ -54,7 +54,7 @@ export default function createCompiler( app: App, mode: TCompileMode ): webpack.
|
|
|
54
54
|
const { aliases } = app.aliases.client.forWebpack(app.paths.root + '/node_modules');
|
|
55
55
|
// Disable access to server-side libs from client side
|
|
56
56
|
delete aliases["@server"];
|
|
57
|
-
delete aliases["@/server"];
|
|
57
|
+
delete aliases["@/server"];
|
|
58
58
|
|
|
59
59
|
const config: webpack.Configuration = {
|
|
60
60
|
|
|
@@ -5,7 +5,7 @@ import type App from '../../../app';
|
|
|
5
5
|
module.exports = (app: App, dev: boolean, client: boolean): webpack.RuleSetRule[] => {
|
|
6
6
|
|
|
7
7
|
return [{
|
|
8
|
-
test: /\.(bmp|gif|jpg|jpeg|png|ico|svg)$/,
|
|
8
|
+
test: /\.(bmp|gif|jpg|jpeg|png|ico|svg|webp)$/,
|
|
9
9
|
type: 'asset',
|
|
10
10
|
parser: {
|
|
11
11
|
dataUrlCondition: {
|
package/src/compiler/index.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
----------------------------------*/
|
|
4
4
|
|
|
5
5
|
// Npm
|
|
6
|
+
import path from 'path';
|
|
6
7
|
import webpack from 'webpack';
|
|
7
8
|
import fs from 'fs-extra';
|
|
8
9
|
|
|
@@ -13,7 +14,6 @@ const smp = new SpeedMeasurePlugin({ disable: true });
|
|
|
13
14
|
import createServerConfig from './server';
|
|
14
15
|
import createClientConfig from './client';
|
|
15
16
|
import { TCompileMode } from './common';
|
|
16
|
-
import cli from '../';
|
|
17
17
|
|
|
18
18
|
// types
|
|
19
19
|
|
|
@@ -37,6 +37,31 @@ export default async function createCompilers(
|
|
|
37
37
|
|
|
38
38
|
// Cleanup
|
|
39
39
|
fs.emptyDirSync( app.paths.bin );
|
|
40
|
+
fs.ensureDirSync( path.join(app.paths.bin, 'public') )
|
|
41
|
+
const publicFiles = fs.readdirSync(app.paths.public);
|
|
42
|
+
for (const publicFile of publicFiles) {
|
|
43
|
+
// Dev: faster to use symlink
|
|
44
|
+
if (mode === 'dev')
|
|
45
|
+
fs.symlinkSync(
|
|
46
|
+
path.join(app.paths.public, publicFile),
|
|
47
|
+
path.join(app.paths.bin, 'public', publicFile)
|
|
48
|
+
);
|
|
49
|
+
// Prod: Symlink not always supported by CI / Containers solutions
|
|
50
|
+
else
|
|
51
|
+
fs.copySync(
|
|
52
|
+
path.join(app.paths.public, publicFile),
|
|
53
|
+
path.join(app.paths.bin, 'public', publicFile)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// When the 5htp package is installed from npm link,
|
|
58
|
+
// Modules are installed locally and not glbally as with with the 5htp package from NPM.
|
|
59
|
+
// So we need to symbilnk the http-core node_modules in one of the parents of server.js.
|
|
60
|
+
// It avoids errors like: "Error: Cannot find module 'intl'"
|
|
61
|
+
fs.symlinkSync(
|
|
62
|
+
path.join(app.paths.root, '/node_modules/5htp-core/node_modules'),
|
|
63
|
+
path.join(app.paths.bin, '/node_modules')
|
|
64
|
+
);
|
|
40
65
|
|
|
41
66
|
// Create compilers
|
|
42
67
|
const multiCompiler = webpack([
|
package/src/paths.ts
CHANGED