@lowdefy/build 4.0.0-alpha.6 → 4.0.0-alpha.7
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/addDefaultPages/addDefaultPages.js +6 -2
- package/dist/build/buildPages/buildBlock/buildEvents.js +4 -1
- package/dist/build/buildRefs/getUserJavascriptFunction.js +6 -3
- package/dist/build/buildRefs/parseRefContent.js +2 -2
- package/dist/build/buildRefs/runTransformer.js +5 -1
- package/dist/build/buildTypes.js +23 -14
- package/dist/build/cleanBuildDirectory.js +1 -1
- package/dist/build/copyPublicFolder.js +23 -0
- package/dist/build/updateServerPackageJson.js +1 -4
- package/dist/build/validateConfig.js +5 -0
- package/dist/build/writeApp.js +1 -4
- package/dist/build/writeConfig.js +1 -4
- package/dist/build/writeConnections.js +1 -4
- package/dist/build/writeGlobal.js +1 -4
- package/dist/build/writeMenus.js +1 -4
- package/dist/build/writePages.js +2 -13
- package/dist/build/writePluginImports/writeActionImports.js +22 -0
- package/dist/build/writePluginImports/writeBlockImports.js +4 -7
- package/dist/build/writePluginImports/writeConnectionImports.js +4 -7
- package/dist/build/writePluginImports/writeIconImports.js +3 -6
- package/dist/build/writePluginImports/writeOperatorImports.js +8 -15
- package/dist/build/writePluginImports/writeStyleImports.js +3 -6
- package/dist/build/writeRequests.js +2 -7
- package/dist/build/writeTypes.js +1 -4
- package/dist/defaultTypes.json +543 -243
- package/dist/index.js +118 -113
- package/dist/lowdefySchema.js +7 -0
- package/dist/scripts/generateDefaultTypes.js +11 -7
- package/dist/scripts/run.js +7 -3
- package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +1 -1
- package/dist/test/buildRefs/testBuildRefsErrorResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsNullResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsParsingResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsResolver.js +1 -1
- package/dist/test/buildRefs/testBuildRefsTransform.js +1 -1
- package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +1 -1
- package/dist/utils/formatErrorMessage.js +1 -1
- package/dist/utils/{files/readConfigFile.js → readConfigFile.js} +0 -0
- package/dist/utils/{files/writeBuildArtifact.js → writeBuildArtifact.js} +2 -5
- package/package.json +36 -27
package/dist/index.js
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { readFile } from '@lowdefy/node-utils';
|
|
16
16
|
import createCounter from './utils/createCounter.js';
|
|
17
|
-
import createReadConfigFile from './utils/
|
|
18
|
-
import createWriteBuildArtifact from './utils/
|
|
17
|
+
import createReadConfigFile from './utils/readConfigFile.js';
|
|
18
|
+
import createWriteBuildArtifact from './utils/writeBuildArtifact.js';
|
|
19
19
|
import addDefaultPages from './build/addDefaultPages/addDefaultPages.js';
|
|
20
20
|
import buildAuth from './build/buildAuth/buildAuth.js';
|
|
21
21
|
import buildConnections from './build/buildConnections.js';
|
|
@@ -26,11 +26,13 @@ import buildRefs from './build/buildRefs/buildRefs.js';
|
|
|
26
26
|
import buildStyles from './build/buildStyles.js';
|
|
27
27
|
import buildTypes from './build/buildTypes.js';
|
|
28
28
|
import cleanBuildDirectory from './build/cleanBuildDirectory.js';
|
|
29
|
+
import copyPublicFolder from './build/copyPublicFolder.js';
|
|
29
30
|
import testSchema from './build/testSchema.js';
|
|
30
31
|
import validateApp from './build/validateApp.js';
|
|
31
32
|
import validateConfig from './build/validateConfig.js';
|
|
32
33
|
import updateServerPackageJson from './build/updateServerPackageJson.js';
|
|
33
34
|
import writeApp from './build/writeApp.js';
|
|
35
|
+
import writeActionImports from './build/writePluginImports/writeActionImports.js';
|
|
34
36
|
import writeBlockImports from './build/writePluginImports/writeBlockImports.js';
|
|
35
37
|
import writeConfig from './build/writeConfig.js';
|
|
36
38
|
import writeConnectionImports from './build/writePluginImports/writeConnectionImports.js';
|
|
@@ -73,117 +75,120 @@ async function createContext(options) {
|
|
|
73
75
|
}
|
|
74
76
|
async function build(options) {
|
|
75
77
|
const context = await createContext(options);
|
|
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
|
-
|
|
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
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
context
|
|
185
|
-
|
|
186
|
-
|
|
78
|
+
const components = await buildRefs({
|
|
79
|
+
context
|
|
80
|
+
});
|
|
81
|
+
await testSchema({
|
|
82
|
+
components,
|
|
83
|
+
context
|
|
84
|
+
});
|
|
85
|
+
await validateApp({
|
|
86
|
+
components,
|
|
87
|
+
context
|
|
88
|
+
});
|
|
89
|
+
await validateConfig({
|
|
90
|
+
components,
|
|
91
|
+
context
|
|
92
|
+
});
|
|
93
|
+
await addDefaultPages({
|
|
94
|
+
components,
|
|
95
|
+
context
|
|
96
|
+
});
|
|
97
|
+
await buildAuth({
|
|
98
|
+
components,
|
|
99
|
+
context
|
|
100
|
+
});
|
|
101
|
+
await buildConnections({
|
|
102
|
+
components,
|
|
103
|
+
context
|
|
104
|
+
});
|
|
105
|
+
await buildPages({
|
|
106
|
+
components,
|
|
107
|
+
context
|
|
108
|
+
});
|
|
109
|
+
await buildMenu({
|
|
110
|
+
components,
|
|
111
|
+
context
|
|
112
|
+
});
|
|
113
|
+
await buildTypes({
|
|
114
|
+
components,
|
|
115
|
+
context
|
|
116
|
+
});
|
|
117
|
+
await buildIcons({
|
|
118
|
+
components,
|
|
119
|
+
context
|
|
120
|
+
});
|
|
121
|
+
await buildStyles({
|
|
122
|
+
components,
|
|
123
|
+
context
|
|
124
|
+
});
|
|
125
|
+
await cleanBuildDirectory({
|
|
126
|
+
context
|
|
127
|
+
});
|
|
128
|
+
await writeActionImports({
|
|
129
|
+
components,
|
|
130
|
+
context
|
|
131
|
+
});
|
|
132
|
+
await writeApp({
|
|
133
|
+
components,
|
|
134
|
+
context
|
|
135
|
+
});
|
|
136
|
+
await writeConnections({
|
|
137
|
+
components,
|
|
138
|
+
context
|
|
139
|
+
});
|
|
140
|
+
await writeRequests({
|
|
141
|
+
components,
|
|
142
|
+
context
|
|
143
|
+
});
|
|
144
|
+
await writePages({
|
|
145
|
+
components,
|
|
146
|
+
context
|
|
147
|
+
});
|
|
148
|
+
await writeConfig({
|
|
149
|
+
components,
|
|
150
|
+
context
|
|
151
|
+
});
|
|
152
|
+
await writeGlobal({
|
|
153
|
+
components,
|
|
154
|
+
context
|
|
155
|
+
});
|
|
156
|
+
await writeMenus({
|
|
157
|
+
components,
|
|
158
|
+
context
|
|
159
|
+
});
|
|
160
|
+
await writeTypes({
|
|
161
|
+
components,
|
|
162
|
+
context
|
|
163
|
+
});
|
|
164
|
+
await writeBlockImports({
|
|
165
|
+
components,
|
|
166
|
+
context
|
|
167
|
+
});
|
|
168
|
+
await writeConnectionImports({
|
|
169
|
+
components,
|
|
170
|
+
context
|
|
171
|
+
});
|
|
172
|
+
await writeOperatorImports({
|
|
173
|
+
components,
|
|
174
|
+
context
|
|
175
|
+
});
|
|
176
|
+
await writeStyleImports({
|
|
177
|
+
components,
|
|
178
|
+
context
|
|
179
|
+
});
|
|
180
|
+
await writeIconImports({
|
|
181
|
+
components,
|
|
182
|
+
context
|
|
183
|
+
});
|
|
184
|
+
await updateServerPackageJson({
|
|
185
|
+
components,
|
|
186
|
+
context
|
|
187
|
+
});
|
|
188
|
+
await copyPublicFolder({
|
|
189
|
+
components,
|
|
190
|
+
context
|
|
191
|
+
});
|
|
187
192
|
}
|
|
188
193
|
export { createContext };
|
|
189
194
|
export default build;
|
package/dist/lowdefySchema.js
CHANGED
|
@@ -628,6 +628,13 @@ export default {
|
|
|
628
628
|
auth: {
|
|
629
629
|
$ref: '#/definitions/authConfig'
|
|
630
630
|
},
|
|
631
|
+
basePath: {
|
|
632
|
+
type: 'string',
|
|
633
|
+
description: 'App base path to apply to all routes. Base path must start with "/".',
|
|
634
|
+
errorMessage: {
|
|
635
|
+
type: 'App "config.basePath" should be a string.'
|
|
636
|
+
}
|
|
637
|
+
},
|
|
631
638
|
homePageId: {
|
|
632
639
|
type: 'string',
|
|
633
640
|
description: 'Page id to use as homepage. When visiting home route "/", the router will redirect to this page. If not provided, the first page in default or first menu will be used as the homePageId.',
|
|
@@ -17,18 +17,25 @@
|
|
|
17
17
|
import { type } from '@lowdefy/helpers';
|
|
18
18
|
import { readFile, writeFile } from '@lowdefy/node-utils';
|
|
19
19
|
const defaultPackages = [
|
|
20
|
+
'@lowdefy/actions-core',
|
|
20
21
|
'@lowdefy/blocks-antd',
|
|
21
22
|
'@lowdefy/blocks-basic',
|
|
22
|
-
|
|
23
|
+
'@lowdefy/blocks-color-selectors',
|
|
23
24
|
'@lowdefy/blocks-echarts',
|
|
24
25
|
'@lowdefy/blocks-loaders',
|
|
25
26
|
'@lowdefy/blocks-markdown',
|
|
26
27
|
'@lowdefy/connection-axios-http',
|
|
28
|
+
'@lowdefy/connection-elasticsearch',
|
|
29
|
+
'@lowdefy/connection-google-sheets',
|
|
30
|
+
'@lowdefy/connection-knex',
|
|
31
|
+
'@lowdefy/connection-mongodb',
|
|
27
32
|
'@lowdefy/connection-redis',
|
|
33
|
+
'@lowdefy/connection-sendgrid',
|
|
34
|
+
'@lowdefy/connection-stripe',
|
|
28
35
|
'@lowdefy/operators-change-case',
|
|
29
|
-
|
|
36
|
+
'@lowdefy/operators-diff',
|
|
30
37
|
'@lowdefy/operators-js',
|
|
31
|
-
|
|
38
|
+
'@lowdefy/operators-mql',
|
|
32
39
|
'@lowdefy/operators-nunjucks',
|
|
33
40
|
'@lowdefy/operators-uuid',
|
|
34
41
|
'@lowdefy/operators-yaml',
|
|
@@ -103,9 +110,6 @@ async function generateDefaultTypes() {
|
|
|
103
110
|
defaultTypes.icons[packageName] = types.icons;
|
|
104
111
|
}
|
|
105
112
|
}));
|
|
106
|
-
await writeFile(
|
|
107
|
-
filePath: path.resolve(process.cwd(), './dist/defaultTypes.json'),
|
|
108
|
-
content: JSON.stringify(defaultTypes, null, 2)
|
|
109
|
-
});
|
|
113
|
+
await writeFile(path.resolve(process.cwd(), './dist/defaultTypes.json'), JSON.stringify(defaultTypes, null, 2));
|
|
110
114
|
}
|
|
111
115
|
generateDefaultTypes();
|
package/dist/scripts/run.js
CHANGED
|
@@ -14,14 +14,18 @@
|
|
|
14
14
|
See the License for the specific language governing permissions and
|
|
15
15
|
limitations under the License.
|
|
16
16
|
*/ import path from 'path';
|
|
17
|
+
import yargs from 'yargs';
|
|
18
|
+
import { hideBin } from 'yargs/helpers';
|
|
17
19
|
import build from '../index.js';
|
|
20
|
+
const argv = yargs(hideBin(process.argv)).argv;
|
|
18
21
|
async function run() {
|
|
19
22
|
await build({
|
|
20
23
|
logger: console,
|
|
24
|
+
refResolver: argv.refResolver || process.env.LOWDEFY_BUILD_REF_RESOLVER,
|
|
21
25
|
directories: {
|
|
22
|
-
build: path.resolve(process.env.LOWDEFY_DIRECTORY_BUILD || path.join(process.cwd(), 'build')),
|
|
23
|
-
config: path.resolve(process.env.LOWDEFY_DIRECTORY_CONFIG || process.cwd()),
|
|
24
|
-
server: path.resolve(process.env.LOWDEFY_DIRECTORY_SERVER || process.cwd())
|
|
26
|
+
build: path.resolve(argv.buildDirectory || process.env.LOWDEFY_DIRECTORY_BUILD || path.join(process.cwd(), 'build')),
|
|
27
|
+
config: path.resolve(argv.configDirectory || process.env.LOWDEFY_DIRECTORY_CONFIG || process.cwd()),
|
|
28
|
+
server: path.resolve(argv.serverDirectory || process.env.LOWDEFY_DIRECTORY_SERVER || process.cwd())
|
|
25
29
|
}
|
|
26
30
|
});
|
|
27
31
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { get, type } from '@lowdefy/helpers';
|
|
16
16
|
function formatArrayKey({ index , object }) {
|
|
17
|
-
if (!type.isNone(object.id) || !type.isNone(object.type)) {
|
|
17
|
+
if (type.isObject(object) && (!type.isNone(object.id) || !type.isNone(object.type))) {
|
|
18
18
|
const objectId = type.isNone(object.id) ? '_ERROR_MISSING_ID_' : object.id;
|
|
19
19
|
const objectType = type.isNone(object.type) ? '_ERROR_MISSING_TYPE_' : object.type;
|
|
20
20
|
return `[${index}:${objectId}:${objectType}]`;
|
|
File without changes
|
|
@@ -15,11 +15,8 @@
|
|
|
15
15
|
*/ import path from 'path';
|
|
16
16
|
import { writeFile } from '@lowdefy/node-utils';
|
|
17
17
|
function createWriteBuildArtifact({ directories }) {
|
|
18
|
-
async function writeBuildArtifact(
|
|
19
|
-
|
|
20
|
-
filePath: path.resolve(directories.build, filePath),
|
|
21
|
-
content
|
|
22
|
-
});
|
|
18
|
+
async function writeBuildArtifact(filePath, content) {
|
|
19
|
+
await writeFile(path.join(directories.build, filePath), content);
|
|
23
20
|
}
|
|
24
21
|
return writeBuildArtifact;
|
|
25
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/build",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.7",
|
|
4
4
|
"licence": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -42,41 +42,50 @@
|
|
|
42
42
|
"prepare": "yarn build",
|
|
43
43
|
"start": "node dist/scripts/run.js",
|
|
44
44
|
"swc": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
|
|
45
|
-
"test": "
|
|
45
|
+
"test": "yarn node --experimental-vm-modules $(yarn bin jest)"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@lowdefy/ajv": "4.0.0-alpha.
|
|
49
|
-
"@lowdefy/helpers": "4.0.0-alpha.
|
|
50
|
-
"@lowdefy/node-utils": "4.0.0-alpha.
|
|
51
|
-
"@lowdefy/nunjucks": "4.0.0-alpha.
|
|
52
|
-
"ajv": "8.
|
|
53
|
-
"js-yaml": "4.1.0",
|
|
48
|
+
"@lowdefy/ajv": "4.0.0-alpha.7",
|
|
49
|
+
"@lowdefy/helpers": "4.0.0-alpha.7",
|
|
50
|
+
"@lowdefy/node-utils": "4.0.0-alpha.7",
|
|
51
|
+
"@lowdefy/nunjucks": "4.0.0-alpha.7",
|
|
52
|
+
"ajv": "8.9.0",
|
|
54
53
|
"json5": "2.2.0",
|
|
55
|
-
"uuid": "8.3.2"
|
|
54
|
+
"uuid": "8.3.2",
|
|
55
|
+
"yaml": "2.0.0-10",
|
|
56
|
+
"yargs": "17.3.1"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
|
-
"@
|
|
59
|
-
"@lowdefy/
|
|
60
|
-
"@lowdefy/blocks-
|
|
61
|
-
"@lowdefy/blocks-
|
|
62
|
-
"@lowdefy/blocks-
|
|
63
|
-
"@lowdefy/blocks-
|
|
64
|
-
"@lowdefy/
|
|
65
|
-
"@lowdefy/
|
|
66
|
-
"@lowdefy/
|
|
67
|
-
"@lowdefy/
|
|
68
|
-
"@lowdefy/
|
|
69
|
-
"@lowdefy/
|
|
70
|
-
"@lowdefy/
|
|
71
|
-
"@lowdefy/
|
|
72
|
-
"@lowdefy/
|
|
59
|
+
"@jest/globals": "27.5.1",
|
|
60
|
+
"@lowdefy/actions-core": "4.0.0-alpha.7",
|
|
61
|
+
"@lowdefy/blocks-antd": "4.0.0-alpha.7",
|
|
62
|
+
"@lowdefy/blocks-basic": "4.0.0-alpha.7",
|
|
63
|
+
"@lowdefy/blocks-color-selectors": "4.0.0-alpha.7",
|
|
64
|
+
"@lowdefy/blocks-echarts": "4.0.0-alpha.7",
|
|
65
|
+
"@lowdefy/blocks-loaders": "4.0.0-alpha.7",
|
|
66
|
+
"@lowdefy/blocks-markdown": "4.0.0-alpha.7",
|
|
67
|
+
"@lowdefy/connection-axios-http": "4.0.0-alpha.7",
|
|
68
|
+
"@lowdefy/connection-elasticsearch": "4.0.0-alpha.7",
|
|
69
|
+
"@lowdefy/connection-google-sheets": "4.0.0-alpha.7",
|
|
70
|
+
"@lowdefy/connection-knex": "4.0.0-alpha.7",
|
|
71
|
+
"@lowdefy/connection-mongodb": "4.0.0-alpha.7",
|
|
72
|
+
"@lowdefy/connection-redis": "4.0.0-alpha.7",
|
|
73
|
+
"@lowdefy/connection-sendgrid": "4.0.0-alpha.7",
|
|
74
|
+
"@lowdefy/connection-stripe": "4.0.0-alpha.7",
|
|
75
|
+
"@lowdefy/operators-change-case": "4.0.0-alpha.7",
|
|
76
|
+
"@lowdefy/operators-diff": "4.0.0-alpha.7",
|
|
77
|
+
"@lowdefy/operators-js": "4.0.0-alpha.7",
|
|
78
|
+
"@lowdefy/operators-mql": "4.0.0-alpha.7",
|
|
79
|
+
"@lowdefy/operators-nunjucks": "4.0.0-alpha.7",
|
|
80
|
+
"@lowdefy/operators-uuid": "4.0.0-alpha.7",
|
|
81
|
+
"@lowdefy/operators-yaml": "4.0.0-alpha.7",
|
|
73
82
|
"@swc/cli": "0.1.55",
|
|
74
|
-
"@swc/core": "1.2.
|
|
83
|
+
"@swc/core": "1.2.135",
|
|
75
84
|
"@swc/jest": "0.2.17",
|
|
76
|
-
"jest": "27.
|
|
85
|
+
"jest": "27.5.1"
|
|
77
86
|
},
|
|
78
87
|
"publishConfig": {
|
|
79
88
|
"access": "public"
|
|
80
89
|
},
|
|
81
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "52ec14639d00de910cf9b8ab25bf933ca891cff5"
|
|
82
91
|
}
|