@lowdefy/build 0.0.0-experimental-20260112140412 → 0.0.0-experimental-20260113090459
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/build/buildConnections.js +7 -7
- package/dist/build/buildJs/buildJs.js +1 -1
- package/dist/build/buildRefs/recursiveBuild.js +10 -6
- package/dist/build/writeRequests.js +11 -2
- package/dist/createContext.js +1 -0
- package/dist/defaultTypesMap.js +460 -460
- package/dist/index.js +21 -14
- package/dist/utils/collectConfigError.js +40 -0
- package/dist/utils/tryBuildStep.js +38 -0
- package/package.json +39 -39
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import createContext from './createContext.js';
|
|
16
16
|
import createPluginTypesMap from './utils/createPluginTypesMap.js';
|
|
17
|
+
import tryBuildStep from './utils/tryBuildStep.js';
|
|
17
18
|
import addDefaultPages from './build/addDefaultPages/addDefaultPages.js';
|
|
18
19
|
import addKeys from './build/addKeys.js';
|
|
19
20
|
import buildApp from './build/buildApp.js';
|
|
@@ -51,62 +52,68 @@ async function build(options) {
|
|
|
51
52
|
const components = await buildRefs({
|
|
52
53
|
context
|
|
53
54
|
});
|
|
54
|
-
|
|
55
|
+
// Build steps - collect all errors before stopping
|
|
56
|
+
tryBuildStep(testSchema, 'testSchema', {
|
|
55
57
|
components,
|
|
56
58
|
context
|
|
57
59
|
});
|
|
58
|
-
buildApp
|
|
60
|
+
tryBuildStep(buildApp, 'buildApp', {
|
|
59
61
|
components,
|
|
60
62
|
context
|
|
61
63
|
});
|
|
62
|
-
buildLogger
|
|
64
|
+
tryBuildStep(buildLogger, 'buildLogger', {
|
|
63
65
|
components,
|
|
64
66
|
context
|
|
65
67
|
});
|
|
66
|
-
validateConfig
|
|
68
|
+
tryBuildStep(validateConfig, 'validateConfig', {
|
|
67
69
|
components,
|
|
68
70
|
context
|
|
69
71
|
});
|
|
70
|
-
addDefaultPages
|
|
72
|
+
tryBuildStep(addDefaultPages, 'addDefaultPages', {
|
|
71
73
|
components,
|
|
72
74
|
context
|
|
73
75
|
});
|
|
74
|
-
addKeys
|
|
76
|
+
tryBuildStep(addKeys, 'addKeys', {
|
|
75
77
|
components,
|
|
76
78
|
context
|
|
77
79
|
});
|
|
78
|
-
buildAuth
|
|
80
|
+
tryBuildStep(buildAuth, 'buildAuth', {
|
|
79
81
|
components,
|
|
80
82
|
context
|
|
81
83
|
});
|
|
82
|
-
buildConnections
|
|
84
|
+
tryBuildStep(buildConnections, 'buildConnections', {
|
|
83
85
|
components,
|
|
84
86
|
context
|
|
85
87
|
});
|
|
86
|
-
buildApi
|
|
88
|
+
tryBuildStep(buildApi, 'buildApi', {
|
|
87
89
|
components,
|
|
88
90
|
context
|
|
89
91
|
});
|
|
90
|
-
buildPages
|
|
92
|
+
tryBuildStep(buildPages, 'buildPages', {
|
|
91
93
|
components,
|
|
92
94
|
context
|
|
93
95
|
});
|
|
94
|
-
buildMenu
|
|
96
|
+
tryBuildStep(buildMenu, 'buildMenu', {
|
|
95
97
|
components,
|
|
96
98
|
context
|
|
97
99
|
});
|
|
98
|
-
buildJs
|
|
100
|
+
tryBuildStep(buildJs, 'buildJs', {
|
|
99
101
|
components,
|
|
100
102
|
context
|
|
101
103
|
});
|
|
102
|
-
buildTypes
|
|
104
|
+
tryBuildStep(buildTypes, 'buildTypes', {
|
|
103
105
|
components,
|
|
104
106
|
context
|
|
105
107
|
});
|
|
106
|
-
buildImports
|
|
108
|
+
tryBuildStep(buildImports, 'buildImports', {
|
|
107
109
|
components,
|
|
108
110
|
context
|
|
109
111
|
});
|
|
112
|
+
// Check if there are any collected errors before writing
|
|
113
|
+
if (context.errors.length > 0) {
|
|
114
|
+
throw new Error(`Build failed with ${context.errors.length} error(s). See above for details.`);
|
|
115
|
+
}
|
|
116
|
+
// Write steps - only if no errors
|
|
110
117
|
await cleanBuildDirectory({
|
|
111
118
|
context
|
|
112
119
|
});
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
*/ import formatConfigError from './formatConfigError.js';
|
|
16
|
+
/**
|
|
17
|
+
* Collects a config error instead of throwing immediately.
|
|
18
|
+
* Allows the build to continue and collect all errors before stopping.
|
|
19
|
+
*
|
|
20
|
+
* @param {Object} params
|
|
21
|
+
* @param {string} params.message - Error message
|
|
22
|
+
* @param {string} params.configKey - Config key (~k) for location tracking
|
|
23
|
+
* @param {Object} params.context - Build context
|
|
24
|
+
*/ function collectConfigError({ message, configKey, context }) {
|
|
25
|
+
const errorMessage = formatConfigError({
|
|
26
|
+
message,
|
|
27
|
+
configKey,
|
|
28
|
+
context
|
|
29
|
+
});
|
|
30
|
+
if (!context.errors) {
|
|
31
|
+
// If no error collection array, throw immediately (fallback for tests)
|
|
32
|
+
throw new Error(errorMessage);
|
|
33
|
+
}
|
|
34
|
+
// Collect error to show all errors at once
|
|
35
|
+
context.errors.push(errorMessage);
|
|
36
|
+
if (context.logger && context.logger.error) {
|
|
37
|
+
context.logger.error(errorMessage);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export default collectConfigError;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
*/ /**
|
|
16
|
+
* Wraps a build step to collect errors instead of stopping immediately.
|
|
17
|
+
* Errors are collected in context.errors[] and logged, allowing the build to
|
|
18
|
+
* continue and report all errors at once before stopping.
|
|
19
|
+
*
|
|
20
|
+
* @param {Function} stepFn - Build step function to execute
|
|
21
|
+
* @param {string} stepName - Name of the build step (for debugging)
|
|
22
|
+
* @param {Object} params - Parameters object
|
|
23
|
+
* @param {Object} params.components - Build components
|
|
24
|
+
* @param {Object} params.context - Build context with errors array
|
|
25
|
+
* @returns {*} Result of the build step function
|
|
26
|
+
*/ function tryBuildStep(stepFn, stepName, { components, context }) {
|
|
27
|
+
try {
|
|
28
|
+
return stepFn({
|
|
29
|
+
components,
|
|
30
|
+
context
|
|
31
|
+
});
|
|
32
|
+
} catch (error) {
|
|
33
|
+
// Collect error to show all errors at once
|
|
34
|
+
context.errors.push(error.message);
|
|
35
|
+
context.logger.error(error.message);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export default tryBuildStep;
|
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-20260113090459",
|
|
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-20260113090459",
|
|
48
|
+
"@lowdefy/blocks-basic": "0.0.0-experimental-20260113090459",
|
|
49
|
+
"@lowdefy/blocks-loaders": "0.0.0-experimental-20260113090459",
|
|
50
|
+
"@lowdefy/helpers": "0.0.0-experimental-20260113090459",
|
|
51
|
+
"@lowdefy/node-utils": "0.0.0-experimental-20260113090459",
|
|
52
|
+
"@lowdefy/nunjucks": "0.0.0-experimental-20260113090459",
|
|
53
|
+
"@lowdefy/operators": "0.0.0-experimental-20260113090459",
|
|
54
|
+
"@lowdefy/operators-js": "0.0.0-experimental-20260113090459",
|
|
55
55
|
"ajv": "8.12.0",
|
|
56
56
|
"json5": "2.2.3",
|
|
57
57
|
"yaml": "2.3.4",
|
|
@@ -59,36 +59,36 @@
|
|
|
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-jsonata": "0.0.0-experimental-
|
|
83
|
-
"@lowdefy/operators-moment": "0.0.0-experimental-
|
|
84
|
-
"@lowdefy/operators-mql": "0.0.0-experimental-
|
|
85
|
-
"@lowdefy/operators-nunjucks": "0.0.0-experimental-
|
|
86
|
-
"@lowdefy/operators-uuid": "0.0.0-experimental-
|
|
87
|
-
"@lowdefy/operators-yaml": "0.0.0-experimental-
|
|
88
|
-
"@lowdefy/plugin-auth0": "0.0.0-experimental-
|
|
89
|
-
"@lowdefy/plugin-aws": "0.0.0-experimental-
|
|
90
|
-
"@lowdefy/plugin-csv": "0.0.0-experimental-
|
|
91
|
-
"@lowdefy/plugin-next-auth": "0.0.0-experimental-
|
|
62
|
+
"@lowdefy/actions-core": "0.0.0-experimental-20260113090459",
|
|
63
|
+
"@lowdefy/actions-pdf-make": "0.0.0-experimental-20260113090459",
|
|
64
|
+
"@lowdefy/blocks-aggrid": "0.0.0-experimental-20260113090459",
|
|
65
|
+
"@lowdefy/blocks-algolia": "0.0.0-experimental-20260113090459",
|
|
66
|
+
"@lowdefy/blocks-antd": "0.0.0-experimental-20260113090459",
|
|
67
|
+
"@lowdefy/blocks-color-selectors": "0.0.0-experimental-20260113090459",
|
|
68
|
+
"@lowdefy/blocks-echarts": "0.0.0-experimental-20260113090459",
|
|
69
|
+
"@lowdefy/blocks-google-maps": "0.0.0-experimental-20260113090459",
|
|
70
|
+
"@lowdefy/blocks-markdown": "0.0.0-experimental-20260113090459",
|
|
71
|
+
"@lowdefy/blocks-qr": "0.0.0-experimental-20260113090459",
|
|
72
|
+
"@lowdefy/connection-axios-http": "0.0.0-experimental-20260113090459",
|
|
73
|
+
"@lowdefy/connection-elasticsearch": "0.0.0-experimental-20260113090459",
|
|
74
|
+
"@lowdefy/connection-google-sheets": "0.0.0-experimental-20260113090459",
|
|
75
|
+
"@lowdefy/connection-knex": "0.0.0-experimental-20260113090459",
|
|
76
|
+
"@lowdefy/connection-mongodb": "0.0.0-experimental-20260113090459",
|
|
77
|
+
"@lowdefy/connection-redis": "0.0.0-experimental-20260113090459",
|
|
78
|
+
"@lowdefy/connection-sendgrid": "0.0.0-experimental-20260113090459",
|
|
79
|
+
"@lowdefy/connection-stripe": "0.0.0-experimental-20260113090459",
|
|
80
|
+
"@lowdefy/operators-change-case": "0.0.0-experimental-20260113090459",
|
|
81
|
+
"@lowdefy/operators-diff": "0.0.0-experimental-20260113090459",
|
|
82
|
+
"@lowdefy/operators-jsonata": "0.0.0-experimental-20260113090459",
|
|
83
|
+
"@lowdefy/operators-moment": "0.0.0-experimental-20260113090459",
|
|
84
|
+
"@lowdefy/operators-mql": "0.0.0-experimental-20260113090459",
|
|
85
|
+
"@lowdefy/operators-nunjucks": "0.0.0-experimental-20260113090459",
|
|
86
|
+
"@lowdefy/operators-uuid": "0.0.0-experimental-20260113090459",
|
|
87
|
+
"@lowdefy/operators-yaml": "0.0.0-experimental-20260113090459",
|
|
88
|
+
"@lowdefy/plugin-auth0": "0.0.0-experimental-20260113090459",
|
|
89
|
+
"@lowdefy/plugin-aws": "0.0.0-experimental-20260113090459",
|
|
90
|
+
"@lowdefy/plugin-csv": "0.0.0-experimental-20260113090459",
|
|
91
|
+
"@lowdefy/plugin-next-auth": "0.0.0-experimental-20260113090459",
|
|
92
92
|
"@swc/cli": "0.1.63",
|
|
93
93
|
"@swc/core": "1.3.99",
|
|
94
94
|
"@swc/jest": "0.2.29",
|