@lowdefy/build 4.0.0-rc.9 → 4.0.1
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/404.js +2 -3
- package/dist/build/addDefaultPages/addDefaultPages.js +2 -2
- package/dist/build/addKeys.js +56 -14
- package/dist/build/{validateApp.js → buildApp.js} +10 -4
- package/dist/build/buildAuth/buildAuth.js +17 -2
- package/dist/build/buildAuth/buildAuthPlugins.js +5 -5
- package/dist/build/buildAuth/buildPageAuth.js +2 -2
- package/dist/build/buildAuth/getPageRoles.js +2 -2
- package/dist/build/buildAuth/getProtectedPages.js +2 -2
- package/dist/build/buildAuth/validateAuthConfig.js +2 -2
- package/dist/build/buildConnections.js +2 -2
- package/dist/build/buildImports/buildIconImports.js +6 -4
- package/dist/build/buildImports/buildImports.js +2 -2
- package/dist/build/buildImports/buildImportsDev.js +4 -4
- package/dist/build/buildImports/buildImportsProd.js +2 -2
- package/dist/build/buildImports/buildStyleImports.js +2 -2
- package/dist/build/buildImports/defaultIconsDev.js +1 -1
- package/dist/build/buildImports/defaultIconsProd.js +1 -1
- package/dist/build/buildMenu.js +4 -4
- package/dist/build/buildPages/buildBlock/buildBlock.js +1 -1
- package/dist/build/buildPages/buildBlock/buildEvents.js +2 -2
- package/dist/build/buildPages/buildBlock/buildRequests.js +2 -2
- package/dist/build/buildPages/buildBlock/buildSubBlocks.js +1 -1
- package/dist/build/buildPages/buildBlock/countBlockOperators.js +3 -3
- package/dist/build/buildPages/buildBlock/countBlockTypes.js +2 -2
- package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +1 -1
- package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +1 -1
- package/dist/build/buildPages/buildBlock/setBlockId.js +2 -2
- package/dist/build/buildPages/buildBlock/validateBlock.js +2 -2
- package/dist/build/buildPages/buildPage.js +2 -7
- package/dist/build/buildPages/buildPages.js +2 -2
- package/dist/build/buildPages/buildTestPage.js +2 -2
- package/dist/build/buildRefs/buildRefs.js +2 -2
- package/dist/build/buildRefs/evaluateBuildOperators.js +3 -3
- package/dist/build/buildRefs/getConfigFile.js +2 -2
- package/dist/build/buildRefs/getKey.js +2 -2
- package/dist/build/buildRefs/getRefContent.js +2 -2
- package/dist/build/buildRefs/getRefPath.js +1 -1
- package/dist/build/buildRefs/getRefsFromFile.js +1 -1
- package/dist/build/buildRefs/getUserJavascriptFunction.js +2 -2
- package/dist/build/buildRefs/makeRefDefinition.js +1 -1
- package/dist/build/buildRefs/parseNunjucks.js +1 -1
- package/dist/build/buildRefs/parseRefContent.js +3 -3
- package/dist/build/buildRefs/populateRefs.js +2 -2
- package/dist/build/buildRefs/recursiveBuild.js +3 -3
- package/dist/build/buildRefs/runRefResolver.js +2 -2
- package/dist/build/buildRefs/runTransformer.js +2 -2
- package/dist/build/buildTypes.js +13 -5
- package/dist/build/cleanBuildDirectory.js +2 -2
- package/dist/build/copyPublicFolder.js +2 -2
- package/dist/build/testSchema.js +3 -3
- package/dist/build/updateServerPackageJson.js +2 -2
- package/dist/build/validateConfig.js +2 -2
- package/dist/build/writeApp.js +3 -5
- package/dist/build/writeAuth.js +3 -5
- package/dist/build/writeConfig.js +3 -5
- package/dist/build/writeConnections.js +3 -5
- package/dist/build/writeGlobal.js +3 -5
- package/dist/build/writeMaps.js +4 -8
- package/dist/build/writeMenus.js +3 -5
- package/dist/build/writePages.js +4 -6
- package/dist/build/writePluginImports/generateImportFile.js +2 -2
- package/dist/build/writePluginImports/writeActionImports.js +2 -2
- package/dist/build/writePluginImports/writeAuthImports.js +2 -2
- package/dist/build/writePluginImports/writeBlockImports.js +2 -2
- package/dist/build/writePluginImports/writeConnectionImports.js +2 -2
- package/dist/build/writePluginImports/writeIconImports.js +2 -2
- package/dist/build/writePluginImports/writeOperatorImports.js +2 -2
- package/dist/build/writePluginImports/writePluginImports.js +2 -2
- package/dist/build/writePluginImports/writeStyleImports.js +2 -2
- package/dist/build/writeRequests.js +4 -6
- package/dist/build/writeTypes.js +3 -5
- package/dist/createContext.js +3 -2
- package/dist/defaultTypesMap.js +685 -644
- package/dist/index.js +3 -3
- package/dist/lowdefySchema.js +18 -0
- package/dist/scripts/generateDefaultTypes.js +3 -2
- package/dist/scripts/run.js +6 -6
- 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/test/testContext.js +5 -2
- package/dist/utils/countOperators.js +2 -2
- package/dist/utils/createCheckDuplicateId.js +5 -5
- package/dist/utils/createCounter.js +1 -1
- package/dist/utils/createPluginTypesMap.js +3 -3
- package/dist/utils/formatErrorMessage.js +4 -4
- package/dist/utils/makeId.js +5 -2
- package/dist/utils/readConfigFile.js +2 -2
- package/dist/utils/writeBuildArtifact.js +2 -2
- package/package.json +52 -53
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
id: 'home',
|
|
31
31
|
type: 'Button',
|
|
32
32
|
properties: {
|
|
33
|
-
title: 'Go to home page'
|
|
34
|
-
type: 'Link'
|
|
33
|
+
title: 'Go to home page'
|
|
35
34
|
},
|
|
36
35
|
events: {
|
|
37
36
|
onClick: [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import page404 from './404.js';
|
|
17
|
-
function addDefaultPages({ components
|
|
17
|
+
function addDefaultPages({ components }) {
|
|
18
18
|
// If not copied, the same object is mutated by build every time
|
|
19
19
|
// build runs for dev server. See #647
|
|
20
20
|
const defaultPages = [
|
package/dist/build/addKeys.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,15 +14,45 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import makeId from '../utils/makeId.js';
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
function recArray({ array, nextKey, key, keyMap, keyMapId }) {
|
|
18
|
+
array.forEach((item, index)=>{
|
|
19
|
+
if (type.isObject(item)) {
|
|
20
|
+
let path = `${key}.${nextKey}[${index}]`;
|
|
21
|
+
// TODO: Convert all artifacts to not modify id.
|
|
22
|
+
const id = item.blockId ?? item.menuId ?? item.menuItemId ?? item.requestId ?? item.connectionId ?? item.connectionId ?? item.id;
|
|
23
|
+
if (id) {
|
|
24
|
+
path = `${path.slice(0, -1)}:${id}]`;
|
|
25
|
+
}
|
|
26
|
+
if (item.type) {
|
|
27
|
+
path = `${path.slice(0, -1)}:${item.type}]`;
|
|
28
|
+
}
|
|
29
|
+
recAddKeys({
|
|
30
|
+
object: item,
|
|
31
|
+
key: path,
|
|
32
|
+
keyMap: keyMap,
|
|
33
|
+
parentKeyMapId: keyMapId
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (type.isArray(item)) {
|
|
37
|
+
recArray({
|
|
38
|
+
array: item,
|
|
39
|
+
nextKey,
|
|
40
|
+
key,
|
|
41
|
+
keyMap,
|
|
42
|
+
keyMapId
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function recAddKeys({ object, key, keyMap, parentKeyMapId }) {
|
|
48
|
+
const keyMapId = makeId();
|
|
49
|
+
keyMap[keyMapId] = {
|
|
20
50
|
key,
|
|
21
51
|
'~r': object['~r'],
|
|
22
|
-
'~k_parent':
|
|
52
|
+
'~k_parent': parentKeyMapId
|
|
23
53
|
};
|
|
24
54
|
Object.defineProperty(object, '~k', {
|
|
25
|
-
value:
|
|
55
|
+
value: keyMapId,
|
|
26
56
|
enumerable: false,
|
|
27
57
|
writable: true,
|
|
28
58
|
configurable: true
|
|
@@ -30,19 +60,31 @@ function recAddKeys(object, key, keyMap, parentId) {
|
|
|
30
60
|
delete object['~r'];
|
|
31
61
|
Object.keys(object).forEach((nextKey)=>{
|
|
32
62
|
if (type.isObject(object[nextKey])) {
|
|
33
|
-
recAddKeys(
|
|
63
|
+
recAddKeys({
|
|
64
|
+
object: object[nextKey],
|
|
65
|
+
key: `${key}.${nextKey}`,
|
|
66
|
+
keyMap: keyMap,
|
|
67
|
+
parentKeyMapId: keyMapId
|
|
68
|
+
});
|
|
34
69
|
}
|
|
35
70
|
if (type.isArray(object[nextKey])) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
71
|
+
recArray({
|
|
72
|
+
array: object[nextKey],
|
|
73
|
+
nextKey,
|
|
74
|
+
key,
|
|
75
|
+
keyMap,
|
|
76
|
+
keyMapId
|
|
40
77
|
});
|
|
41
78
|
}
|
|
42
79
|
});
|
|
43
80
|
}
|
|
44
|
-
function addKeys({ components
|
|
45
|
-
const
|
|
46
|
-
recAddKeys(
|
|
81
|
+
function addKeys({ components, context }) {
|
|
82
|
+
const keyMapId = makeId(true);
|
|
83
|
+
recAddKeys({
|
|
84
|
+
object: components,
|
|
85
|
+
key: 'root',
|
|
86
|
+
keyMap: context.keyMap,
|
|
87
|
+
parentKeyMapId: keyMapId
|
|
88
|
+
});
|
|
47
89
|
}
|
|
48
90
|
export default addKeys;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -12,8 +12,9 @@
|
|
|
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 {
|
|
16
|
-
|
|
15
|
+
*/ import { execSync } from 'child_process';
|
|
16
|
+
import { type } from '@lowdefy/helpers';
|
|
17
|
+
function buildApp({ components }) {
|
|
17
18
|
if (type.isNone(components.app)) {
|
|
18
19
|
components.app = {};
|
|
19
20
|
}
|
|
@@ -29,6 +30,11 @@ function validateApp({ components }) {
|
|
|
29
30
|
if (type.isNone(components.app.html.appendHead)) {
|
|
30
31
|
components.app.html.appendHead = '';
|
|
31
32
|
}
|
|
33
|
+
try {
|
|
34
|
+
components.app.git_sha = execSync('git rev-parse HEAD').toString().trim();
|
|
35
|
+
} catch (_) {
|
|
36
|
+
//pass
|
|
37
|
+
}
|
|
32
38
|
return components;
|
|
33
39
|
}
|
|
34
|
-
export default
|
|
40
|
+
export default buildApp;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,8 +16,23 @@
|
|
|
16
16
|
import buildAuthPlugins from './buildAuthPlugins.js';
|
|
17
17
|
import buildPageAuth from './buildPageAuth.js';
|
|
18
18
|
import validateAuthConfig from './validateAuthConfig.js';
|
|
19
|
-
|
|
19
|
+
let warningLogged = false;
|
|
20
|
+
function buildAuth({ components, context }) {
|
|
20
21
|
const configured = !type.isNone(components.auth);
|
|
22
|
+
if (configured && !context.entitlements.includes('AUTH')) {
|
|
23
|
+
if (!warningLogged) {
|
|
24
|
+
context.logger.warn(`
|
|
25
|
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
26
|
+
┃ Authentication configured without a license key. ┃
|
|
27
|
+
┠──────────────────────────────────────────────────┨
|
|
28
|
+
┃ Paid features can not be used in production ┃
|
|
29
|
+
┃ without a valid license. ┃
|
|
30
|
+
┃ ┃
|
|
31
|
+
┃ See https://docs.lowdefy.com/licenses. ┃
|
|
32
|
+
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`);
|
|
33
|
+
warningLogged = true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
21
36
|
validateAuthConfig({
|
|
22
37
|
components
|
|
23
38
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
function buildAuthPlugin({ counter
|
|
16
|
+
function buildAuthPlugin({ counter, pluginConfig, typeClass }) {
|
|
17
17
|
if (type.isArray(pluginConfig)) {
|
|
18
18
|
pluginConfig.forEach((plugin)=>{
|
|
19
19
|
if (type.isUndefined(plugin.id)) {
|
|
@@ -29,8 +29,8 @@ function buildAuthPlugin({ counter , pluginConfig , typeClass }) {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function buildAdapter({ components
|
|
33
|
-
const { adapter
|
|
32
|
+
function buildAdapter({ components, context }) {
|
|
33
|
+
const { adapter } = components.auth;
|
|
34
34
|
if (type.isNone(adapter)) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
@@ -45,7 +45,7 @@ function buildAdapter({ components , context }) {
|
|
|
45
45
|
}
|
|
46
46
|
context.typeCounters.auth.adapters.increment(adapter.type);
|
|
47
47
|
}
|
|
48
|
-
function buildAuthPlugins({ components
|
|
48
|
+
function buildAuthPlugins({ components, context }) {
|
|
49
49
|
const counters = context.typeCounters.auth;
|
|
50
50
|
const authConfig = components.auth;
|
|
51
51
|
buildAdapter({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import getPageRoles from './getPageRoles.js';
|
|
17
17
|
import getProtectedPages from './getProtectedPages.js';
|
|
18
|
-
function buildPageAuth({ components
|
|
18
|
+
function buildPageAuth({ components }) {
|
|
19
19
|
const protectedPages = getProtectedPages({
|
|
20
20
|
components
|
|
21
21
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -12,7 +12,7 @@
|
|
|
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
|
-
*/ function getPageRoles({ components
|
|
15
|
+
*/ function getPageRoles({ components }) {
|
|
16
16
|
const roles = components.auth.pages.roles;
|
|
17
17
|
const pageRoles = {};
|
|
18
18
|
Object.keys(roles).forEach((roleName)=>{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
function getProtectedPages({ components
|
|
16
|
+
function getProtectedPages({ components }) {
|
|
17
17
|
const pageIds = (components.pages || []).map((page)=>page.id);
|
|
18
18
|
let protectedPages = [];
|
|
19
19
|
if (type.isArray(components.auth.pages.public)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import { validate } from '@lowdefy/ajv';
|
|
17
17
|
import lowdefySchema from '../../lowdefySchema.js';
|
|
18
|
-
async function validateAuthConfig({ components
|
|
18
|
+
async function validateAuthConfig({ components }) {
|
|
19
19
|
if (type.isNone(components.auth)) {
|
|
20
20
|
components.auth = {};
|
|
21
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import countOperators from '../utils/countOperators.js';
|
|
17
17
|
import createCheckDuplicateId from '../utils/createCheckDuplicateId.js';
|
|
18
|
-
function buildConnections({ components
|
|
18
|
+
function buildConnections({ components, context }) {
|
|
19
19
|
const checkDuplicateConnectionId = createCheckDuplicateId({
|
|
20
20
|
message: 'Duplicate connectionId "{{ id }}".'
|
|
21
21
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
'react-icons/im': /"(Im[A-Z0-9]\w*)"/gm,
|
|
30
30
|
'react-icons/io': /"(IoIos[A-Z0-9]\w*)"/gm,
|
|
31
31
|
'react-icons/io5': /"(Io[A-Z0-9]\w*)"/gm,
|
|
32
|
+
'react-icons/lu': /"(Lu[A-Z0-9]\w*)"/gm,
|
|
32
33
|
'react-icons/md': /"(Md[A-Z0-9]\w*)"/gm,
|
|
34
|
+
'react-icons/pi': /"(Pi[A-Z0-9]\w*)"/gm,
|
|
33
35
|
'react-icons/ri': /"(Ri[A-Z0-9]\w*)"/gm,
|
|
34
36
|
'react-icons/rx': /"(Rx[A-Z0-9]\w*)"/gm,
|
|
35
37
|
'react-icons/si': /"(Si[A-Z0-9]\w*)"/gm,
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
'react-icons/vsc': /"(Vsc[A-Z0-9]\w*)"/gm,
|
|
41
43
|
'react-icons/wi': /"(Wi[A-Z0-9]\w*)"/gm
|
|
42
44
|
};
|
|
43
|
-
function getConfigIcons({ components
|
|
45
|
+
function getConfigIcons({ components, icons, regex }) {
|
|
44
46
|
[
|
|
45
47
|
...JSON.stringify(components.global || {}).matchAll(regex)
|
|
46
48
|
].map((match)=>icons.add(match[1]));
|
|
@@ -51,7 +53,7 @@ function getConfigIcons({ components , icons , regex }) {
|
|
|
51
53
|
...JSON.stringify(components.pages || []).matchAll(regex)
|
|
52
54
|
].map((match)=>icons.add(match[1]));
|
|
53
55
|
}
|
|
54
|
-
function getBlockDefaultIcons({ blocks
|
|
56
|
+
function getBlockDefaultIcons({ blocks, context, icons, regex }) {
|
|
55
57
|
blocks.forEach((block)=>{
|
|
56
58
|
(context.typesMap.icons[block.typeName] || []).forEach((icon)=>{
|
|
57
59
|
[
|
|
@@ -60,7 +62,7 @@ function getBlockDefaultIcons({ blocks , context , icons , regex }) {
|
|
|
60
62
|
});
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
|
-
function buildIconImports({ blocks
|
|
65
|
+
function buildIconImports({ blocks, components, context, defaults = {} }) {
|
|
64
66
|
const iconImports = [];
|
|
65
67
|
Object.entries(iconPackages).forEach(([iconPackage, regex])=>{
|
|
66
68
|
defaults;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import buildImportsDev from './buildImportsDev.js';
|
|
16
16
|
import buildImportsProd from './buildImportsProd.js';
|
|
17
|
-
function buildImports({ components
|
|
17
|
+
function buildImports({ components, context }) {
|
|
18
18
|
if (context.stage === 'dev') {
|
|
19
19
|
components.imports = buildImportsDev({
|
|
20
20
|
components,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import buildIconImports from './buildIconImports.js';
|
|
16
16
|
import buildStyleImports from './buildStyleImports.js';
|
|
17
17
|
import defaultIconsDev from './defaultIconsDev.js';
|
|
18
|
-
function getPluginPackages({ components
|
|
18
|
+
function getPluginPackages({ components }) {
|
|
19
19
|
const pluginPackages = new Set();
|
|
20
20
|
function getPackages(types) {
|
|
21
21
|
Object.values(types).forEach((type)=>{
|
|
@@ -34,14 +34,14 @@ function getPluginPackages({ components }) {
|
|
|
34
34
|
getPackages(components.types.operators.server);
|
|
35
35
|
return pluginPackages;
|
|
36
36
|
}
|
|
37
|
-
function buildImportClassDev({ pluginPackages
|
|
37
|
+
function buildImportClassDev({ pluginPackages, map }) {
|
|
38
38
|
return Object.entries(map).map(([typeName, type])=>({
|
|
39
39
|
originalTypeName: type.originalTypeName,
|
|
40
40
|
package: type.package,
|
|
41
41
|
typeName
|
|
42
42
|
})).filter((type)=>pluginPackages.has(type.package));
|
|
43
43
|
}
|
|
44
|
-
function buildImportsDev({ components
|
|
44
|
+
function buildImportsDev({ components, context }) {
|
|
45
45
|
const pluginPackages = getPluginPackages({
|
|
46
46
|
components
|
|
47
47
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -22,7 +22,7 @@ function buildImportClassProd(types) {
|
|
|
22
22
|
typeName
|
|
23
23
|
}));
|
|
24
24
|
}
|
|
25
|
-
function buildImportsProd({ components
|
|
25
|
+
function buildImportsProd({ components, context }) {
|
|
26
26
|
const blocks = buildImportClassProd(components.types.blocks);
|
|
27
27
|
return {
|
|
28
28
|
actions: buildImportClassProd(components.types.actions),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -12,7 +12,7 @@
|
|
|
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
|
-
*/ function buildStyleImports({ blocks
|
|
15
|
+
*/ function buildStyleImports({ blocks, context }) {
|
|
16
16
|
const styles = new Set();
|
|
17
17
|
blocks.forEach((block)=>{
|
|
18
18
|
styles.add(...(context.typesMap.styles.packages[block.package] || []).map((style)=>`${block.package}/${style}`));
|
package/dist/build/buildMenu.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import createCheckDuplicateId from '../utils/createCheckDuplicateId.js';
|
|
17
|
-
function buildDefaultMenu({ components
|
|
17
|
+
function buildDefaultMenu({ components, context }) {
|
|
18
18
|
context.logger.warn('No menus found. Building default menu.');
|
|
19
19
|
const pages = type.isArray(components.pages) ? components.pages : [];
|
|
20
20
|
const menus = [
|
|
@@ -30,7 +30,7 @@ function buildDefaultMenu({ components , context }) {
|
|
|
30
30
|
];
|
|
31
31
|
return menus;
|
|
32
32
|
}
|
|
33
|
-
function loopItems({ parent
|
|
33
|
+
function loopItems({ parent, menuId, pages, missingPageWarnings, checkDuplicateMenuItemId }) {
|
|
34
34
|
if (type.isArray(parent.links)) {
|
|
35
35
|
parent.links.forEach((menuItem)=>{
|
|
36
36
|
if (menuItem.type === 'MenuLink') {
|
|
@@ -75,7 +75,7 @@ function loopItems({ parent , menuId , pages , missingPageWarnings , checkDuplic
|
|
|
75
75
|
parent.links = parent.links.filter((item)=>item.remove !== true);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
function buildMenu({ components
|
|
78
|
+
function buildMenu({ components, context }) {
|
|
79
79
|
const pages = type.isArray(components.pages) ? components.pages : [];
|
|
80
80
|
if (type.isUndefined(components.menus) || components.menus.length === 0) {
|
|
81
81
|
components.menus = buildDefaultMenu({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
import createCheckDuplicateId from '../../../utils/createCheckDuplicateId.js';
|
|
17
|
-
function checkAction(action, { blockId
|
|
17
|
+
function checkAction(action, { blockId, checkDuplicateActionId, eventId, pageId, typeCounters }) {
|
|
18
18
|
if (type.isUndefined(action.id)) {
|
|
19
19
|
throw new Error(`Action id missing on event "${eventId}" on block "${blockId}" on page "${pageId}".`);
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
function buildRequest(request, pageContext) {
|
|
17
|
-
const { auth
|
|
17
|
+
const { auth, checkDuplicateRequestId, pageId, typeCounters } = pageContext;
|
|
18
18
|
if (type.isUndefined(request.id)) {
|
|
19
19
|
throw new Error(`Request id missing at page "${pageId}".`);
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import countOperators from '../../../utils/countOperators.js';
|
|
16
|
-
function countBlockOperators(block, { typeCounters
|
|
16
|
+
function countBlockOperators(block, { typeCounters }) {
|
|
17
17
|
// eslint-disable-next-line no-unused-vars
|
|
18
|
-
const { requests
|
|
18
|
+
const { requests, areas, blocks, ...webBlock } = block;
|
|
19
19
|
countOperators(webBlock, {
|
|
20
20
|
counter: typeCounters.operators.client
|
|
21
21
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -12,7 +12,7 @@
|
|
|
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
|
-
*/ function countBlockTypes(block, { typeCounters
|
|
15
|
+
*/ function countBlockTypes(block, { typeCounters }) {
|
|
16
16
|
typeCounters.blocks.increment(block.type);
|
|
17
17
|
}
|
|
18
18
|
export default countBlockTypes;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -12,7 +12,7 @@
|
|
|
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
|
-
*/ function setBlockId(block, { pageId
|
|
15
|
+
*/ function setBlockId(block, { pageId, blockIdCounter }) {
|
|
16
16
|
block.blockId = block.id;
|
|
17
17
|
block.id = `block:${pageId}:${block.blockId}:${blockIdCounter.getCount(block.blockId)}`;
|
|
18
18
|
blockIdCounter.increment(block.blockId);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
function validateBlock(block, { pageId
|
|
16
|
+
function validateBlock(block, { pageId }) {
|
|
17
17
|
if (!type.isObject(block)) {
|
|
18
18
|
throw new Error(`Expected block to be an object on page "${pageId}". Received ${JSON.stringify(block)}.`);
|
|
19
19
|
}
|