@lowdefy/build 0.0.0-experimental-20251203145918 → 0.0.0-experimental-20251203181051
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/dist/defaultTypesMap.js +481 -481
- package/dist/index.js +125 -121
- package/dist/utils/createBuildProfiler.js +52 -0
- package/dist/utils/createCheckDuplicateId.js +0 -1
- package/package.json +38 -38
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
2
|
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import
|
|
15
|
+
*/ import createBuildProfiler from './utils/createBuildProfiler.js';
|
|
16
|
+
import createContext from './createContext.js';
|
|
16
17
|
import createPluginTypesMap from './utils/createPluginTypesMap.js';
|
|
17
18
|
import addDefaultPages from './build/addDefaultPages/addDefaultPages.js';
|
|
18
19
|
import addKeys from './build/addKeys.js';
|
|
@@ -46,125 +47,128 @@ import writeRequests from './build/writeRequests.js';
|
|
|
46
47
|
import writeTypes from './build/writeTypes.js';
|
|
47
48
|
async function build(options) {
|
|
48
49
|
const context = createContext(options);
|
|
49
|
-
const
|
|
50
|
-
context
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
await
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
50
|
+
const { time, printSummary } = createBuildProfiler({
|
|
51
|
+
logger: context.logger
|
|
52
|
+
});
|
|
53
|
+
const components = await time('buildRefs', ()=>buildRefs({
|
|
54
|
+
context
|
|
55
|
+
}));
|
|
56
|
+
await time('testSchema', ()=>testSchema({
|
|
57
|
+
components,
|
|
58
|
+
context
|
|
59
|
+
}));
|
|
60
|
+
await time('buildApp', ()=>buildApp({
|
|
61
|
+
components,
|
|
62
|
+
context
|
|
63
|
+
}));
|
|
64
|
+
await time('validateConfig', ()=>validateConfig({
|
|
65
|
+
components,
|
|
66
|
+
context
|
|
67
|
+
}));
|
|
68
|
+
await time('addDefaultPages', ()=>addDefaultPages({
|
|
69
|
+
components,
|
|
70
|
+
context
|
|
71
|
+
}));
|
|
72
|
+
await time('buildAuth', ()=>buildAuth({
|
|
73
|
+
components,
|
|
74
|
+
context
|
|
75
|
+
}));
|
|
76
|
+
await time('buildConnections', ()=>buildConnections({
|
|
77
|
+
components,
|
|
78
|
+
context
|
|
79
|
+
}));
|
|
80
|
+
await time('buildApi', ()=>buildApi({
|
|
81
|
+
components,
|
|
82
|
+
context
|
|
83
|
+
}));
|
|
84
|
+
await time('buildPages', ()=>buildPages({
|
|
85
|
+
components,
|
|
86
|
+
context
|
|
87
|
+
}));
|
|
88
|
+
await time('buildMenu', ()=>buildMenu({
|
|
89
|
+
components,
|
|
90
|
+
context
|
|
91
|
+
}));
|
|
92
|
+
await time('buildJs', ()=>buildJs({
|
|
93
|
+
components,
|
|
94
|
+
context
|
|
95
|
+
}));
|
|
96
|
+
await time('addKeys', ()=>addKeys({
|
|
97
|
+
components,
|
|
98
|
+
context
|
|
99
|
+
}));
|
|
100
|
+
await time('buildTypes', ()=>buildTypes({
|
|
101
|
+
components,
|
|
102
|
+
context
|
|
103
|
+
}));
|
|
104
|
+
await time('buildImports', ()=>buildImports({
|
|
105
|
+
components,
|
|
106
|
+
context
|
|
107
|
+
}));
|
|
108
|
+
await time('cleanBuildDirectory', ()=>cleanBuildDirectory({
|
|
109
|
+
context
|
|
110
|
+
}));
|
|
111
|
+
await time('writeApp', ()=>writeApp({
|
|
112
|
+
components,
|
|
113
|
+
context
|
|
114
|
+
}));
|
|
115
|
+
await time('writeAuth', ()=>writeAuth({
|
|
116
|
+
components,
|
|
117
|
+
context
|
|
118
|
+
}));
|
|
119
|
+
await time('writeConnections', ()=>writeConnections({
|
|
120
|
+
components,
|
|
121
|
+
context
|
|
122
|
+
}));
|
|
123
|
+
await time('writeApi', ()=>writeApi({
|
|
124
|
+
components,
|
|
125
|
+
context
|
|
126
|
+
}));
|
|
127
|
+
await time('writeRequests', ()=>writeRequests({
|
|
128
|
+
components,
|
|
129
|
+
context
|
|
130
|
+
}));
|
|
131
|
+
await time('writePages', ()=>writePages({
|
|
132
|
+
components,
|
|
133
|
+
context
|
|
134
|
+
}));
|
|
135
|
+
await time('writeConfig', ()=>writeConfig({
|
|
136
|
+
components,
|
|
137
|
+
context
|
|
138
|
+
}));
|
|
139
|
+
await time('writeGlobal', ()=>writeGlobal({
|
|
140
|
+
components,
|
|
141
|
+
context
|
|
142
|
+
}));
|
|
143
|
+
await time('writeMaps', ()=>writeMaps({
|
|
144
|
+
components,
|
|
145
|
+
context
|
|
146
|
+
}));
|
|
147
|
+
await time('writeMenus', ()=>writeMenus({
|
|
148
|
+
components,
|
|
149
|
+
context
|
|
150
|
+
}));
|
|
151
|
+
await time('writeTypes', ()=>writeTypes({
|
|
152
|
+
components,
|
|
153
|
+
context
|
|
154
|
+
}));
|
|
155
|
+
await time('writePluginImports', ()=>writePluginImports({
|
|
156
|
+
components,
|
|
157
|
+
context
|
|
158
|
+
}));
|
|
159
|
+
await time('writeJs', ()=>writeJs({
|
|
160
|
+
components,
|
|
161
|
+
context
|
|
162
|
+
}));
|
|
163
|
+
await time('updateServerPackageJson', ()=>updateServerPackageJson({
|
|
164
|
+
components,
|
|
165
|
+
context
|
|
166
|
+
}));
|
|
167
|
+
await time('copyPublicFolder', ()=>copyPublicFolder({
|
|
168
|
+
components,
|
|
169
|
+
context
|
|
170
|
+
}));
|
|
171
|
+
printSummary();
|
|
168
172
|
}
|
|
169
173
|
export { createPluginTypesMap };
|
|
170
174
|
export default build;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ function createBuildProfiler({ logger }) {
|
|
16
|
+
const timings = [];
|
|
17
|
+
const isDebug = logger?.level === 'debug';
|
|
18
|
+
const time = async (name, fn)=>{
|
|
19
|
+
if (!isDebug) {
|
|
20
|
+
return fn();
|
|
21
|
+
}
|
|
22
|
+
const start = performance.now();
|
|
23
|
+
const result = await fn();
|
|
24
|
+
const duration = performance.now() - start;
|
|
25
|
+
timings.push({
|
|
26
|
+
name,
|
|
27
|
+
duration
|
|
28
|
+
});
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
const printSummary = ()=>{
|
|
32
|
+
if (!isDebug || timings.length === 0) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const total = timings.reduce((sum, t)=>sum + t.duration, 0);
|
|
36
|
+
logger.debug('');
|
|
37
|
+
logger.debug('⏱️ Build Performance Summary:');
|
|
38
|
+
logger.debug('─'.repeat(60));
|
|
39
|
+
timings.sort((a, b)=>b.duration - a.duration).forEach(({ name, duration })=>{
|
|
40
|
+
const pct = (duration / total * 100).toFixed(1);
|
|
41
|
+
const bar = '█'.repeat(Math.round(duration / total * 20));
|
|
42
|
+
logger.debug(`${name.padEnd(25)} ${duration.toFixed(2).padStart(10)}ms ${pct.padStart(6)}% ${bar}`);
|
|
43
|
+
});
|
|
44
|
+
logger.debug('─'.repeat(60));
|
|
45
|
+
logger.debug(`${'TOTAL'.padEnd(25)} ${total.toFixed(2).padStart(10)}ms`);
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
time,
|
|
49
|
+
printSummary
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export default createBuildProfiler;
|
|
@@ -17,7 +17,6 @@ function createCheckDuplicateId({ message }) {
|
|
|
17
17
|
const template = nunjucksFunction(message);
|
|
18
18
|
const ids = new Set();
|
|
19
19
|
function checkDuplicateId({ id, blockId, eventId, menuId, pageId }) {
|
|
20
|
-
console.log('checkDuplicateId', ids.has(id.toLowerCase()), id, id.toLowerCase());
|
|
21
20
|
if (ids.has(id.toLowerCase())) throw new Error(template({
|
|
22
21
|
id,
|
|
23
22
|
blockId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/build",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20251203181051",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"dist/*"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@lowdefy/ajv": "0.0.0-experimental-
|
|
48
|
-
"@lowdefy/blocks-basic": "0.0.0-experimental-
|
|
49
|
-
"@lowdefy/blocks-loaders": "0.0.0-experimental-
|
|
50
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
51
|
-
"@lowdefy/node-utils": "0.0.0-experimental-
|
|
52
|
-
"@lowdefy/nunjucks": "0.0.0-experimental-
|
|
53
|
-
"@lowdefy/operators": "0.0.0-experimental-
|
|
54
|
-
"@lowdefy/operators-js": "0.0.0-experimental-
|
|
47
|
+
"@lowdefy/ajv": "0.0.0-experimental-20251203181051",
|
|
48
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20251203181051",
|
|
49
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20251203181051",
|
|
50
|
+
"@lowdefy/helpers": "0.0.0-experimental-20251203181051",
|
|
51
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20251203181051",
|
|
52
|
+
"@lowdefy/nunjucks": "0.0.0-experimental-20251203181051",
|
|
53
|
+
"@lowdefy/operators": "0.0.0-experimental-20251203181051",
|
|
54
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20251203181051",
|
|
55
55
|
"ajv": "8.12.0",
|
|
56
56
|
"json5": "2.2.3",
|
|
57
57
|
"yaml": "2.3.4",
|
|
@@ -59,35 +59,35 @@
|
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@jest/globals": "28.1.3",
|
|
62
|
-
"@lowdefy/actions-core": "0.0.0-experimental-
|
|
63
|
-
"@lowdefy/actions-pdf-make": "0.0.0-experimental-
|
|
64
|
-
"@lowdefy/blocks-aggrid": "0.0.0-experimental-
|
|
65
|
-
"@lowdefy/blocks-algolia": "0.0.0-experimental-
|
|
66
|
-
"@lowdefy/blocks-antd": "0.0.0-experimental-
|
|
67
|
-
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-
|
|
68
|
-
"@lowdefy/blocks-echarts": "0.0.0-experimental-
|
|
69
|
-
"@lowdefy/blocks-google-maps": "0.0.0-experimental-
|
|
70
|
-
"@lowdefy/blocks-markdown": "0.0.0-experimental-
|
|
71
|
-
"@lowdefy/blocks-qr": "0.0.0-experimental-
|
|
72
|
-
"@lowdefy/connection-axios-http": "0.0.0-experimental-
|
|
73
|
-
"@lowdefy/connection-elasticsearch": "0.0.0-experimental-
|
|
74
|
-
"@lowdefy/connection-google-sheets": "0.0.0-experimental-
|
|
75
|
-
"@lowdefy/connection-knex": "0.0.0-experimental-
|
|
76
|
-
"@lowdefy/connection-mongodb": "0.0.0-experimental-
|
|
77
|
-
"@lowdefy/connection-redis": "0.0.0-experimental-
|
|
78
|
-
"@lowdefy/connection-sendgrid": "0.0.0-experimental-
|
|
79
|
-
"@lowdefy/connection-stripe": "0.0.0-experimental-
|
|
80
|
-
"@lowdefy/operators-change-case": "0.0.0-experimental-
|
|
81
|
-
"@lowdefy/operators-diff": "0.0.0-experimental-
|
|
82
|
-
"@lowdefy/operators-moment": "0.0.0-experimental-
|
|
83
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
84
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
85
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
86
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
87
|
-
"@lowdefy/plugin-auth0": "0.0.0-experimental-
|
|
88
|
-
"@lowdefy/plugin-aws": "0.0.0-experimental-
|
|
89
|
-
"@lowdefy/plugin-csv": "0.0.0-experimental-
|
|
90
|
-
"@lowdefy/plugin-next-auth": "0.0.0-experimental-
|
|
62
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20251203181051",
|
|
63
|
+
"@lowdefy/actions-pdf-make": "0.0.0-experimental-20251203181051",
|
|
64
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20251203181051",
|
|
65
|
+
"@lowdefy/blocks-algolia": "0.0.0-experimental-20251203181051",
|
|
66
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20251203181051",
|
|
67
|
+
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-20251203181051",
|
|
68
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20251203181051",
|
|
69
|
+
"@lowdefy/blocks-google-maps": "0.0.0-experimental-20251203181051",
|
|
70
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20251203181051",
|
|
71
|
+
"@lowdefy/blocks-qr": "0.0.0-experimental-20251203181051",
|
|
72
|
+
"@lowdefy/connection-axios-http": "0.0.0-experimental-20251203181051",
|
|
73
|
+
"@lowdefy/connection-elasticsearch": "0.0.0-experimental-20251203181051",
|
|
74
|
+
"@lowdefy/connection-google-sheets": "0.0.0-experimental-20251203181051",
|
|
75
|
+
"@lowdefy/connection-knex": "0.0.0-experimental-20251203181051",
|
|
76
|
+
"@lowdefy/connection-mongodb": "0.0.0-experimental-20251203181051",
|
|
77
|
+
"@lowdefy/connection-redis": "0.0.0-experimental-20251203181051",
|
|
78
|
+
"@lowdefy/connection-sendgrid": "0.0.0-experimental-20251203181051",
|
|
79
|
+
"@lowdefy/connection-stripe": "0.0.0-experimental-20251203181051",
|
|
80
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20251203181051",
|
|
81
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20251203181051",
|
|
82
|
+
"@lowdefy/operators-moment": "0.0.0-experimental-20251203181051",
|
|
83
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20251203181051",
|
|
84
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20251203181051",
|
|
85
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20251203181051",
|
|
86
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20251203181051",
|
|
87
|
+
"@lowdefy/plugin-auth0": "0.0.0-experimental-20251203181051",
|
|
88
|
+
"@lowdefy/plugin-aws": "0.0.0-experimental-20251203181051",
|
|
89
|
+
"@lowdefy/plugin-csv": "0.0.0-experimental-20251203181051",
|
|
90
|
+
"@lowdefy/plugin-next-auth": "0.0.0-experimental-20251203181051",
|
|
91
91
|
"@swc/cli": "0.1.63",
|
|
92
92
|
"@swc/core": "1.3.99",
|
|
93
93
|
"@swc/jest": "0.2.29",
|