5htp 0.0.6 → 0.0.8

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.
Files changed (53) hide show
  1. package/package.json +4 -2
  2. package/readme.md +30 -0
  3. package/skeleton/.github/workflows/ci.yml +93 -0
  4. package/skeleton/.github/workflows/ecs-task.json +77 -0
  5. package/skeleton/Dockerfile +20 -0
  6. package/skeleton/docker-compose.yml +45 -0
  7. package/skeleton/identity.yaml +17 -0
  8. package/skeleton/package-lock.json +6139 -0
  9. package/skeleton/package.json +30 -0
  10. package/skeleton/src/client/assets/identity/logo.svg +64 -0
  11. package/skeleton/src/client/assets/identity/logoAndText.svg +105 -0
  12. package/skeleton/src/client/assets/illustration/launch.jpg +0 -0
  13. package/skeleton/src/client/assets/logos/google-play-store.svg +1 -0
  14. package/skeleton/src/client/assets/logos/googleauth.svg +9 -0
  15. package/skeleton/src/client/assets/patterns/interlaced.png +0 -0
  16. package/skeleton/src/client/assets/theme.less +278 -0
  17. package/skeleton/src/client/components/LoginModal.tsx +45 -0
  18. package/skeleton/src/client/pages/app/_layout/index.less +20 -0
  19. package/skeleton/src/client/pages/app/_layout/index.tsx +33 -0
  20. package/skeleton/src/client/pages/app/index.tsx +57 -0
  21. package/skeleton/src/client/pages/landing/_layout/index.less +145 -0
  22. package/skeleton/src/client/pages/landing/_layout/index.tsx +63 -0
  23. package/skeleton/src/client/pages/landing/index.tsx +73 -0
  24. package/skeleton/src/client/pages/preload.json +3 -0
  25. package/skeleton/src/client/tsconfig.json +32 -0
  26. package/skeleton/src/common/tsconfig.json +10 -0
  27. package/skeleton/src/server/config.ts +125 -0
  28. package/skeleton/src/server/index.ts +23 -0
  29. package/skeleton/src/server/routes/general.ts +66 -0
  30. package/skeleton/src/server/services/auth/index.ts +88 -0
  31. package/skeleton/src/server/tsconfig.json +34 -0
  32. package/src/{utils → app}/config.ts +20 -2
  33. package/src/app/index.ts +75 -0
  34. package/src/commands/build.ts +6 -1
  35. package/src/commands/deploy/web.ts +3 -3
  36. package/src/commands/dev.ts +11 -9
  37. package/src/commands/init.ts +85 -0
  38. package/src/compiler/client/identite.ts +7 -5
  39. package/src/compiler/client/index.ts +21 -18
  40. package/src/compiler/common/babel/index.ts +209 -201
  41. package/src/compiler/common/babel/plugins/injection-dependances/index.ts +2 -2
  42. package/src/compiler/common/babel/plugins/pages.ts +4 -2
  43. package/src/compiler/common/files/autres.ts +3 -1
  44. package/src/compiler/common/files/images.ts +2 -1
  45. package/src/compiler/common/files/style.ts +6 -4
  46. package/src/compiler/common/index.ts +13 -7
  47. package/src/compiler/common/plugins/indexage/icones-svg/index.ts +45 -37
  48. package/src/compiler/common/plugins/indexage/injection-dependances/index.ts +1 -1
  49. package/src/compiler/index.ts +24 -3
  50. package/src/compiler/server/index.ts +19 -19
  51. package/src/index.ts +4 -18
  52. package/src/paths.ts +12 -33
  53. package/tsconfig.json +1 -2
@@ -11,8 +11,8 @@ import * as types from '@babel/types'
11
11
  import PluginIndexage from '../plugins/indexage';
12
12
  import BabelGlobImports from './plugins/importations';
13
13
 
14
- import cli from '../../..';
15
- import { TAppSide } from '../../..';
14
+ import cli from '@cli';
15
+ import type { TAppSide, default as App } from '@cli/app';
16
16
 
17
17
  // Const
18
18
  const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
@@ -23,239 +23,247 @@ const routesToPreload = require( cli.paths.appRoot + '/src/client/pages/preload.
23
23
  /*----------------------------------
24
24
  - REGLES
25
25
  ----------------------------------*/
26
- module.exports = (side: TAppSide, dev: boolean): webpack.RuleSetRule[] => ([{
27
- loader: 'babel-loader',
28
- options: {
29
-
30
- // https://github.com/babel/babel-loader#options
26
+ module.exports = (app: App, side: TAppSide, dev: boolean): webpack.RuleSetRule[] => {
31
27
 
32
- // ATTENTION: Ne prend pas toujours compte des màj des plugins babel
33
- cacheDirectory: cli.args.cache === true,
34
- // Désactive car ralenti compilation
35
- cacheCompression: false,
28
+ const pkg = {
29
+ app: require(app.paths.root + '/package.json'),
30
+ core: require(cli.paths.core.root + '/package.json'),
31
+ }
32
+
33
+ return [{
34
+ loader: 'babel-loader',
35
+ options: {
36
+
37
+ // https://github.com/babel/babel-loader#options
36
38
 
37
- metadataSubscribers: [
38
- PluginIndexage.metadataContextFunctionName
39
- ],
39
+ // ATTENTION: Ne prend pas toujours compte des màj des plugins babel
40
+ cacheDirectory: cli.args.cache === true,
41
+ // Désactive car ralenti compilation
42
+ cacheCompression: false,
40
43
 
41
- compact: !dev,
44
+ metadataSubscribers: [
45
+ PluginIndexage.metadataContextFunctionName
46
+ ],
42
47
 
43
- // https://babeljs.io/docs/usage/options/
44
- babelrc: false,
45
- presets: [
48
+ compact: !dev,
46
49
 
47
- // https://github.com/babel/babel-preset-env
48
- [require('@babel/preset-env'), side === 'client' ? {
50
+ // https://babeljs.io/docs/usage/options/
51
+ babelrc: false,
52
+ presets: [
49
53
 
50
- // Ajoute automatiquement les polyfills babel
51
- // https://stackoverflow.com/a/61517521/12199605
52
- "useBuiltIns": "usage", // alternative mode: "entry"
53
- "corejs": 3, // default would be 2
54
+ // https://github.com/babel/babel-preset-env
55
+ [require('@babel/preset-env'), side === 'client' ? {
54
56
 
55
- targets: {
56
- browsers: cli.pkg.app.browserslist,
57
- },
58
- forceAllTransforms: !dev, // for UglifyJS
59
- modules: false,
60
- debug: false,
61
- } : {
62
- targets: {
63
- node: true,//pkg.engines.node.match(/(\d+\.?)+/)[0],
64
- },
65
- modules: false,
66
- useBuiltIns: false,
67
- debug: false,
68
- }],
57
+ // Ajoute automatiquement les polyfills babel
58
+ // https://stackoverflow.com/a/61517521/12199605
59
+ "useBuiltIns": "usage", // alternative mode: "entry"
60
+ "corejs": 3, // default would be 2
69
61
 
70
- [require("@babel/preset-typescript"), {
71
- useDefineForClassFields: true,
72
- //jsxPragma: "h"
73
- }],
62
+ targets: {
63
+ browsers: pkg.app.browserslist,
64
+ },
65
+ forceAllTransforms: !dev, // for UglifyJS
66
+ modules: false,
67
+ debug: false,
68
+ } : {
69
+ targets: {
70
+ node: true,//pkg.engines.node.match(/(\d+\.?)+/)[0],
71
+ },
72
+ modules: false,
73
+ useBuiltIns: false,
74
+ debug: false,
75
+ }],
74
76
 
75
- // JSX
76
- // https://github.com/babel/babel/tree/master/packages/babel-preset-react
77
- [require('@babel/preset-react'), {
78
- //pragma: "h"
79
- }],
77
+ [require("@babel/preset-typescript"), {
78
+ useDefineForClassFields: true,
79
+ //jsxPragma: "h"
80
+ }],
80
81
 
81
- ],
82
- plugins: [
82
+ // JSX
83
+ // https://github.com/babel/babel/tree/master/packages/babel-preset-react
84
+ [require('@babel/preset-react'), {
85
+ //pragma: "h"
86
+ }],
83
87
 
84
- // NOTE: On résoud les plugins et presets directement ici
85
- // Autrement, babel-loader les cherchera dans projet/node_modules
88
+ ],
89
+ plugins: [
86
90
 
91
+ // NOTE: On résoud les plugins et presets directement ici
92
+ // Autrement, babel-loader les cherchera dans projet/node_modules
87
93
 
88
- [require("@babel/plugin-proposal-decorators"), { "legacy": true }],
89
94
 
90
- [require('@babel/plugin-proposal-class-properties'), { "loose": true }],
95
+ [require("@babel/plugin-proposal-decorators"), { "legacy": true }],
91
96
 
92
- [require('@babel/plugin-proposal-private-methods'), { "loose": true }],
97
+ [require('@babel/plugin-proposal-class-properties'), { "loose": true }],
93
98
 
94
- // Masque erreur associée à @babel/plugin-proposal-decorators legacy: true
95
- [require('@babel/plugin-proposal-private-property-in-object'), { "loose": true }],
99
+ [require('@babel/plugin-proposal-private-methods'), { "loose": true }],
96
100
 
97
- ...(dev ? [
101
+ // Masque erreur associée à @babel/plugin-proposal-decorators legacy: true
102
+ [require('@babel/plugin-proposal-private-property-in-object'), { "loose": true }],
98
103
 
99
- ...(side === 'client' ? [
104
+ ...(dev ? [
100
105
 
101
- // HMR Preact avec support des hooks
102
- //['@prefresh/babel-plugin'],
106
+ ...(side === 'client' ? [
103
107
 
104
- ] : [])
108
+ // HMR Preact avec support des hooks
109
+ //['@prefresh/babel-plugin'],
105
110
 
106
- ] : [
111
+ ] : [])
107
112
 
108
- // Les 3 plugins suivants sont tirés de https://github.com/jamiebuilds/babel-react-optimize
113
+ ] : [
109
114
 
110
- // Remove unnecessary React propTypes from the production build
111
- // https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types
112
- [require('babel-plugin-transform-react-remove-prop-types')],
113
- // Treat React JSX elements as value types and hoist them to the highest scope
114
- // https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements
115
- [require('@babel/plugin-transform-react-constant-elements')],
115
+ // Les 3 plugins suivants sont tirés de https://github.com/jamiebuilds/babel-react-optimize
116
116
 
117
- // Pour du tree shaking manuel
118
- // https://www.npmjs.com/package/babel-plugin-transform-imports
119
- [require("babel-plugin-transform-imports"), {
120
- "lodash": {
121
- "transform": "lodash/${member}",
122
- "preventFullImport": true
123
- }
124
- }]
125
- ]),
126
-
127
- BabelGlobImports({
128
- debug: false,
129
- removeAliases: (source: string) => cli.paths.withoutAlias(source, side)
130
- }, [{
131
- test: (request) => {
132
- if (request.source === '@models') {
133
- request.source = cli.paths.app.src + '/server/models/**/*.ts';
134
- return true;
135
- }
136
- return false;
137
- },
138
- replace: (request, matches, t) => {
139
- // Preserve default behavior
140
- }
141
- }, {
142
- test: (request) => (
143
- side === 'client'
144
- &&
145
- (
146
- request.source === '@/client/pages/**/*.tsx'
147
- ||
148
- request.source === '@client/pages/**/*.tsx'
149
- )
150
- &&
151
- request.type === 'import'
152
- ),
153
- replace: (request, matches, t) => {
154
-
155
- if (!('default' in request) || request.default === undefined)
156
- return;
157
-
158
- const imports: types.ImportDeclaration[] = [];
159
-
160
- // const routes = {
161
- // <chunkId1>: () => import(/* webpackChunkName: '<chunkId>' */ "<file>"),
162
- // <chunkId2>: () => require("<file>").default,
163
- // }
164
-
165
- const pageLoaders: types.ObjectProperty[] = [];
166
- for (const file of matches) {
167
-
168
- // Exclude layouts
169
- if (file.filename.includes("/_layout/")) {
170
- //console.log("Exclude", file, 'from pages loaders (its a layout)');
171
- continue;
172
- }
117
+ // Remove unnecessary React propTypes from the production build
118
+ // https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types
119
+ [require('babel-plugin-transform-react-remove-prop-types')],
120
+ // Treat React JSX elements as value types and hoist them to the highest scope
121
+ // https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements
122
+ [require('@babel/plugin-transform-react-constant-elements')],
173
123
 
174
- // Excliude components
175
- const filename = path.basename( file.filename );
176
- if (alphabet.includes(filename[0]) && filename[0] === filename[0].toUpperCase()) {
177
- //console.log("Exclude", file, 'from pages loaders (its a component)');
178
- continue;
124
+ // Pour du tree shaking manuel
125
+ // https://www.npmjs.com/package/babel-plugin-transform-imports
126
+ [require("babel-plugin-transform-imports"), {
127
+ "lodash": {
128
+ "transform": "lodash/${member}",
129
+ "preventFullImport": true
179
130
  }
180
-
181
- // Page config
182
- const { chunkId } = cli.paths.getPageChunk(file.filename);
183
- const preloadPage = routesToPreload.includes(chunkId);
184
-
185
- // Import type according to preloading option
186
- if (preloadPage) {
187
-
188
- // import <chunkId> from "<file>";
189
- imports.push(
190
- t.importDeclaration(
191
- [t.importDefaultSpecifier( t.identifier(chunkId) )],
192
- t.stringLiteral(file.filename)
193
- )
194
- );
195
-
196
- // { <chunkId>: <chunkId> }
197
- pageLoaders.push(
198
- t.objectProperty(
199
- t.stringLiteral(chunkId),
200
- t.identifier(chunkId)
201
- )
202
- );
203
-
204
- } else {
205
-
206
- // <chunkId>: () => ...
207
- pageLoaders.push(
208
- t.objectProperty(
209
-
210
- t.stringLiteral(chunkId),
211
- // () => import(/* webpackChunkName: '<chunkId>' */ "<file>")
212
- t.arrowFunctionExpression([], t.callExpression(
213
-
214
- t.import(), [t.addComment(
215
- t.stringLiteral(file.filename),
216
- "leading",
217
- "webpackChunkName: '" + chunkId + "'"
218
- )]
219
- ))
220
- )
221
- )
131
+ }]
132
+ ]),
133
+
134
+ BabelGlobImports({
135
+ debug: false,
136
+ removeAliases: (source: string) => app.paths.withoutAlias(source, side)
137
+ }, [{
138
+ test: (request) => {
139
+ if (request.source === '@models') {
140
+ request.source = app.paths.src + '/server/models/**/*.ts';
141
+ return true;
222
142
  }
143
+ return false;
144
+ },
145
+ replace: (request, matches, t) => {
146
+ // Preserve default behavior
223
147
  }
148
+ }, {
149
+ test: (request) => (
150
+ side === 'client'
151
+ &&
152
+ (
153
+ request.source === '@/client/pages/**/*.tsx'
154
+ ||
155
+ request.source === '@client/pages/**/*.tsx'
156
+ )
157
+ &&
158
+ request.type === 'import'
159
+ ),
160
+ replace: (request, matches, t) => {
161
+
162
+ if (!('default' in request) || request.default === undefined)
163
+ return;
164
+
165
+ const imports: types.ImportDeclaration[] = [];
166
+
167
+ // const routes = {
168
+ // <chunkId1>: () => import(/* webpackChunkName: '<chunkId>' */ "<file>"),
169
+ // <chunkId2>: () => require("<file>").default,
170
+ // }
171
+
172
+ const pageLoaders: types.ObjectProperty[] = [];
173
+ for (const file of matches) {
174
+
175
+ // Exclude layouts
176
+ if (file.filename.includes("/_layout/")) {
177
+ //console.log("Exclude", file, 'from pages loaders (its a layout)');
178
+ continue;
179
+ }
180
+
181
+ // Excliude components
182
+ const filename = path.basename( file.filename );
183
+ if (alphabet.includes(filename[0]) && filename[0] === filename[0].toUpperCase()) {
184
+ //console.log("Exclude", file, 'from pages loaders (its a component)');
185
+ continue;
186
+ }
187
+
188
+ // Page config
189
+ const { chunkId } = cli.paths.getPageChunk(app, file.filename);
190
+ const preloadPage = routesToPreload.includes(chunkId);
191
+
192
+ // Import type according to preloading option
193
+ if (preloadPage) {
194
+
195
+ // import <chunkId> from "<file>";
196
+ imports.push(
197
+ t.importDeclaration(
198
+ [t.importDefaultSpecifier( t.identifier(chunkId) )],
199
+ t.stringLiteral(file.filename)
200
+ )
201
+ );
202
+
203
+ // { <chunkId>: <chunkId> }
204
+ pageLoaders.push(
205
+ t.objectProperty(
206
+ t.stringLiteral(chunkId),
207
+ t.identifier(chunkId)
208
+ )
209
+ );
210
+
211
+ } else {
212
+
213
+ // <chunkId>: () => ...
214
+ pageLoaders.push(
215
+ t.objectProperty(
216
+
217
+ t.stringLiteral(chunkId),
218
+ // () => import(/* webpackChunkName: '<chunkId>' */ "<file>")
219
+ t.arrowFunctionExpression([], t.callExpression(
220
+
221
+ t.import(), [t.addComment(
222
+ t.stringLiteral(file.filename),
223
+ "leading",
224
+ "webpackChunkName: '" + chunkId + "'"
225
+ )]
226
+ ))
227
+ )
228
+ )
229
+ }
230
+ }
224
231
 
225
- return [
226
- ...imports,
227
- // const routes = { ... }
228
- t.variableDeclaration("const", [t.variableDeclarator(
229
- t.identifier(request.default),
230
- t.objectExpression(pageLoaders)
231
- )])
232
- ]
232
+ return [
233
+ ...imports,
234
+ // const routes = { ... }
235
+ t.variableDeclaration("const", [t.variableDeclarator(
236
+ t.identifier(request.default),
237
+ t.objectExpression(pageLoaders)
238
+ )])
239
+ ]
233
240
 
234
- }
235
- }])
241
+ }
242
+ }])
236
243
 
237
- ],
244
+ ],
238
245
 
239
- overrides: [
246
+ overrides: [
240
247
 
241
- require("./plugins/pages")({ side }),
248
+ require("./plugins/pages")({ side }),
242
249
 
243
- require("./plugins/models")({ side }),
244
-
245
- require('./plugins/icones-svg'),
246
-
247
- require('./plugins/form'),
250
+ require("./plugins/models")({ side }),
251
+
252
+ require('./plugins/icones-svg'),
253
+
254
+ require('./plugins/form'),
248
255
 
249
- /*
250
-
251
- ...(side === 'client' ? [
256
+ /*
257
+
258
+ ...(side === 'client' ? [
252
259
 
253
- ] : [
254
- require('./plugins/queries');
255
- require('./plugins/injection-dependances'),
256
- ]),
260
+ ] : [
261
+ require('./plugins/queries');
262
+ require('./plugins/injection-dependances'),
263
+ ]),
257
264
 
258
- */
259
- ]
260
- }
261
- }])
265
+ */
266
+ ]
267
+ }
268
+ }]
269
+ }
@@ -12,9 +12,9 @@ import cli from '@cli';
12
12
  /*----------------------------------
13
13
  - WEBPACK RULE
14
14
  ----------------------------------*/
15
- const globServices = cli.paths.app.root + '/src/server/services/**/*.ts';
15
+ const globServices = app.paths.root + '/src/server/services/**/*.ts';
16
16
  const globModuleService = '@app/server/services/**';
17
- const globRoutes = cli.paths.app.root + '/src/server/routes/**/*.ts';
17
+ const globRoutes = app.paths.root + '/src/server/routes/**/*.ts';
18
18
 
19
19
  module.exports = {
20
20
  test: [globRoutes, globServices],
@@ -9,7 +9,7 @@ import generate from '@babel/generator';
9
9
 
10
10
  // Core
11
11
  import cli from '@cli';
12
- import { TAppSide } from '@cli/index';
12
+ import App, { TAppSide } from '../../../../app';
13
13
 
14
14
  /*----------------------------------
15
15
  - WEBPACK RULE
@@ -33,6 +33,8 @@ const debug = false;
33
33
  ----------------------------------*/
34
34
  function Plugin(babel, { side }: TOptions) {
35
35
 
36
+ const app = new App();
37
+
36
38
  const t = babel.types as typeof types;
37
39
  let program: NodePath<types.Program>;
38
40
 
@@ -112,7 +114,7 @@ function Plugin(babel, { side }: TOptions) {
112
114
  } else
113
115
  routeArgs.unshift(t.objectExpression([]));
114
116
 
115
- const { filepath, chunkId } = cli.paths.getPageChunk(filename);
117
+ const { filepath, chunkId } = cli.paths.getPageChunk(app, filename);
116
118
  debug && console.log(`[routes]`, filename, '=>', chunkId);
117
119
 
118
120
  // Add object property
@@ -1,6 +1,8 @@
1
1
  import { staticAssetName } from '../../../paths';
2
2
 
3
- module.exports = (dev: boolean, client: boolean) => ([
3
+ import type App from '../../../app';
4
+
5
+ module.exports = (app: App, dev: boolean, client: boolean) => ([
4
6
 
5
7
  // Allow to use ?raw at the end of the module path to iport the raw content only
6
8
  // Example: import VisualParserSource from './Parsers/visual.js?raw';
@@ -1,7 +1,8 @@
1
1
  import { staticAssetName } from '../../../paths';
2
2
  import type webpack from 'webpack';
3
+ import type App from '../../../app';
3
4
 
4
- module.exports = (dev: boolean, client: boolean): webpack.RuleSetRule[] => {
5
+ module.exports = (app: App, dev: boolean, client: boolean): webpack.RuleSetRule[] => {
5
6
 
6
7
  return [{
7
8
  test: /\.(bmp|gif|jpg|jpeg|png|ico|svg)$/,
@@ -5,9 +5,11 @@ import lessToJs from 'less-vars-to-js';
5
5
  import fs from 'fs-extra';
6
6
  import cli from '@cli';
7
7
 
8
- module.exports = (dev: Boolean, client: boolean) => {
8
+ import type App from '../../../app';
9
9
 
10
- const paletteLess = fs.readFileSync( cli.paths.app.src + '/client/assets/theme.less', 'utf8');
10
+ module.exports = (app: App, dev: Boolean, client: boolean) => {
11
+
12
+ const paletteLess = fs.readFileSync( app.paths.src + '/client/assets/theme.less', 'utf8');
11
13
  const themeVars = lessToJs(paletteLess, { resolveVariables: true, stripPrefix: true });
12
14
 
13
15
  return [
@@ -19,7 +21,7 @@ module.exports = (dev: Boolean, client: boolean) => {
19
21
 
20
22
  // Process external/third-party styles
21
23
  {
22
- exclude: [/*process.env.framework + '/kernel', */cli.paths.app.src],
24
+ exclude: [/*process.env.framework + '/kernel', */app.paths.src],
23
25
  loader: 'css-loader',
24
26
  options: {
25
27
  sourceMap: dev
@@ -28,7 +30,7 @@ module.exports = (dev: Boolean, client: boolean) => {
28
30
 
29
31
  // Process internal/project styles (from src folder)
30
32
  {
31
- include: [/*process.env.framework + '/kernel', */cli.paths.app.src],
33
+ include: [/*process.env.framework + '/kernel', */app.paths.src],
32
34
  loader: 'css-loader',
33
35
  options: {
34
36
  // CSS Loader https://github.com/webpack/css-loader
@@ -13,9 +13,12 @@ import IconesSvg from './plugins/indexage/icones-svg';
13
13
  import InjectDeps from './plugins/indexage/injection-dependances';
14
14
 
15
15
  // Core
16
- import { TAppSide } from '@cli';
17
16
  import cli from '../..';
18
17
 
18
+ // Type
19
+ import type App from '../../app';
20
+ import type { TAppSide } from '../../app';
21
+
19
22
  /*----------------------------------
20
23
  - CONSTANTS
21
24
  ----------------------------------*/
@@ -38,19 +41,22 @@ export type TCompileMode = 'dev' | 'prod'
38
41
  - BASE CONFIG
39
42
  ----------------------------------*/
40
43
 
41
- export default function createCommonConfig( side: TAppSide, mode: TCompileMode ): webpack.Configuration {
44
+ export default function createCommonConfig( app: App, side: TAppSide, mode: TCompileMode ): webpack.Configuration {
42
45
 
43
46
  const dev = mode === 'dev';
44
47
  const config: webpack.Configuration = {
45
48
 
46
49
  // Project root
47
- context: cli.paths.app.root,
50
+ context: app.paths.root,
48
51
 
49
52
  mode: dev ? 'development' : 'production',
50
53
 
51
54
  resolveLoader: {
52
55
  // Recherche des loaders dans framework/node_modules (psinon, webpack cherche dans le projet)
53
56
  modules: [
57
+ // The line below is not necessary
58
+ // By default, webpack is supposed to search in the project directory at first
59
+ //cli.paths.appRoot + '/node_modules',
54
60
  cli.paths.core.root + '/node_modules',
55
61
  cli.paths.core.cli + '/node_modules',
56
62
  ],
@@ -67,13 +73,13 @@ export default function createCommonConfig( side: TAppSide, mode: TCompileMode )
67
73
  BUILD_DATE: JSON.stringify(dayjs().format('YY.MM.DD-HH.mm')),
68
74
 
69
75
  CORE_PATH: JSON.stringify(cli.paths.core.root),
70
- APP_PATH: JSON.stringify(cli.paths.app.root),
71
- APP_NAME: JSON.stringify(cli.identity.web.title),
76
+ APP_PATH: JSON.stringify(app.paths.root),
77
+ APP_NAME: JSON.stringify(app.identity.web.title),
72
78
 
73
79
  }),
74
80
 
75
81
  new PluginIndexage(side === 'client' ? {
76
- 'icones-svg': new IconesSvg,
82
+ 'icones-svg': new IconesSvg(app),
77
83
  } : {
78
84
  //'injection-dependances': new InjectDeps,
79
85
  }),
@@ -107,7 +113,7 @@ export default function createCommonConfig( side: TAppSide, mode: TCompileMode )
107
113
 
108
114
  /*modules: [
109
115
  cli.paths.core.root + '/node_modules',
110
- cli.paths.app.root + '/node_modules',
116
+ app.paths.root + '/node_modules',
111
117
  ]*/
112
118
  },
113
119