@lowdefy/build 0.0.0-experimental-20260112140412 → 0.0.0-experimental-20260113081624

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/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,69 @@ async function build(options) {
51
52
  const components = await buildRefs({
52
53
  context
53
54
  });
54
- testSchema({
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
+ context.logger.error(`\nBuild failed with ${context.errors.length} error(s):\n`);
115
+ throw new Error(`Build failed with ${context.errors.length} error(s). See above for details.`);
116
+ }
117
+ // Write steps - only if no errors
110
118
  await cleanBuildDirectory({
111
119
  context
112
120
  });
@@ -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-20260112140412",
3
+ "version": "0.0.0-experimental-20260113081624",
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-20260112140412",
48
- "@lowdefy/blocks-basic": "0.0.0-experimental-20260112140412",
49
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20260112140412",
50
- "@lowdefy/helpers": "0.0.0-experimental-20260112140412",
51
- "@lowdefy/node-utils": "0.0.0-experimental-20260112140412",
52
- "@lowdefy/nunjucks": "0.0.0-experimental-20260112140412",
53
- "@lowdefy/operators": "0.0.0-experimental-20260112140412",
54
- "@lowdefy/operators-js": "0.0.0-experimental-20260112140412",
47
+ "@lowdefy/ajv": "0.0.0-experimental-20260113081624",
48
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20260113081624",
49
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20260113081624",
50
+ "@lowdefy/helpers": "0.0.0-experimental-20260113081624",
51
+ "@lowdefy/node-utils": "0.0.0-experimental-20260113081624",
52
+ "@lowdefy/nunjucks": "0.0.0-experimental-20260113081624",
53
+ "@lowdefy/operators": "0.0.0-experimental-20260113081624",
54
+ "@lowdefy/operators-js": "0.0.0-experimental-20260113081624",
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-20260112140412",
63
- "@lowdefy/actions-pdf-make": "0.0.0-experimental-20260112140412",
64
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260112140412",
65
- "@lowdefy/blocks-algolia": "0.0.0-experimental-20260112140412",
66
- "@lowdefy/blocks-antd": "0.0.0-experimental-20260112140412",
67
- "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20260112140412",
68
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20260112140412",
69
- "@lowdefy/blocks-google-maps": "0.0.0-experimental-20260112140412",
70
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20260112140412",
71
- "@lowdefy/blocks-qr": "0.0.0-experimental-20260112140412",
72
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20260112140412",
73
- "@lowdefy/connection-elasticsearch": "0.0.0-experimental-20260112140412",
74
- "@lowdefy/connection-google-sheets": "0.0.0-experimental-20260112140412",
75
- "@lowdefy/connection-knex": "0.0.0-experimental-20260112140412",
76
- "@lowdefy/connection-mongodb": "0.0.0-experimental-20260112140412",
77
- "@lowdefy/connection-redis": "0.0.0-experimental-20260112140412",
78
- "@lowdefy/connection-sendgrid": "0.0.0-experimental-20260112140412",
79
- "@lowdefy/connection-stripe": "0.0.0-experimental-20260112140412",
80
- "@lowdefy/operators-change-case": "0.0.0-experimental-20260112140412",
81
- "@lowdefy/operators-diff": "0.0.0-experimental-20260112140412",
82
- "@lowdefy/operators-jsonata": "0.0.0-experimental-20260112140412",
83
- "@lowdefy/operators-moment": "0.0.0-experimental-20260112140412",
84
- "@lowdefy/operators-mql": "0.0.0-experimental-20260112140412",
85
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260112140412",
86
- "@lowdefy/operators-uuid": "0.0.0-experimental-20260112140412",
87
- "@lowdefy/operators-yaml": "0.0.0-experimental-20260112140412",
88
- "@lowdefy/plugin-auth0": "0.0.0-experimental-20260112140412",
89
- "@lowdefy/plugin-aws": "0.0.0-experimental-20260112140412",
90
- "@lowdefy/plugin-csv": "0.0.0-experimental-20260112140412",
91
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260112140412",
62
+ "@lowdefy/actions-core": "0.0.0-experimental-20260113081624",
63
+ "@lowdefy/actions-pdf-make": "0.0.0-experimental-20260113081624",
64
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20260113081624",
65
+ "@lowdefy/blocks-algolia": "0.0.0-experimental-20260113081624",
66
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20260113081624",
67
+ "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20260113081624",
68
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20260113081624",
69
+ "@lowdefy/blocks-google-maps": "0.0.0-experimental-20260113081624",
70
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20260113081624",
71
+ "@lowdefy/blocks-qr": "0.0.0-experimental-20260113081624",
72
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20260113081624",
73
+ "@lowdefy/connection-elasticsearch": "0.0.0-experimental-20260113081624",
74
+ "@lowdefy/connection-google-sheets": "0.0.0-experimental-20260113081624",
75
+ "@lowdefy/connection-knex": "0.0.0-experimental-20260113081624",
76
+ "@lowdefy/connection-mongodb": "0.0.0-experimental-20260113081624",
77
+ "@lowdefy/connection-redis": "0.0.0-experimental-20260113081624",
78
+ "@lowdefy/connection-sendgrid": "0.0.0-experimental-20260113081624",
79
+ "@lowdefy/connection-stripe": "0.0.0-experimental-20260113081624",
80
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20260113081624",
81
+ "@lowdefy/operators-diff": "0.0.0-experimental-20260113081624",
82
+ "@lowdefy/operators-jsonata": "0.0.0-experimental-20260113081624",
83
+ "@lowdefy/operators-moment": "0.0.0-experimental-20260113081624",
84
+ "@lowdefy/operators-mql": "0.0.0-experimental-20260113081624",
85
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20260113081624",
86
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20260113081624",
87
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20260113081624",
88
+ "@lowdefy/plugin-auth0": "0.0.0-experimental-20260113081624",
89
+ "@lowdefy/plugin-aws": "0.0.0-experimental-20260113081624",
90
+ "@lowdefy/plugin-csv": "0.0.0-experimental-20260113081624",
91
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20260113081624",
92
92
  "@swc/cli": "0.1.63",
93
93
  "@swc/core": "1.3.99",
94
94
  "@swc/jest": "0.2.29",