proteum 1.0.0 → 1.0.3
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/AGENTS.md +9 -0
- package/cli/app/config.ts +61 -0
- package/cli/app/index.ts +227 -0
- package/cli/bin.js +35 -0
- package/cli/commands/build.ts +60 -0
- package/cli/commands/deploy/app.ts +29 -0
- package/cli/commands/deploy/web.ts +60 -0
- package/cli/commands/dev.ts +124 -0
- package/cli/commands/init.ts +85 -0
- package/cli/commands/refresh.ts +18 -0
- package/cli/compiler/client/identite.ts +69 -0
- package/cli/compiler/client/index.ts +343 -0
- package/cli/compiler/common/babel/index.ts +173 -0
- package/cli/compiler/common/babel/plugins/index.ts +0 -0
- package/cli/compiler/common/babel/plugins/services.ts +586 -0
- package/cli/compiler/common/babel/routes/imports.ts +127 -0
- package/cli/compiler/common/babel/routes/routes.ts +1170 -0
- package/cli/compiler/common/files/autres.ts +39 -0
- package/cli/compiler/common/files/images.ts +42 -0
- package/cli/compiler/common/files/style.ts +82 -0
- package/cli/compiler/common/index.ts +165 -0
- package/cli/compiler/index.ts +585 -0
- package/cli/compiler/server/index.ts +220 -0
- package/cli/index.ts +213 -0
- package/cli/paths.ts +165 -0
- package/cli/print.ts +12 -0
- package/cli/tsconfig.json +42 -0
- package/cli/utils/index.ts +22 -0
- package/cli/utils/keyboard.ts +78 -0
- package/client/app/index.ts +2 -0
- package/client/components/Dialog/Manager.tsx +3 -49
- package/client/components/Dialog/index.less +3 -1
- package/client/components/index.ts +1 -2
- package/client/services/router/index.tsx +6 -16
- package/common/errors/index.tsx +12 -31
- package/package.json +58 -22
- package/server/app/container/config.ts +20 -1
- package/server/app/container/console/index.ts +1 -1
- package/server/services/auth/index.ts +62 -27
- package/server/services/auth/router/request.ts +17 -6
- package/server/services/router/http/index.ts +3 -3
- package/server/services/router/response/index.ts +1 -1
- package/server/services/schema/request.ts +28 -10
- package/server/utils/slug.ts +0 -3
- package/tsconfig.common.json +2 -1
- package/types/global/constants.d.ts +12 -0
- package/changelog.md +0 -5
- package/client/components/Button.tsx +0 -298
- package/client/components/Dialog/card.tsx +0 -208
- package/client/data/input.ts +0 -32
- package/client/pages/bug.tsx.old +0 -60
- package/templates/composant.tsx +0 -40
- package/templates/form.ts +0 -30
- package/templates/modal.tsx +0 -47
- package/templates/modele.ts +0 -56
- package/templates/page.tsx +0 -74
- package/templates/route.ts +0 -43
- package/templates/service.ts +0 -75
- package/vscode/copyimportationpath/.eslintrc.json +0 -24
- package/vscode/copyimportationpath/.vscodeignore +0 -12
- package/vscode/copyimportationpath/CHANGELOG.md +0 -9
- package/vscode/copyimportationpath/README.md +0 -3
- package/vscode/copyimportationpath/copyimportationpath-0.0.1.vsix +0 -0
- package/vscode/copyimportationpath/out/extension.js +0 -206
- package/vscode/copyimportationpath/out/extension.js.map +0 -1
- package/vscode/copyimportationpath/package-lock.json +0 -4536
- package/vscode/copyimportationpath/package.json +0 -86
- package/vscode/copyimportationpath/src/extension.ts +0 -300
- package/vscode/copyimportationpath/tsconfig.json +0 -22
- package/vscode/copyimportationpath/vsc-extension-quickstart.md +0 -42
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*----------------------------------
|
|
2
|
+
- DEPENDANCES
|
|
3
|
+
----------------------------------*/
|
|
4
|
+
|
|
5
|
+
// npm
|
|
6
|
+
import readline, { Key } from 'readline';
|
|
7
|
+
|
|
8
|
+
/*----------------------------------
|
|
9
|
+
- TYPES
|
|
10
|
+
----------------------------------*/
|
|
11
|
+
|
|
12
|
+
type TKeyboardCommand = {
|
|
13
|
+
remove?: boolean,
|
|
14
|
+
run: (str: string, chunk: string, key: Key) => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/*----------------------------------
|
|
18
|
+
- METHODS
|
|
19
|
+
----------------------------------*/
|
|
20
|
+
class KeyboardCommands {
|
|
21
|
+
|
|
22
|
+
private commands: { [input: string]: TKeyboardCommand } = {}
|
|
23
|
+
|
|
24
|
+
public constructor() {
|
|
25
|
+
this.listen();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private listen() {
|
|
29
|
+
|
|
30
|
+
readline.emitKeypressEvents(process.stdin);
|
|
31
|
+
process.stdin.setRawMode(true);
|
|
32
|
+
process.stdin.on('keypress', async (chunk: string, key: Key) => {
|
|
33
|
+
|
|
34
|
+
let str = key.name;
|
|
35
|
+
if (!str) return;
|
|
36
|
+
if (str === 'return') str = 'enter';
|
|
37
|
+
|
|
38
|
+
if (key.ctrl) str = 'ctrl+' + str;
|
|
39
|
+
if (key.shift) str = 'shift+' + str;
|
|
40
|
+
if (key.meta) str = 'meta+' + str;
|
|
41
|
+
|
|
42
|
+
const kCommand = this.commands[str] || this.commands.fallback;
|
|
43
|
+
if (kCommand) {
|
|
44
|
+
|
|
45
|
+
kCommand.run(str, chunk, key);
|
|
46
|
+
|
|
47
|
+
if (kCommand.remove)
|
|
48
|
+
delete this.commands[str];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (str === 'ctrl+c') {
|
|
52
|
+
|
|
53
|
+
console.log(`Exiting ...`);
|
|
54
|
+
process.exit(0);
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
public input(str: string, run: TKeyboardCommand["run"], options: Omit<TKeyboardCommand, 'run'> = {}) {
|
|
64
|
+
this.commands[str] = { run, ...options }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public waitForInput(str: string): Promise<void> {
|
|
68
|
+
return new Promise((resolve) => {
|
|
69
|
+
this.commands[str] = {
|
|
70
|
+
run: () => resolve(),
|
|
71
|
+
remove: true
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export default new KeyboardCommands
|
package/client/app/index.ts
CHANGED
|
@@ -120,6 +120,8 @@ export default abstract class Application {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
public abstract handleError( error: CoreError | Error );
|
|
123
|
+
|
|
124
|
+
public abstract handleUpdate(): void;
|
|
123
125
|
|
|
124
126
|
// TODO: move on app side
|
|
125
127
|
public reportBug = (infos: TBugReportInfos) => fetch('/feedback/bug/ui', {
|
|
@@ -12,8 +12,6 @@ import { blurable, deepContains, focusContent } from '@client/utils/dom';
|
|
|
12
12
|
|
|
13
13
|
// Specific
|
|
14
14
|
import type Application from '../../app';
|
|
15
|
-
import Card, { Props as CardInfos } from './card';
|
|
16
|
-
import Button from '../Button';
|
|
17
15
|
|
|
18
16
|
/*----------------------------------
|
|
19
17
|
- TYPES: IMPORTATIONS
|
|
@@ -67,8 +65,6 @@ type DialogActions = {
|
|
|
67
65
|
|
|
68
66
|
show: (...args: TDialogShowArgs ) => TDialogControls,
|
|
69
67
|
|
|
70
|
-
confirm: (title: string, content: string | ComponentChild, defaultBtn: 'Yes'|'No') => TDialogControls,
|
|
71
|
-
|
|
72
68
|
loading: (title: string) => TDialogControls,
|
|
73
69
|
|
|
74
70
|
info: (...[title, content, boutons, options]: TToastShortcutArgs) => TDialogControls,
|
|
@@ -137,34 +133,11 @@ export const createDialog = (app: Application, isToast: boolean): DialogActions
|
|
|
137
133
|
content: Content
|
|
138
134
|
}
|
|
139
135
|
}
|
|
140
|
-
|
|
141
|
-
// modal.show({ title: 'supprimer', content: <>...</> })
|
|
142
|
-
if (Content.constructor === Object) {
|
|
143
|
-
|
|
144
|
-
const { content: CardContent, data = {}, ...propsToast } = Content as TOptsToast;
|
|
145
|
-
|
|
146
|
-
let cardContent: ComponentChild;
|
|
147
|
-
if (typeof CardContent === 'function') {
|
|
148
|
-
cardContent = <CardContent {...propsRendu} {...data} />
|
|
149
|
-
propsToast.boutons = null; // Component content = advanced content = should include buttons
|
|
150
|
-
} else {
|
|
151
|
-
cardContent = CardContent;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
render = (
|
|
155
|
-
<Card {...propsRendu} {...propsToast} isToast={isToast}>
|
|
156
|
-
{cardContent}
|
|
157
|
-
</Card>
|
|
158
|
-
)
|
|
159
|
-
|
|
160
136
|
// modal.show( ToastSupprimer )
|
|
161
137
|
// -> Content is a component rendering a Card
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
<Content {...propsRendu} isToast={isToast} />
|
|
166
|
-
)
|
|
167
|
-
}
|
|
138
|
+
render = (
|
|
139
|
+
<Content {...propsRendu} isToast={isToast} />
|
|
140
|
+
)
|
|
168
141
|
|
|
169
142
|
// Chargeur de données
|
|
170
143
|
/*if (('data' in ComposantCharge) && typeof ComposantCharge.data === 'function') {
|
|
@@ -202,25 +175,6 @@ export const createDialog = (app: Application, isToast: boolean): DialogActions
|
|
|
202
175
|
setToasts: undefined as unknown as DialogActions["setToasts"],
|
|
203
176
|
setModals: undefined as unknown as DialogActions["setModals"],
|
|
204
177
|
|
|
205
|
-
confirm: (title: string, content: string | ComponentChild, defaultBtn: 'Yes'|'No' = 'No') => show<boolean>(({ close }) => (
|
|
206
|
-
<div class="card col">
|
|
207
|
-
<header>
|
|
208
|
-
<h2>{title}</h2>
|
|
209
|
-
</header>
|
|
210
|
-
{typeof content === 'string' ? <p>{content}</p> : content}
|
|
211
|
-
<footer class="row fill">
|
|
212
|
-
<Button type={defaultBtn === 'Yes' ? 'primary' : undefined}
|
|
213
|
-
onClick={() => close(true)}>
|
|
214
|
-
Yes
|
|
215
|
-
</Button>
|
|
216
|
-
<Button type={defaultBtn === 'No' ? 'primary' : undefined}
|
|
217
|
-
onClick={() => close(false)}>
|
|
218
|
-
No
|
|
219
|
-
</Button>
|
|
220
|
-
</footer>
|
|
221
|
-
</div>
|
|
222
|
-
)),
|
|
223
|
-
|
|
224
178
|
loading: (title: string) => show({
|
|
225
179
|
title: title,
|
|
226
180
|
type: 'loading'
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { Link } from '../services/router/components/Link';
|
|
2
|
-
export { default as Button } from './Button';
|
|
1
|
+
export { Link } from '../services/router/components/Link';
|
|
@@ -10,7 +10,8 @@ import ReactDOM from 'react-dom';
|
|
|
10
10
|
import type {
|
|
11
11
|
default as ServerRouter,
|
|
12
12
|
Request as ServerRequest,
|
|
13
|
-
Response as ServerResponse
|
|
13
|
+
Response as ServerResponse,
|
|
14
|
+
TAnyRouter
|
|
14
15
|
} from '@server/services/router';
|
|
15
16
|
import type { TBasicSSrData } from '@server/services/router/response';
|
|
16
17
|
|
|
@@ -23,7 +24,6 @@ import { getLayout } from '@common/router/layouts';
|
|
|
23
24
|
import { getRegisterPageArgs, buildRegex } from '@common/router/register';
|
|
24
25
|
import { TFetcherList } from '@common/router/request/api';
|
|
25
26
|
import type { TFrontRenderer } from '@common/router/response/page';
|
|
26
|
-
import Button from '../../components/Button';
|
|
27
27
|
|
|
28
28
|
import App from '@client/app/component';
|
|
29
29
|
import type ClientApplication from '@client/app';
|
|
@@ -56,11 +56,11 @@ const LogPrefix = '[router]'
|
|
|
56
56
|
// Client router can handle Client requests AND Server requests (for pages only)
|
|
57
57
|
export type { default as ClientResponse, TRouterContext } from "./response";
|
|
58
58
|
|
|
59
|
-
export type Router = ClientRouter |
|
|
59
|
+
export type Router = ClientRouter | TAnyRouter;
|
|
60
60
|
|
|
61
|
-
export type Request = ClientRequest<ClientRouter> | ServerRequest<
|
|
61
|
+
export type Request = ClientRequest<ClientRouter> | ServerRequest<TAnyRouter>;
|
|
62
62
|
|
|
63
|
-
export type Response = ClientResponse<ClientRouter> | ServerResponse<
|
|
63
|
+
export type Response = ClientResponse<ClientRouter> | ServerResponse<TAnyRouter>;
|
|
64
64
|
|
|
65
65
|
/*----------------------------------
|
|
66
66
|
- TYPES: ROUTES LOADING
|
|
@@ -360,17 +360,7 @@ export default class ClientRouter<
|
|
|
360
360
|
} catch (e) {
|
|
361
361
|
console.error(`Failed to fetch the route ${route.chunk}`, e);
|
|
362
362
|
try {
|
|
363
|
-
this.
|
|
364
|
-
<div class="card col bg white w-3">
|
|
365
|
-
<h2>New Update Available!</h2>
|
|
366
|
-
<p>
|
|
367
|
-
A new version of the website is available. Please refresh the page to continue.
|
|
368
|
-
</p>
|
|
369
|
-
<Button type="primary" onClick={() => window.location.reload()}>
|
|
370
|
-
Reload
|
|
371
|
-
</Button>
|
|
372
|
-
</div>
|
|
373
|
-
));
|
|
363
|
+
this.app.handleUpdate();
|
|
374
364
|
} catch (error) {}
|
|
375
365
|
throw new Error("A new version of the website is available. Please refresh the page.");
|
|
376
366
|
}
|
package/common/errors/index.tsx
CHANGED
|
@@ -35,27 +35,6 @@ type TErrorDetails = {
|
|
|
35
35
|
origin?: string,
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/*----------------------------------
|
|
39
|
-
- TYPES: AUTH REQUIRED FEATURE
|
|
40
|
-
----------------------------------*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Global, augmentable feature catalog used to constrain the `feature` argument
|
|
44
|
-
* of `AuthRequired`.
|
|
45
|
-
*
|
|
46
|
-
* Default behavior (no augmentation): `feature` stays a free-form string.
|
|
47
|
-
* App behavior (augmentation provided by the host app): `feature` becomes a
|
|
48
|
-
* curated union of feature keys.
|
|
49
|
-
*/
|
|
50
|
-
declare global {
|
|
51
|
-
interface TAuthRequiredFeatureCatalog {}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
type TAuthRequiredFeatureKey = Extract<keyof TAuthRequiredFeatureCatalog, string>;
|
|
55
|
-
type TAuthRequiredFeature = [TAuthRequiredFeatureKey] extends [never]
|
|
56
|
-
? string
|
|
57
|
-
: TAuthRequiredFeatureKey;
|
|
58
|
-
|
|
59
38
|
/*----------------------------------
|
|
60
39
|
- TYPES: BUG REPORT
|
|
61
40
|
----------------------------------*/
|
|
@@ -179,46 +158,48 @@ export class InputErrorSchema extends CoreError {
|
|
|
179
158
|
}
|
|
180
159
|
}
|
|
181
160
|
|
|
182
|
-
export class AuthRequired extends CoreError {
|
|
161
|
+
export class AuthRequired<FeatureKeys extends string> extends CoreError {
|
|
183
162
|
public http = 401;
|
|
184
163
|
public title = "Authentication Required";
|
|
185
164
|
public static msgDefaut = "Please Login to Continue.";
|
|
186
165
|
|
|
187
|
-
public constructor(message: string, feature?: TAuthRequiredFeature);
|
|
188
|
-
public constructor(message: string, motivation: string | undefined, details: TErrorDetails | undefined);
|
|
189
166
|
public constructor(
|
|
190
167
|
message: string,
|
|
191
|
-
public feature
|
|
168
|
+
public feature: FeatureKeys,
|
|
169
|
+
public action: string,
|
|
192
170
|
details?: TErrorDetails
|
|
193
171
|
) {
|
|
194
172
|
super(message, details);
|
|
195
173
|
}
|
|
196
174
|
|
|
197
|
-
public json(): TJsonError & { feature
|
|
175
|
+
public json(): TJsonError & { feature: string, action: string } {
|
|
198
176
|
return {
|
|
199
177
|
...super.json(),
|
|
200
178
|
feature: this.feature,
|
|
179
|
+
action: this.action,
|
|
201
180
|
}
|
|
202
181
|
}
|
|
203
182
|
}
|
|
204
183
|
|
|
205
|
-
export class UpgradeRequired extends CoreError {
|
|
184
|
+
export class UpgradeRequired<FeatureKeys extends string> extends CoreError {
|
|
206
185
|
public http = 402;
|
|
207
186
|
public title = "Upgrade Required";
|
|
208
187
|
public static msgDefaut = "Please Upgrade to Continue.";
|
|
209
188
|
|
|
210
189
|
public constructor(
|
|
211
190
|
message: string,
|
|
212
|
-
public feature:
|
|
191
|
+
public feature: FeatureKeys,
|
|
192
|
+
public action: string,
|
|
213
193
|
details?: TErrorDetails
|
|
214
194
|
) {
|
|
215
195
|
super(message, details);
|
|
216
196
|
}
|
|
217
197
|
|
|
218
|
-
public json(): TJsonError & { feature: string } {
|
|
198
|
+
public json(): TJsonError & { feature: string, action: string } {
|
|
219
199
|
return {
|
|
220
200
|
...super.json(),
|
|
221
201
|
feature: this.feature,
|
|
202
|
+
action: this.action,
|
|
222
203
|
}
|
|
223
204
|
}
|
|
224
205
|
}
|
|
@@ -308,9 +289,9 @@ export const fromJson = ({ code, message, ...details }: TJsonError) => {
|
|
|
308
289
|
else
|
|
309
290
|
return new InputError( message, details );
|
|
310
291
|
|
|
311
|
-
case 401: return new AuthRequired( message,
|
|
292
|
+
case 401: return new AuthRequired( message, details["feature"], details["action"], details );
|
|
312
293
|
|
|
313
|
-
case 402: return new UpgradeRequired( message, details
|
|
294
|
+
case 402: return new UpgradeRequired( message, details["feature"], details["action"], details );
|
|
314
295
|
|
|
315
296
|
case 403: return new Forbidden( message, details );
|
|
316
297
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proteum",
|
|
3
3
|
"description": "Convenient TypeScript framework designed for Performance and Productivity.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
|
|
6
6
|
"repository": "git://github.com/gaetanlegac/proteum.git",
|
|
7
7
|
"license": "MIT",
|
|
@@ -12,74 +12,103 @@
|
|
|
12
12
|
"keywords": [
|
|
13
13
|
"framework"
|
|
14
14
|
],
|
|
15
|
+
"bin": {
|
|
16
|
+
"proteum": "cli/bin.js"
|
|
17
|
+
},
|
|
15
18
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
19
|
+
"@babel/cli": "^7.15.4",
|
|
20
|
+
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
|
21
|
+
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
22
|
+
"@babel/plugin-proposal-private-methods": "^7.14.5",
|
|
23
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.15.4",
|
|
24
|
+
"@babel/plugin-transform-react-constant-elements": "^7.14.5",
|
|
25
|
+
"@babel/preset-env": "^7.15.6",
|
|
26
|
+
"@babel/preset-react": "^7.14.5",
|
|
27
|
+
"@babel/preset-typescript": "^7.15.0",
|
|
28
|
+
"@prefresh/webpack": "^3.3.2",
|
|
20
29
|
"@prisma/client": "^6.5.0",
|
|
30
|
+
"@tailwindcss/postcss": "^4.1.17",
|
|
21
31
|
"accepts": "^1.3.7",
|
|
22
|
-
"activity-detector": "^3.0.0",
|
|
23
32
|
"ansi-to-html": "^0.7.1",
|
|
24
|
-
"
|
|
33
|
+
"autoprefixer": "^10.4.21",
|
|
25
34
|
"aws-sdk": "^2.1415.0",
|
|
35
|
+
"babel-loader": "^10.0.0",
|
|
36
|
+
"babel-plugin-glob-import": "^0.0.9-1",
|
|
37
|
+
"babel-plugin-transform-imports": "^2.0.0",
|
|
38
|
+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
39
|
+
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
26
40
|
"bowser": "^2.11.0",
|
|
27
|
-
"
|
|
41
|
+
"brotli-webpack-plugin": "^1.1.0",
|
|
42
|
+
"browser-sync": "^2.27.5",
|
|
28
43
|
"cli-highlight": "^2.1.11",
|
|
29
44
|
"compression": "^1.7.4",
|
|
45
|
+
"compression-webpack-plugin": "^8.0.1",
|
|
30
46
|
"cookie-parser": "^1.4.5",
|
|
31
47
|
"core-js": "^3.18.1",
|
|
32
48
|
"cors": "^2.8.5",
|
|
33
49
|
"cron-parser": "^4.0.0",
|
|
50
|
+
"css-loader": "^6.2.0",
|
|
51
|
+
"css-minimizer-webpack-plugin": "^7.0.4",
|
|
34
52
|
"dayjs": "^1.11.5",
|
|
35
|
-
"deep-extend": "^0.6.0",
|
|
36
53
|
"dottie": "^2.0.2",
|
|
37
54
|
"escape-regexp": "^0.0.1",
|
|
38
55
|
"express": "^4.17.1",
|
|
39
56
|
"express-csp-header": "^5.0.0",
|
|
40
57
|
"express-fileupload": "^1.2.1",
|
|
41
58
|
"fast-safe-stringify": "^2.1.1",
|
|
42
|
-
"
|
|
43
|
-
"formattor": "^0.0.2",
|
|
59
|
+
"favicons": "^7.2.0",
|
|
44
60
|
"fs-extra": "^10.1.0",
|
|
45
61
|
"got": "^11.8.3",
|
|
46
|
-
"handlebars": "^4.7.7",
|
|
47
62
|
"helmet": "^4.6.0",
|
|
48
63
|
"history": "^5.0.1",
|
|
49
64
|
"hpp": "^0.2.3",
|
|
50
65
|
"human-interval": "^2.0.1",
|
|
66
|
+
"image-minimizer-webpack-plugin": "^4.1.4",
|
|
67
|
+
"imagemin": "^9.0.1",
|
|
68
|
+
"imagemin-svgo": "^10.0.0",
|
|
69
|
+
"imagemin-webp": "^6.0.0",
|
|
51
70
|
"intl": "^1.2.5",
|
|
52
71
|
"iso-639-1": "^2.1.9",
|
|
53
|
-
"
|
|
54
|
-
"jsdom": "^25.0.1",
|
|
72
|
+
"json5": "^2.2.0",
|
|
55
73
|
"jsonwebtoken": "^8.5.1",
|
|
56
|
-
"
|
|
74
|
+
"less-loader": "^10.0.1",
|
|
57
75
|
"load-script": "^2.0.0",
|
|
58
76
|
"locale": "^0.1.0",
|
|
59
77
|
"markdown-it": "^13.0.1",
|
|
60
78
|
"md5": "^2.3.0",
|
|
61
79
|
"mime-types": "^2.1.35",
|
|
80
|
+
"mini-css-extract-plugin": "^2.2.2",
|
|
62
81
|
"module-alias": "^2.2.2",
|
|
63
82
|
"mysql2": "^2.3.0",
|
|
83
|
+
"node-cmd": "^5.0.0",
|
|
84
|
+
"null-loader": "^4.0.1",
|
|
64
85
|
"object-sizeof": "^1.6.3",
|
|
65
86
|
"path-to-regexp": "^6.2.0",
|
|
66
|
-
"
|
|
87
|
+
"postcss-loader": "^8.2.0",
|
|
67
88
|
"preact": "^10.27.1",
|
|
68
89
|
"preact-render-to-string": "^6.6.1",
|
|
69
90
|
"prettier": "^3.3.3",
|
|
70
|
-
"
|
|
71
|
-
"react-
|
|
72
|
-
"react-textarea-autosize": "^8.5.9",
|
|
91
|
+
"prompts": "^2.4.2",
|
|
92
|
+
"react-dev-utils": "^11.0.4",
|
|
73
93
|
"regenerator-runtime": "^0.13.9",
|
|
94
|
+
"replace-once": "^1.0.0",
|
|
74
95
|
"request": "^2.88.2",
|
|
96
|
+
"responsive-loader": "^3.1.2",
|
|
97
|
+
"serialize-javascript": "^6.0.2",
|
|
98
|
+
"sharp": "^0.34.3",
|
|
75
99
|
"slugify": "^1.6.6",
|
|
76
100
|
"source-map-support": "^0.5.21",
|
|
77
|
-
"sql-formatter": "^4.0.2",
|
|
78
101
|
"stopword": "^3.1.1",
|
|
102
|
+
"tailwindcss": "^4.1.17",
|
|
103
|
+
"terser-webpack-plugin": "^5.2.4",
|
|
104
|
+
"ts-alias": "^0.0.7",
|
|
105
|
+
"ts-node": "^10.9.1",
|
|
79
106
|
"tslog": "^4.9.1",
|
|
80
107
|
"uuid": "^8.3.2",
|
|
81
|
-
"uuid-by-string": "^3.0.4",
|
|
82
108
|
"validator": "^13.7.0",
|
|
109
|
+
"webpack": "^5.104.1",
|
|
110
|
+
"webpack-assets-manifest": "^5.0.6",
|
|
111
|
+
"webpack-bundle-analyzer": "^4.4.2",
|
|
83
112
|
"ws": "^8.2.2",
|
|
84
113
|
"yaml": "^1.10.2",
|
|
85
114
|
"yargs-parser": "^21.1.1",
|
|
@@ -88,18 +117,25 @@
|
|
|
88
117
|
"zod": "^4.1.5"
|
|
89
118
|
},
|
|
90
119
|
"devDependencies": {
|
|
120
|
+
"@types/babel__core": "^7.1.16",
|
|
121
|
+
"@types/babel__preset-env": "^7.9.6",
|
|
91
122
|
"@types/cookie": "^0.4.1",
|
|
92
123
|
"@types/express": "^4.17.13",
|
|
124
|
+
"@types/favicons": "^6.2.2",
|
|
93
125
|
"@types/fs-extra": "^9.0.12",
|
|
94
126
|
"@types/markdown-it": "^12.2.3",
|
|
95
127
|
"@types/mime-types": "^2.1.1",
|
|
96
128
|
"@types/node": "^16.9.1",
|
|
97
129
|
"@types/nodemailer": "^6.4.4",
|
|
130
|
+
"@types/pg": "^8.6.1",
|
|
131
|
+
"@types/pg-escape": "^0.2.1",
|
|
132
|
+
"@types/prompts": "^2.0.14",
|
|
98
133
|
"@types/sharp": "^0.31.1",
|
|
99
134
|
"@types/universal-analytics": "^0.4.5",
|
|
100
135
|
"@types/webpack-env": "^1.16.2",
|
|
101
136
|
"@types/ws": "^7.4.7",
|
|
102
137
|
"@types/yargs-parser": "^21.0.0",
|
|
103
|
-
"schema-dts": "^1.1.2"
|
|
138
|
+
"schema-dts": "^1.1.2",
|
|
139
|
+
"speed-measure-webpack-v5-plugin": "^1.5.2"
|
|
104
140
|
}
|
|
105
141
|
}
|
|
@@ -15,6 +15,8 @@ import yaml from 'yaml';
|
|
|
15
15
|
import type { TDomainsList } from '@common/router';
|
|
16
16
|
import type { TLogProfile } from './console';
|
|
17
17
|
|
|
18
|
+
declare const PROTEUM_ROUTER_PORT_OVERRIDE: number | null;
|
|
19
|
+
|
|
18
20
|
/*----------------------------------
|
|
19
21
|
- TYPES
|
|
20
22
|
----------------------------------*/
|
|
@@ -114,6 +116,16 @@ export type AppConfig = {
|
|
|
114
116
|
|
|
115
117
|
const debug = false;
|
|
116
118
|
|
|
119
|
+
const getRouterPortOverride = () => {
|
|
120
|
+
if (
|
|
121
|
+
typeof PROTEUM_ROUTER_PORT_OVERRIDE !== 'undefined'
|
|
122
|
+
&& PROTEUM_ROUTER_PORT_OVERRIDE !== null
|
|
123
|
+
)
|
|
124
|
+
return PROTEUM_ROUTER_PORT_OVERRIDE;
|
|
125
|
+
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
|
|
117
129
|
/*----------------------------------
|
|
118
130
|
- LOADE
|
|
119
131
|
----------------------------------*/
|
|
@@ -138,8 +150,15 @@ export default class ConfigParser {
|
|
|
138
150
|
console.log("[app] Using environment:", process.env.NODE_ENV);
|
|
139
151
|
const envFileName = this.appDir + '/env.yaml';
|
|
140
152
|
const envFile = this.loadYaml( envFileName );
|
|
153
|
+
const routerPortOverride = getRouterPortOverride();
|
|
141
154
|
return {
|
|
142
155
|
...envFile,
|
|
156
|
+
router: routerPortOverride === undefined
|
|
157
|
+
? envFile.router
|
|
158
|
+
: {
|
|
159
|
+
...envFile.router,
|
|
160
|
+
port: routerPortOverride
|
|
161
|
+
},
|
|
143
162
|
version: BUILD_DATE
|
|
144
163
|
}
|
|
145
164
|
}
|
|
@@ -200,4 +219,4 @@ export default class ConfigParser {
|
|
|
200
219
|
deepExtend(fileConfig, loadYaml(fullpath));
|
|
201
220
|
|
|
202
221
|
}
|
|
203
|
-
}*/
|
|
222
|
+
}*/
|
|
@@ -258,7 +258,7 @@ export default class Console {
|
|
|
258
258
|
if (filepath.startsWith( projectRoot ))
|
|
259
259
|
filepath = filepath.substring( projectRoot.length )
|
|
260
260
|
|
|
261
|
-
const frameworkRoot = '/node_modules/
|
|
261
|
+
const frameworkRoot = '/node_modules/proteum/';
|
|
262
262
|
if (filepath.startsWith( frameworkRoot ))
|
|
263
263
|
filepath = '@' + filepath.substring( frameworkRoot.length )
|
|
264
264
|
|