5htp 0.6.1 → 0.6.2-5

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/app/index.ts CHANGED
@@ -51,6 +51,8 @@ export class App {
51
51
 
52
52
  public packageJson: {[key: string]: any};
53
53
 
54
+ public buildId: number = Date.now();
55
+
54
56
  public paths = {
55
57
 
56
58
  root: cli.paths.appRoot,
@@ -67,7 +69,10 @@ export class App {
67
69
  generated: path.join( cli.paths.appRoot, 'server', '.generated'),
68
70
  configs: path.join( cli.paths.appRoot, 'server', 'app')
69
71
  },
70
-
72
+ common: {
73
+ generated: path.join( cli.paths.appRoot, 'common', '.generated')
74
+ },
75
+
71
76
  withAlias: (filename: string, side: TAppSide) =>
72
77
  this.aliases[side].apply(filename),
73
78
 
@@ -27,7 +27,7 @@ import identityAssets from './identite';
27
27
  import cli from '../..';
28
28
 
29
29
  // Type
30
- import type App from '../../app';
30
+ import type { App } from '../../app';
31
31
 
32
32
  const debug = false;
33
33
 
@@ -41,10 +41,13 @@ export type TCompileMode = 'dev' | 'prod'
41
41
  - BASE CONFIG
42
42
  ----------------------------------*/
43
43
 
44
- export default function createCommonConfig( app: App, side: TAppSide, mode: TCompileMode ): webpack.Configuration {
44
+ export default function createCommonConfig(
45
+ app: App,
46
+ side: TAppSide,
47
+ mode: TCompileMode,
48
+ ): webpack.Configuration {
45
49
 
46
50
  const dev = mode === 'dev';
47
- const buildId = Date.now();
48
51
  const config: webpack.Configuration = {
49
52
 
50
53
  // Project root
@@ -79,14 +82,14 @@ export default function createCommonConfig( app: App, side: TAppSide, mode: TCom
79
82
 
80
83
  // Application
81
84
  BUILD_DATE: JSON.stringify(dayjs().format('YY.MM.DD-HH.mm')),
82
- BUILD_ID: JSON.stringify(buildId),
85
+ BUILD_ID: JSON.stringify(app.buildId),
83
86
  APP_PATH: JSON.stringify(app.paths.root),
84
87
  APP_NAME: JSON.stringify(app.identity.web.title),
85
88
 
86
89
  }),
87
90
 
88
91
  new PluginIndexage(side === 'client' ? {
89
- 'icones-svg': new IconesSvg(app, buildId),
92
+ 'icones-svg': new IconesSvg(app),
90
93
  } : {
91
94
  //'injection-dependances': new InjectDeps,
92
95
  }),
@@ -34,7 +34,7 @@ export default class IconesSVG extends Indexeur {
34
34
  private cacheTypes: string;
35
35
  private cacheIndex: string;
36
36
 
37
- public constructor( app: App, private buildId: number, private debug?: boolean ) {
37
+ public constructor( private app: App, private debug?: boolean ) {
38
38
  super();
39
39
 
40
40
  this.formats = ['woff2'];
@@ -182,7 +182,7 @@ export default class IconesSVG extends Indexeur {
182
182
  // Enregistrement fichiers
183
183
  for (const format of this.formats)
184
184
  fs.outputFileSync(this.dossierSortie + 'icons.' + format, result[ format ]);
185
- fs.outputFileSync(this.dossierSortie + 'icons.css', result.template?.replace('icons.woff2', 'icons.woff2?' + this.buildId));
185
+ fs.outputFileSync(this.dossierSortie + 'icons.css', result.template?.replace('icons.woff2', 'icons.woff2?' + this.app.buildId));
186
186
 
187
187
  fs.outputFileSync(this.cacheTypes, 'export type TIcones = ' + typeIcones.join('|') );
188
188
 
package/compiler/index.ts CHANGED
@@ -267,7 +267,7 @@ export default class Compiler {
267
267
  const appClassIdentifier = app.identity.identifier;
268
268
  const containerServices = app.containerServices.map( s => "'" + s + "'").join('|');
269
269
 
270
- // Output the services index
270
+ // @/client/.generated/services.d.ts
271
271
  fs.outputFileSync(
272
272
  path.join( app.paths.client.generated, 'services.d.ts'),
273
273
  `declare module "@app" {
@@ -303,6 +303,7 @@ declare namespace preact.JSX {
303
303
  `
304
304
  );
305
305
 
306
+ // @/client/.generated/context.ts
306
307
  fs.outputFileSync(
307
308
  path.join( app.paths.client.generated, 'context.ts'),
308
309
  `// TODO: move it into core (but how to make sure usecontext returns ${appClassIdentifier}'s context ?)
@@ -333,6 +334,15 @@ export type ClientContext = (
333
334
  export const ReactClientContext = React.createContext<ClientContext>({} as ClientContext);
334
335
  export default (): ClientContext => React.useContext<ClientContext>(ReactClientContext);`);
335
336
 
337
+ // @/common/.generated/services.d.ts
338
+ fs.outputFileSync(
339
+ path.join( app.paths.common.generated, 'services.d.ts'),
340
+ `declare module '@models/types' {
341
+ export * from '@/var/prisma/index';
342
+ }`
343
+ );
344
+
345
+ // @/server/.generated/app.ts
336
346
  fs.outputFileSync(
337
347
  path.join( app.paths.server.generated, 'app.ts'),
338
348
  `import { Application } from '@server/app/index';
@@ -359,6 +369,7 @@ export default class ${appClassIdentifier} extends Application {
359
369
 
360
370
  `);
361
371
 
372
+ // @/server/.generated/services.d.ts
362
373
  fs.outputFileSync(
363
374
  path.join( app.paths.server.generated, 'services.d.ts'),
364
375
  `type InstalledServices = import('./services').Services;
@@ -15,7 +15,7 @@ import cli from '@cli';
15
15
  import createCommonConfig, { TCompileMode, regex } from '../common';
16
16
 
17
17
  // Type
18
- import type App from '../../app';
18
+ import type { App } from '../../app';
19
19
 
20
20
  /*const getCorePluginsList = (app: App,) => {
21
21
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.6.1",
4
+ "version": "0.6.2-5",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp.git",
7
7
  "license": "MIT",
@@ -54,7 +54,10 @@
54
54
  "dayjs": "^1.11.5",
55
55
  "favicons": "^7.2.0",
56
56
  "filesize": "^8.0.3",
57
+ "image-minimizer-webpack-plugin": "^4.1.4",
58
+ "imagemin": "^9.0.1",
57
59
  "imagemin-svgo": "^10.0.0",
60
+ "imagemin-webp": "^6.0.0",
58
61
  "json5": "^2.2.0",
59
62
  "less-loader": "^10.0.1",
60
63
  "less-vars-to-js": "^1.3.0",
@@ -67,7 +70,9 @@
67
70
  "prompts": "^2.4.2",
68
71
  "react-dev-utils": "^11.0.4",
69
72
  "replace-once": "^1.0.0",
73
+ "responsive-loader": "^3.1.2",
70
74
  "serialize-javascript": "^6.0.2",
75
+ "sharp": "^0.34.3",
71
76
  "speed-measure-webpack-plugin": "^1.5.0",
72
77
  "terser-webpack-plugin": "^5.2.4",
73
78
  "ts-alias": "^0.0.7",
@@ -88,11 +93,6 @@
88
93
  "@types/node": "^16.9.1",
89
94
  "@types/nodemailer": "^6.4.4",
90
95
  "@types/prompts": "^2.0.14",
91
- "@types/webpack-env": "^1.16.2",
92
- "image-minimizer-webpack-plugin": "^4.1.4",
93
- "imagemin": "^9.0.1",
94
- "imagemin-webp": "^6.0.0",
95
- "responsive-loader": "^3.1.2",
96
- "sharp": "^0.34.3"
96
+ "@types/webpack-env": "^1.16.2"
97
97
  }
98
98
  }