nodefony 7.0.0-beta.2 → 7.0.0-beta.21
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/CHANGELOG.md +534 -8028
- package/README.md +33 -30
- package/autoloader.es6 +46 -48
- package/builder.es6 +66 -76
- package/cli/builder/bundles/bundle.js +57 -63
- package/cli/builder/bundles/controller.js +34 -38
- package/cli/builder/bundles/users-bundle/Command/fixtureTask.js +11 -12
- package/cli/builder/bundles/users-bundle/Command/usersCommand.js +23 -24
- package/cli/builder/bundles/users-bundle/Entity/mongoose/userEntity.js +25 -30
- package/cli/builder/bundles/users-bundle/Entity/sequelize/userEntity.js +42 -31
- package/cli/builder/bundles/users-bundle/Fixtures/users.js +24 -26
- package/cli/builder/bundles/users-bundle/Fixtures/usersFixtures.js +28 -29
- package/cli/builder/bundles/users-bundle/Resources/config/config.js +4 -3
- package/cli/builder/bundles/users-bundle/Resources/config/routing.js +2 -2
- package/cli/builder/bundles/users-bundle/Resources/config/security.js +9 -8
- package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.dev.config.js +3 -3
- package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.prod.config.js +4 -3
- package/cli/builder/bundles/users-bundle/Resources/config/webpack.config.js +74 -75
- package/cli/builder/bundles/users-bundle/Resources/scss/awesome/font-awesome.config.js +9 -9
- package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/login.js +13 -13
- package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/users.js +14 -14
- package/cli/builder/bundles/users-bundle/controller/api/graphql/graphqlController.js +13 -15
- package/cli/builder/bundles/users-bundle/controller/api/graphql/userResolver.js +29 -29
- package/cli/builder/bundles/users-bundle/controller/api/graphql/usertype.js +2 -2
- package/cli/builder/bundles/users-bundle/controller/api/openapi/loginApiController.js +34 -36
- package/cli/builder/bundles/users-bundle/controller/api/openapi/restUserController.js +32 -36
- package/cli/builder/bundles/users-bundle/controller/loginController.js +30 -34
- package/cli/builder/bundles/users-bundle/controller/usersController.js +54 -60
- package/cli/builder/bundles/users-bundle/package.json +27 -25
- package/cli/builder/bundles/users-bundle/pnpm-lock.yaml +4262 -0
- package/cli/builder/bundles/users-bundle/readme.md +7 -7
- package/cli/builder/bundles/users-bundle/services/usersService.js +97 -102
- package/cli/builder/bundles/users-bundle/src/providers/mongoose/userProvider.js +6 -8
- package/cli/builder/bundles/users-bundle/src/providers/sequelize/userProvider.js +9 -10
- package/cli/builder/bundles/users-bundle/tests/loginTest.js +119 -70
- package/cli/builder/bundles/users-bundle/usersBundle.js +2 -3
- package/cli/builder/microService/microService.js +139 -141
- package/cli/builder/microService/skeletons/package.json +23 -22
- package/cli/builder/project/project.js +228 -181
- package/cli/builder/project/skeletons/README.md +33 -30
- package/cli/builder/project/skeletons/bin/dev-deploy.sh +5 -0
- package/cli/builder/project/skeletons/bin/prod-deploy.sh +3 -0
- package/cli/builder/project/skeletons/config/config.js.skeleton +1 -0
- package/cli/builder/project/skeletons/config/pm2.config.js.skeleton +41 -17
- package/cli/builder/project/skeletons/eslintignore.skeleton +15 -0
- package/cli/builder/project/skeletons/eslintrc.js.skeleton +97 -0
- package/cli/builder/project/skeletons/gitignore.skeleton +1 -0
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.37.entity-user.js +137 -0
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.38.entity-session.js +97 -0
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.39.entity-requests.js +115 -0
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.40.entity-jwts.js +97 -0
- package/cli/builder/project/skeletons/migrations/migrations.skeleton.js +0 -2
- package/cli/builder/project/skeletons/package.json.twig +70 -0
- package/cli/builder/react/reactBuilder.js +59 -65
- package/cli/builder/sandbox/sandBoxBuilder.js +132 -134
- package/cli/builder/skeletons/app/appKernel.js +120 -2
- package/cli/builder/skeletons/config/config.js +1 -1
- package/cli/builder/skeletons/config/nodefony/framework-bundle.js +2 -1
- package/cli/builder/skeletons/config/nodefony/http-bundle.js +1 -0
- package/cli/builder/skeletons/config/nodefony/mongoose-bundle.js +38 -12
- package/cli/builder/skeletons/config/nodefony/monitoring-bundle.js +21 -2
- package/cli/builder/skeletons/config/nodefony/sequelize-bundle.js +122 -13
- package/cli/builder/skeletons/package.json.twig +57 -0
- package/cli/builder/skeletons/unittest/testFile.js +44 -45
- package/cli/builder/vue/skeletons/vue.config.js +84 -10
- package/cli/builder/vue/vueBuilder.js +116 -114
- package/cli/generate/generate.es6 +38 -39
- package/cli/install/install.js +45 -58
- package/cli/sequelize/sequelize.js +50 -39
- package/cli/start.js +353 -347
- package/cli/tools/pm2.es6 +55 -57
- package/cli/tools/tools.es6 +36 -37
- package/cli.es6 +280 -228
- package/container.es6 +51 -59
- package/error.es6 +25 -27
- package/fileClass.es6 +53 -55
- package/finder/file.es6 +5 -4
- package/finder/fileResult.es6 +23 -22
- package/finder/finder2.es6 +46 -54
- package/finder.es6 +88 -97
- package/kernel/annotations/annotations.es6 +44 -46
- package/kernel/api/api.es6 +6 -8
- package/kernel/api/graphqlApi.es6 +21 -21
- package/kernel/api/jsonApi.es6 +40 -45
- package/kernel/api/openApi.es6 +9 -11
- package/kernel/api/schemas/openApiSchema.js +61 -32
- package/kernel/babylon.es6 +31 -38
- package/kernel/bundle.es6 +252 -220
- package/kernel/cliKernel.es6 +157 -170
- package/kernel/command.es6 +17 -20
- package/kernel/commands/nodefonyCommand.es6 +111 -58
- package/kernel/commands/tasks/bundlesTask.es6 +14 -19
- package/kernel/controllers/controller.es6 +167 -180
- package/kernel/fixture.es6 +4 -7
- package/kernel/injections/injections.es6 +97 -103
- package/kernel/kernel.es6 +476 -384
- package/kernel/kernelWatcher.es6 +64 -54
- package/kernel/orm/entity.es6 +10 -12
- package/kernel/orm/orm.es6 +68 -48
- package/kernel/reader.es6 +45 -47
- package/kernel/security/encoder.es6 +8 -6
- package/kernel/security/factories/factory.es6 +34 -37
- package/kernel/security/factories/passeportFactory.es6 +13 -14
- package/kernel/security/provider.es6 +11 -13
- package/kernel/security/providers/chainProvider.es6 +13 -28
- package/kernel/security/providers/memoryProvider.es6 +7 -11
- package/kernel/security/providers/providerManager.es6 +11 -14
- package/kernel/security/providers/userEntityProvider.es6 +7 -8
- package/kernel/security/role.es6 +3 -3
- package/kernel/security/secureArea.es6 +143 -149
- package/kernel/security/tokens/token.es6 +30 -32
- package/kernel/security/user.es6 +19 -19
- package/kernel/serviceRealTime.es6 +5 -7
- package/kernel/services/connectionsService.es6 +20 -22
- package/kernel/services/cron/cronService.es6 +14 -16
- package/kernel/task.es6 +20 -26
- package/kernel/templates.es6 +4 -5
- package/kernel/templating/twig.es6 +56 -47
- package/kernel/tests/cliTest.js +7 -11
- package/kernel/tests/containerTest.js +25 -37
- package/kernel/tests/kernelTest.js +9 -16
- package/nodefony.es6 +279 -256
- package/notificationsCenter.es6 +28 -20
- package/package.json +40 -40
- package/protocol.es6 +19 -21
- package/protocols/bayeux.es6 +35 -38
- package/protocols/jsonRpc/jsonrpc.es6 +12 -14
- package/result.es6 +11 -12
- package/service.es6 +62 -62
- package/syslog/pdu.es6 +99 -91
- package/syslog/syslog.es6 +101 -102
- package/watcher.es6 +21 -20
- package/cli/builder/project/skeletons/jshintignore.skeleton +0 -1
- package/cli/builder/project/skeletons/jshintrc.skeleton +0 -60
- package/cli/builder/project/skeletons/package.json.skeleton +0 -52
- package/cli/builder/skeletons/package.json +0 -61
|
@@ -8,19 +8,45 @@
|
|
|
8
8
|
* By default nodefony create connector name nodefony
|
|
9
9
|
* for manage Sessions / Users
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
|
|
12
|
+
let connectors = {}
|
|
13
|
+
const vault = async () => {
|
|
14
|
+
const serviceVault = kernel.get("vault");
|
|
15
|
+
return await serviceVault.getSecret({
|
|
16
|
+
path: "nodefony/data/database/mongo/connector/nodefony"
|
|
17
|
+
})
|
|
18
|
+
.then((secret) => {
|
|
19
|
+
return secret.data.data
|
|
20
|
+
})
|
|
21
|
+
.catch(e => {
|
|
22
|
+
throw e
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
switch (kernel.appEnvironment.environment) {
|
|
27
|
+
case "production":
|
|
28
|
+
case "development":
|
|
29
|
+
default:
|
|
30
|
+
connectors.nodefony = {
|
|
31
|
+
host: "localhost",
|
|
32
|
+
port: 27017,
|
|
33
|
+
dbname: "nodefony",
|
|
34
|
+
//credentials: vault,
|
|
35
|
+
settings: {
|
|
36
|
+
user: "nodefony",
|
|
37
|
+
pass: "nodefony",
|
|
38
|
+
maxPoolSize: 50,
|
|
39
|
+
useNewUrlParser: true,
|
|
40
|
+
serverSelectionTimeoutMS: 5000,
|
|
41
|
+
socketTimeoutMS: 5000,
|
|
42
|
+
connectTimeoutMS: 5000
|
|
23
43
|
}
|
|
24
44
|
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = {
|
|
48
|
+
mongoose: {
|
|
49
|
+
debug: true,
|
|
50
|
+
connectors: connectors
|
|
25
51
|
}
|
|
26
52
|
};
|
|
@@ -4,12 +4,31 @@
|
|
|
4
4
|
* see MONITORING BUNDLE config for more options
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
7
|
module.exports = {
|
|
9
8
|
debugBar: true,
|
|
10
9
|
forceDebugBarProd: false,
|
|
11
10
|
profiler: {
|
|
12
11
|
active: false,
|
|
13
12
|
storage: "orm"
|
|
14
|
-
}
|
|
13
|
+
},
|
|
14
|
+
// entry point swagger Multi URL
|
|
15
|
+
swagger:{
|
|
16
|
+
projectName: "NODEFONY",
|
|
17
|
+
logo: "/app/images/app-logo.png",
|
|
18
|
+
urls: [{
|
|
19
|
+
url: "/api/users/documentation",
|
|
20
|
+
name: "users"
|
|
21
|
+
}, {
|
|
22
|
+
url: "/api/jwt/documentation",
|
|
23
|
+
name: "login"
|
|
24
|
+
}],
|
|
25
|
+
primaryName: "users"
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
// entry point graphigl monitoring only 1 URL (use merge in graphgl controller )
|
|
29
|
+
graphigl:{
|
|
30
|
+
projectName: "Nodefony Graphql Api",
|
|
31
|
+
logo: "/app/images/app-logo.png",
|
|
32
|
+
url:"/api/graphql"
|
|
33
|
+
},
|
|
15
34
|
};
|
|
@@ -10,23 +10,22 @@
|
|
|
10
10
|
* By default nodefony create connector name nodefony ( driver sqlite )
|
|
11
11
|
* for manage Sessions / Users
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Strategy sync or migrate Create Structure Database
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* Strategy sync
|
|
16
|
+
* $ nodefony sequelize:sync => Create Structure tables from Entity
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
18
|
+
* Strategy migrate
|
|
19
|
+
* $ nodefony sequelize:migrate => Create Structure tables from migrate files
|
|
19
20
|
*
|
|
20
|
-
* Here create new databases connectors
|
|
21
|
-
* and use for sync connectors :
|
|
22
|
-
* nodefony sequelize:sync
|
|
23
21
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* connectors: {
|
|
23
|
+
* nodefony: {
|
|
26
24
|
* driver: "mysql",
|
|
27
25
|
* dbname: 'nodefony',
|
|
28
26
|
* username: 'nodefony',
|
|
29
27
|
* password: 'nodefony',
|
|
28
|
+
* credentials: vault,
|
|
30
29
|
* options: {
|
|
31
30
|
* dialect: "mysql",
|
|
32
31
|
* host: "localhost",
|
|
@@ -38,10 +37,120 @@
|
|
|
38
37
|
* acquire:60000
|
|
39
38
|
* }
|
|
40
39
|
* }
|
|
41
|
-
*
|
|
42
|
-
*
|
|
40
|
+
* },
|
|
41
|
+
* myconnector:{
|
|
42
|
+
* dbname: 'nodefony',
|
|
43
|
+
* username: 'postgres',
|
|
44
|
+
* password: 'nodefony',
|
|
45
|
+
* options: {
|
|
46
|
+
* dialect: "postgres",
|
|
47
|
+
* host: "localhost",
|
|
48
|
+
* port: "5432",
|
|
49
|
+
* pool: {
|
|
50
|
+
* max: 30,
|
|
51
|
+
* min: 0,
|
|
52
|
+
* idle: 10000,
|
|
53
|
+
* acquire: 60000
|
|
54
|
+
* },
|
|
55
|
+
* retry: {
|
|
56
|
+
* match: [
|
|
57
|
+
* Sequelize.ConnectionError,
|
|
58
|
+
* Sequelize.ConnectionTimedOutError,
|
|
59
|
+
* Sequelize.ConnectionRefusedError,
|
|
60
|
+
* Sequelize.TimeoutError,
|
|
61
|
+
* /Deadlock/i
|
|
62
|
+
* ],
|
|
63
|
+
* max: Infinit
|
|
64
|
+
* }
|
|
65
|
+
* }
|
|
66
|
+
* }
|
|
43
67
|
*/
|
|
68
|
+
let Transaction, Sequelize
|
|
69
|
+
if (nodefony.Sequelize) {
|
|
70
|
+
Transaction = nodefony.Sequelize.Transaction
|
|
71
|
+
Sequelize = nodefony.Sequelize.Sequelize
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const vault = async () => {
|
|
75
|
+
const serviceVault = kernel.get("vault");
|
|
76
|
+
return await serviceVault.getSecret({
|
|
77
|
+
path: "nodefony/data/database/postgresql/connector/nodefony"
|
|
78
|
+
})
|
|
79
|
+
.then((secret) => {
|
|
80
|
+
return secret.data.data
|
|
81
|
+
})
|
|
82
|
+
.catch(e => {
|
|
83
|
+
throw e
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const connectors = {}
|
|
88
|
+
switch (kernel.appEnvironment.environment) {
|
|
89
|
+
case "production":
|
|
90
|
+
case "development":
|
|
91
|
+
default:
|
|
92
|
+
connectors.nodefony = {
|
|
93
|
+
driver: 'sqlite',
|
|
94
|
+
dbname: path.resolve("app", "Resources", "databases", "nodefony.db"),
|
|
95
|
+
options: {
|
|
96
|
+
dialect: "sqlite",
|
|
97
|
+
//isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE,
|
|
98
|
+
retry: {
|
|
99
|
+
match: [
|
|
100
|
+
//Sequelize.ConnectionError,
|
|
101
|
+
//Sequelize.ConnectionTimedOutError,
|
|
102
|
+
//Sequelize.TimeoutError,
|
|
103
|
+
/Deadlock/i,
|
|
104
|
+
'SQLITE_BUSY'
|
|
105
|
+
],
|
|
106
|
+
max: Infinity
|
|
107
|
+
},
|
|
108
|
+
pool: {
|
|
109
|
+
max: 5,
|
|
110
|
+
min: 0,
|
|
111
|
+
idle: 10000
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/*connectors.nodefony = {
|
|
116
|
+
driver: "postgres",
|
|
117
|
+
dbname: 'nodefony',
|
|
118
|
+
username: 'postgres',
|
|
119
|
+
password: 'nodefony',
|
|
120
|
+
//credentials: vault,
|
|
121
|
+
options: {
|
|
122
|
+
dialect: "postgres",
|
|
123
|
+
host: "localhost",
|
|
124
|
+
port: "5432",
|
|
125
|
+
//isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE,
|
|
126
|
+
retry: {
|
|
127
|
+
match: [
|
|
128
|
+
//Sequelize.ConnectionError,
|
|
129
|
+
//Sequelize.ConnectionTimedOutError,
|
|
130
|
+
//Sequelize.TimeoutError,
|
|
131
|
+
/Deadlock/i
|
|
132
|
+
],
|
|
133
|
+
max: 5
|
|
134
|
+
},
|
|
135
|
+
pool: {
|
|
136
|
+
max: 20,
|
|
137
|
+
min: 0,
|
|
138
|
+
idle: 10000,
|
|
139
|
+
acquire: 60000
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}*/
|
|
143
|
+
}
|
|
144
|
+
|
|
44
145
|
module.exports = {
|
|
45
146
|
debug: false,
|
|
46
|
-
|
|
47
|
-
|
|
147
|
+
strategy: "migrate", // sync || migrate || none when nodefony build or nodefony install
|
|
148
|
+
connectors: connectors,
|
|
149
|
+
migrations: {
|
|
150
|
+
storage: "sequelize", // sequelize || memory || json
|
|
151
|
+
path: path.resolve(kernel.path, "migrations", "sequelize"),
|
|
152
|
+
seedeersPath: path.resolve(kernel.path, "migrations", "seedeers"),
|
|
153
|
+
storageSeedeers:"json",
|
|
154
|
+
options: {}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "{{name}} description",
|
|
5
|
+
"author": "{{authorName}} <{{authorEmail}}>",
|
|
6
|
+
{% if packageName == "app" %}
|
|
7
|
+
"main": "appKernel.js",
|
|
8
|
+
{% else %}
|
|
9
|
+
"main": "{{name}}Bundle.js",
|
|
10
|
+
{% endif %}
|
|
11
|
+
"scripts": {},
|
|
12
|
+
"private": true,
|
|
13
|
+
"keywords": [
|
|
14
|
+
"nodefony",
|
|
15
|
+
"javascript",
|
|
16
|
+
"{{name}}"
|
|
17
|
+
],
|
|
18
|
+
"repository": {},
|
|
19
|
+
"dependencies": {},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
{% if addons.workbox %}
|
|
22
|
+
"workbox-webpack-plugin": "7.0.0",
|
|
23
|
+
{% endif %}
|
|
24
|
+
{% if addons.bootstrap %}
|
|
25
|
+
"@popperjs/core": "2.11.8",
|
|
26
|
+
"bootstrap": "5.3.2",
|
|
27
|
+
"jquery": "3.7.1",
|
|
28
|
+
"font-awesome": "^4.7.0",
|
|
29
|
+
{% endif %}
|
|
30
|
+
{% if addons.webpack %}
|
|
31
|
+
"@babel/core": "7.23.0",
|
|
32
|
+
"@babel/preset-env": "7.22.20",
|
|
33
|
+
"babel-loader": "9.1.3",
|
|
34
|
+
"clean-webpack-plugin": "^4.0.0",
|
|
35
|
+
"css-hot-loader": "^1.4.4",
|
|
36
|
+
"css-loader": "6.8.1",
|
|
37
|
+
"expose-loader": "4.1.0",
|
|
38
|
+
"favicons": "7.1.4",
|
|
39
|
+
"favicons-webpack-plugin": "6.0.1",
|
|
40
|
+
"html-webpack-plugin": "5.5.3",
|
|
41
|
+
"imports-loader": "4.0.1",
|
|
42
|
+
"mini-css-extract-plugin": "2.7.6",
|
|
43
|
+
"sass": "1.69.2",
|
|
44
|
+
"sass-loader": "13.3.2",
|
|
45
|
+
"sitemap-webpack-plugin": "^1.1.1",
|
|
46
|
+
"style-loader": "3.3.3",
|
|
47
|
+
"terser-webpack-plugin": "5.3.9",
|
|
48
|
+
"webpack": "5.88.2",
|
|
49
|
+
"webpack-dev-server": "4.15.1",
|
|
50
|
+
"webpack-merge": "5.9.0",
|
|
51
|
+
{% endif %}
|
|
52
|
+
"@mapbox/node-pre-gyp": "1.0.11",
|
|
53
|
+
"node-gyp": "9.4.0"
|
|
54
|
+
},
|
|
55
|
+
"license": "",
|
|
56
|
+
"readmeFilename": "README.md"
|
|
57
|
+
}
|
|
@@ -1,47 +1,46 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const assert = require('assert');
|
|
1
|
+
/*
|
|
2
|
+
* MODEFONY FRAMEWORK UNIT TEST
|
|
3
|
+
*
|
|
4
|
+
* MOCHA STYLE
|
|
5
|
+
*
|
|
6
|
+
* In the global context you can find :
|
|
7
|
+
*
|
|
8
|
+
* nodefony : namespace to get library
|
|
9
|
+
* kernel : instance of kernel who launch the test
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
const assert = require('assert');
|
|
15
|
+
const https = require('node:https');
|
|
15
16
|
|
|
16
|
-
describe("BUNDLE {{testName}}", () => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
describe("BUNDLE {{testName}}", () => {
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
const fetchService = kernel.get("fetch");
|
|
20
|
+
const httpsServer = kernel.get("httpsServer");
|
|
21
|
+
const certificats = httpsServer.getCertificats();
|
|
22
|
+
const httpsAgent = new https.Agent({
|
|
23
|
+
keepAlive: true,
|
|
24
|
+
cert: certificats.cert,
|
|
25
|
+
key: certificats.key,
|
|
26
|
+
ca: certificats.ca
|
|
27
|
+
});
|
|
28
|
+
const defaultOptions = {
|
|
29
|
+
method: 'GET',
|
|
30
|
+
agent: httpsAgent
|
|
31
|
+
};
|
|
32
|
+
global.url = `https://${kernel.settings.system.domain}:${kernel.settings.system.httpsPort}`;
|
|
33
|
+
global.fetch = fetchService.fetch
|
|
34
|
+
global.options = defaultOptions
|
|
35
|
+
});
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
});
|
|
37
|
+
describe('REQUEST ', () => {
|
|
38
|
+
it("FETCH REQUEST {{routeName}}", async () => {
|
|
39
|
+
let response = await global.fetch(`${global.url}/{{routeName}}`, global.options)
|
|
40
|
+
assert.equal(response.status, 200);
|
|
41
|
+
assert.equal(response.headers.get("server"), "nodefony");
|
|
42
|
+
let html = await response.text()
|
|
43
|
+
assert(html);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -1,20 +1,54 @@
|
|
|
1
1
|
// vue.config.js
|
|
2
|
+
const {
|
|
3
|
+
defineConfig
|
|
4
|
+
} = require('@vue/cli-service')
|
|
5
|
+
const webpack = require('webpack');
|
|
2
6
|
const path = require('path');
|
|
3
|
-
const
|
|
4
|
-
const packageVue = require(path.resolve("node_modules","vue","package.json"));
|
|
7
|
+
const Package = require(path.resolve("package.json"));
|
|
8
|
+
const packageVue = require(path.resolve("node_modules", "vue", "package.json"));
|
|
5
9
|
const outputDir = path.resolve("Resources", "public");
|
|
6
10
|
const indexPath = path.resolve("Resources", "views", 'index.html.twig');
|
|
7
11
|
const publicPath = "/{{bundleName}}";
|
|
8
12
|
const template = path.resolve('public', 'index.html');
|
|
9
|
-
const {
|
|
10
|
-
|
|
13
|
+
const {
|
|
14
|
+
CleanWebpackPlugin
|
|
15
|
+
} = require('clean-webpack-plugin');
|
|
16
|
+
const title = Package.name;
|
|
17
|
+
const nodeModule = path.resolve(process.cwd(), "node_modules");
|
|
11
18
|
|
|
12
|
-
|
|
19
|
+
{% if addons.vuetify %}
|
|
20
|
+
const vuetifyDir = path.dirname(require.resolve("vuetify"));
|
|
21
|
+
const packageVuetify = require(path.resolve(vuetifyDir, "..", "package.json"));
|
|
22
|
+
{% endif %}
|
|
23
|
+
|
|
24
|
+
process.env.VUE_APP_VERSION = Package.version;
|
|
13
25
|
process.env.VUE_APP_VUE_VERSION = packageVue.version;
|
|
14
26
|
process.env.VUE_APP_DEBUG = process.env.DEBUG_MODE;
|
|
15
27
|
process.env.VUE_APP_NODE_ENV = process.env.NODE_ENV;
|
|
28
|
+
{% if addons.vuetify %}
|
|
29
|
+
process.env.VUE_APP_VUETIFY_VERSION = packageVuetify.version;
|
|
30
|
+
{% endif %}
|
|
31
|
+
try {
|
|
32
|
+
process.env.VUE_APP_DOMAIN = kernel.domain;
|
|
33
|
+
process.env.VUE_APP_HTTP_PORT = kernel.httpPort;
|
|
34
|
+
process.env.VUE_APP_HTTPS_PORT = kernel.httpsPort;
|
|
35
|
+
} catch (e) {}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
let dev = true;
|
|
39
|
+
let debug = false
|
|
40
|
+
let watch = false
|
|
16
41
|
|
|
17
|
-
|
|
42
|
+
try {
|
|
43
|
+
if (kernel.environment !== "dev") {
|
|
44
|
+
dev = false;
|
|
45
|
+
} else {
|
|
46
|
+
watch = true;
|
|
47
|
+
}
|
|
48
|
+
debug = kernel.debug ? "*" : false;
|
|
49
|
+
} catch (e) {}
|
|
50
|
+
|
|
51
|
+
module.exports = defineConfig({
|
|
18
52
|
lintOnSave: false,
|
|
19
53
|
publicPath: publicPath,
|
|
20
54
|
outputDir: outputDir,
|
|
@@ -26,14 +60,47 @@ module.exports = {
|
|
|
26
60
|
.tap(args => {
|
|
27
61
|
args[0].title = title;
|
|
28
62
|
args[0].template = template;
|
|
63
|
+
args[0].chunks = ['app'];
|
|
29
64
|
return args;
|
|
30
65
|
});
|
|
31
66
|
},
|
|
67
|
+
|
|
32
68
|
configureWebpack: {
|
|
69
|
+
cache: true,
|
|
33
70
|
devtool: process.env.NODE_ENV === "development" ? "source-map" : false,
|
|
71
|
+
watchOptions: {
|
|
72
|
+
aggregateTimeout: 2000,
|
|
73
|
+
ignored: /node_modules|assets|Resources|dist|tmp|public/,
|
|
74
|
+
followSymlinks: false
|
|
75
|
+
},
|
|
76
|
+
performance: {
|
|
77
|
+
hints: false,
|
|
78
|
+
maxEntrypointSize: 11000000,
|
|
79
|
+
maxAssetSize: 11000000
|
|
80
|
+
},
|
|
81
|
+
optimization: {
|
|
82
|
+
runtimeChunk: true,
|
|
83
|
+
removeAvailableModules: false,
|
|
84
|
+
removeEmptyChunks: false,
|
|
85
|
+
splitChunks: false,
|
|
86
|
+
},
|
|
34
87
|
output:{
|
|
35
|
-
hotUpdateChunkFilename:'hot/[id].[
|
|
36
|
-
hotUpdateMainFilename: 'hot/[
|
|
88
|
+
hotUpdateChunkFilename: 'hot/[id].[fullhash].hot-update.js',
|
|
89
|
+
hotUpdateMainFilename: 'hot/[runtime].[fullhash].hot-update.json'
|
|
90
|
+
},
|
|
91
|
+
resolve: {
|
|
92
|
+
alias: {
|
|
93
|
+
"@bundles": path.join(__dirname, ".."),
|
|
94
|
+
"@app": path.join(__dirname, "..", "..", "..", "app"),
|
|
95
|
+
"vue": path.resolve(`./node_modules/vue`),
|
|
96
|
+
"vue-router": path.resolve(`./node_modules/vue-router`)
|
|
97
|
+
},
|
|
98
|
+
extensions: ['.js', '.json', '.css', '.mjs'],
|
|
99
|
+
fallback: {
|
|
100
|
+
"path": false,
|
|
101
|
+
"assert": false
|
|
102
|
+
},
|
|
103
|
+
modules: [nodeModule]
|
|
37
104
|
},
|
|
38
105
|
plugins: [
|
|
39
106
|
new CleanWebpackPlugin({
|
|
@@ -45,11 +112,18 @@ module.exports = {
|
|
|
45
112
|
protectWebpackAssets:true,
|
|
46
113
|
cleanAfterEveryBuildPatterns:[],
|
|
47
114
|
dangerouslyAllowCleanPatternsOutsideProject: true
|
|
48
|
-
})
|
|
115
|
+
}),
|
|
116
|
+
new webpack.DefinePlugin({
|
|
117
|
+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
|
118
|
+
'process.env.NODE_DEBUG': JSON.stringify(debug)
|
|
119
|
+
}),
|
|
49
120
|
]
|
|
50
121
|
}{% if addons.vuetify %},
|
|
122
|
+
pluginOptions: {
|
|
123
|
+
vuetify: {}
|
|
124
|
+
},
|
|
51
125
|
transpileDependencies: [
|
|
52
126
|
"vuetify"
|
|
53
127
|
]
|
|
54
128
|
{% endif %}
|
|
55
|
-
}
|
|
129
|
+
})
|