@lowdefy/build 4.0.0-alpha.6 → 4.0.0-alpha.9
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 +1 -1
- package/dist/build/addDefaultPages/addDefaultPages.js +7 -3
- package/dist/build/buildAuth/buildAuth.js +1 -1
- package/dist/build/buildAuth/getPageRoles.js +1 -1
- package/dist/build/buildAuth/getProtectedPages.js +1 -1
- package/dist/build/buildConnections.js +1 -1
- package/dist/build/buildIcons.js +3 -3
- package/dist/build/buildMenu.js +1 -1
- package/dist/build/buildPages/buildBlock/buildBlock.js +6 -2
- package/dist/build/buildPages/buildBlock/buildEvents.js +5 -2
- package/dist/build/buildPages/buildBlock/buildRequests.js +1 -1
- package/dist/build/buildPages/buildBlock/buildSubBlocks.js +1 -1
- package/dist/build/buildPages/buildBlock/countBlockOperators.js +2 -2
- package/dist/build/buildPages/buildBlock/countBlockTypes.js +18 -0
- package/dist/build/buildPages/buildBlock/moveSkeletonBlocksToArea.js +35 -0
- package/dist/build/buildPages/buildBlock/moveSubBlocksToArea.js +1 -1
- package/dist/build/buildPages/buildBlock/setBlockId.js +1 -1
- package/dist/build/buildPages/buildBlock/validateBlock.js +2 -3
- package/dist/build/buildPages/buildPage.js +1 -1
- package/dist/build/buildPages/buildPages.js +1 -1
- package/dist/build/buildRefs/buildRefs.js +2 -1
- package/dist/build/buildRefs/evaluateBuildOperators.js +35 -0
- package/dist/build/buildRefs/getConfigFile.js +1 -1
- 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 +7 -4
- 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 +1 -1
- package/dist/build/buildRefs/recursiveBuild.js +9 -3
- package/dist/build/buildRefs/runRefResolver.js +1 -1
- package/dist/build/buildRefs/runTransformer.js +8 -4
- package/dist/build/buildStyles.js +3 -3
- package/dist/build/buildTypes.js +39 -20
- package/dist/build/cleanBuildDirectory.js +2 -2
- package/dist/build/copyPublicFolder.js +23 -0
- package/dist/build/testSchema.js +1 -1
- package/dist/build/updateServerPackageJson.js +2 -5
- package/dist/build/validateApp.js +1 -1
- package/dist/build/validateConfig.js +6 -1
- package/dist/build/writeApp.js +2 -5
- package/dist/build/writeConfig.js +2 -5
- package/dist/build/writeConnections.js +2 -5
- package/dist/build/writeGlobal.js +2 -5
- package/dist/build/writeMenus.js +2 -5
- package/dist/build/writePages.js +3 -14
- package/dist/build/writePluginImports/generateImportFile.js +7 -7
- package/dist/build/writePluginImports/writeActionImports.js +22 -0
- package/dist/build/writePluginImports/writeBlockImports.js +5 -8
- package/dist/build/writePluginImports/writeConnectionImports.js +5 -8
- package/dist/build/writePluginImports/writeIconImports.js +4 -7
- package/dist/build/writePluginImports/writeOperatorImports.js +9 -16
- package/dist/build/writePluginImports/writeStyleImports.js +5 -7
- package/dist/build/writeRequests.js +3 -8
- package/dist/build/writeTypes.js +2 -5
- package/dist/defaultTypesMap.json +1598 -0
- package/dist/index.js +134 -126
- package/dist/lowdefySchema.js +50 -12
- package/dist/scripts/generateDefaultTypes.js +26 -65
- package/dist/scripts/run.js +8 -4
- package/dist/test/buildRefs/testBuildRefsAsyncFunction.js +2 -2
- package/dist/test/buildRefs/testBuildRefsErrorResolver.js +2 -2
- package/dist/test/buildRefs/testBuildRefsNullResolver.js +2 -2
- package/dist/test/buildRefs/testBuildRefsParsingResolver.js +2 -2
- package/dist/test/buildRefs/testBuildRefsResolver.js +2 -2
- package/dist/test/buildRefs/testBuildRefsTransform.js +2 -2
- package/dist/test/buildRefs/testBuildRefsTransformIdentity.js +2 -2
- package/dist/test/testContext.js +1 -1
- package/dist/utils/countOperators.js +1 -1
- package/dist/utils/createCheckDuplicateId.js +1 -1
- package/dist/utils/createCounter.js +1 -1
- package/dist/utils/createPluginTypesMap.js +85 -0
- package/dist/utils/formatErrorMessage.js +2 -2
- package/dist/utils/{files/readConfigFile.js → readConfigFile.js} +1 -1
- package/dist/utils/{files/writeBuildArtifact.js → writeBuildArtifact.js} +3 -6
- package/package.json +41 -27
- package/dist/defaultTypes.json +0 -1159
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,6 +14,6 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { cleanDirectory } from '@lowdefy/node-utils';
|
|
16
16
|
async function cleanBuildDirectory({ context }) {
|
|
17
|
-
|
|
17
|
+
await cleanDirectory(context.directories.build);
|
|
18
18
|
}
|
|
19
19
|
export default cleanBuildDirectory;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 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 path from 'path';
|
|
16
|
+
import fs from 'fs';
|
|
17
|
+
import { copyDirectory } from '@lowdefy/node-utils';
|
|
18
|
+
async function copyPublicFolder({ context }) {
|
|
19
|
+
if (context.directories.config === context.directories.server) return;
|
|
20
|
+
if (!fs.existsSync(path.resolve(context.directories.config, 'public'))) return;
|
|
21
|
+
await copyDirectory(path.resolve(context.directories.config, 'public'), path.resolve(context.directories.server, 'public'));
|
|
22
|
+
}
|
|
23
|
+
export default copyPublicFolder;
|
package/dist/build/testSchema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -40,10 +40,7 @@ async function updateServerPackageJson({ components , context }) {
|
|
|
40
40
|
// be watching the file to trigger reinstalls
|
|
41
41
|
if (newPackageJsonContent !== packageJsonContent) {
|
|
42
42
|
context.logger.warn('Plugin dependencies have changed. Updating "package.json".');
|
|
43
|
-
await writeFile(
|
|
44
|
-
filePath,
|
|
45
|
-
content: newPackageJsonContent
|
|
46
|
-
});
|
|
43
|
+
await writeFile(filePath, newPackageJsonContent);
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
export default updateServerPackageJson;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -34,6 +34,11 @@ async function validateConfig({ components }) {
|
|
|
34
34
|
if (type.isNone(components.config.theme)) {
|
|
35
35
|
components.config.theme = {};
|
|
36
36
|
}
|
|
37
|
+
if (type.isString(components.config.basePath)) {
|
|
38
|
+
if (components.config.basePath[0] !== '/') {
|
|
39
|
+
throw Error('Base path must start with "/".');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
37
42
|
validate({
|
|
38
43
|
schema: lowdefySchema.definitions.authConfig,
|
|
39
44
|
data: components.config.auth
|
package/dist/build/writeApp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,6 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ async function writeApp({ components , context }) {
|
|
16
|
-
await context.writeBuildArtifact({
|
|
17
|
-
filePath: 'app.json',
|
|
18
|
-
content: JSON.stringify(components.app || {}, null, 2)
|
|
19
|
-
});
|
|
16
|
+
await context.writeBuildArtifact('app.json', JSON.stringify(components.app || {}, null, 2));
|
|
20
17
|
}
|
|
21
18
|
export default writeApp;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,6 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ async function writeConfig({ components , context }) {
|
|
16
|
-
await context.writeBuildArtifact({
|
|
17
|
-
filePath: 'config.json',
|
|
18
|
-
content: JSON.stringify(components.config || {}, null, 2)
|
|
19
|
-
});
|
|
16
|
+
await context.writeBuildArtifact('config.json', JSON.stringify(components.config || {}, null, 2));
|
|
20
17
|
}
|
|
21
18
|
export default writeConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -19,10 +19,7 @@ async function writeConnections({ components , context }) {
|
|
|
19
19
|
throw new Error(`Connections is not an array.`);
|
|
20
20
|
}
|
|
21
21
|
const writePromises = components.connections.map(async (connection)=>{
|
|
22
|
-
await context.writeBuildArtifact({
|
|
23
|
-
filePath: `connections/${connection.connectionId}.json`,
|
|
24
|
-
content: JSON.stringify(connection, null, 2)
|
|
25
|
-
});
|
|
22
|
+
await context.writeBuildArtifact(`connections/${connection.connectionId}.json`, JSON.stringify(connection, null, 2));
|
|
26
23
|
});
|
|
27
24
|
return Promise.all(writePromises);
|
|
28
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -20,9 +20,6 @@ async function writeGlobal({ components , context }) {
|
|
|
20
20
|
if (!type.isObject(components.global)) {
|
|
21
21
|
throw new Error('Global is not an object.');
|
|
22
22
|
}
|
|
23
|
-
await context.writeBuildArtifact(
|
|
24
|
-
filePath: 'global.json',
|
|
25
|
-
content: JSON.stringify(components.global, null, 2)
|
|
26
|
-
});
|
|
23
|
+
await context.writeBuildArtifact('global.json', JSON.stringify(components.global, null, 2));
|
|
27
24
|
}
|
|
28
25
|
export default writeGlobal;
|
package/dist/build/writeMenus.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -17,9 +17,6 @@ async function writeMenus({ components , context }) {
|
|
|
17
17
|
if (!type.isArray(components.menus)) {
|
|
18
18
|
throw new Error('Menus is not an array.');
|
|
19
19
|
}
|
|
20
|
-
await context.writeBuildArtifact(
|
|
21
|
-
filePath: 'menus.json',
|
|
22
|
-
content: JSON.stringify(components.menus, null, 2)
|
|
23
|
-
});
|
|
20
|
+
await context.writeBuildArtifact('menus.json', JSON.stringify(components.menus, null, 2));
|
|
24
21
|
}
|
|
25
22
|
export default writeMenus;
|
package/dist/build/writePages.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,21 +12,10 @@
|
|
|
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
|
-
*/
|
|
16
|
-
|
|
17
|
-
if (!type.isObject(page)) {
|
|
18
|
-
throw new Error(`Page is not an object. Received ${JSON.stringify(page)}`);
|
|
19
|
-
}
|
|
20
|
-
await context.writeBuildArtifact({
|
|
21
|
-
filePath: `pages/${page.pageId}/${page.pageId}.json`,
|
|
22
|
-
content: JSON.stringify(page, null, 2)
|
|
23
|
-
});
|
|
15
|
+
*/ async function writePage({ page , context }) {
|
|
16
|
+
await context.writeBuildArtifact(`pages/${page.pageId}/${page.pageId}.json`, JSON.stringify(page, null, 2));
|
|
24
17
|
}
|
|
25
18
|
async function writePages({ components , context }) {
|
|
26
|
-
if (type.isNone(components.pages)) return;
|
|
27
|
-
if (!type.isArray(components.pages)) {
|
|
28
|
-
throw new Error(`Pages is not an array.`);
|
|
29
|
-
}
|
|
30
19
|
const writePromises = components.pages.map((page)=>writePage({
|
|
31
20
|
page,
|
|
32
21
|
context
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,18 +14,18 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { nunjucksFunction } from '@lowdefy/nunjucks';
|
|
16
16
|
const template = `{%- for import in imports -%}
|
|
17
|
-
import { {{ import.
|
|
17
|
+
import { {{ import.originalTypeName }} as {{ import.typeName }} } from '{{ import.package }}/{{ importPath }}';
|
|
18
18
|
{% endfor -%}
|
|
19
19
|
export default {
|
|
20
20
|
{% for import in imports -%}
|
|
21
|
-
{{ import.
|
|
21
|
+
{{ import.typeName }},
|
|
22
22
|
{% endfor -%}
|
|
23
|
-
}
|
|
23
|
+
};`;
|
|
24
24
|
function generateImportFile({ types , importPath }) {
|
|
25
25
|
const templateFn = nunjucksFunction(template);
|
|
26
|
-
const imports = Object.keys(types).map((
|
|
27
|
-
|
|
28
|
-
...types[
|
|
26
|
+
const imports = Object.keys(types).map((typeName)=>({
|
|
27
|
+
typeName,
|
|
28
|
+
...types[typeName]
|
|
29
29
|
})
|
|
30
30
|
);
|
|
31
31
|
return templateFn({
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 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 generateImportFile from './generateImportFile.js';
|
|
16
|
+
async function writeActionImports({ components , context }) {
|
|
17
|
+
await context.writeBuildArtifact('plugins/actions.js', generateImportFile({
|
|
18
|
+
types: components.types.actions,
|
|
19
|
+
importPath: 'actions'
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
export default writeActionImports;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,12 +14,9 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import generateImportFile from './generateImportFile.js';
|
|
16
16
|
async function writeBlockImports({ components , context }) {
|
|
17
|
-
await context.writeBuildArtifact({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
importPath: 'blocks'
|
|
22
|
-
})
|
|
23
|
-
});
|
|
17
|
+
await context.writeBuildArtifact('plugins/blocks.js', generateImportFile({
|
|
18
|
+
types: components.types.blocks,
|
|
19
|
+
importPath: 'blocks'
|
|
20
|
+
}));
|
|
24
21
|
}
|
|
25
22
|
export default writeBlockImports;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,12 +14,9 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import generateImportFile from './generateImportFile.js';
|
|
16
16
|
async function writeConnectionImports({ components , context }) {
|
|
17
|
-
await context.writeBuildArtifact({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
importPath: 'connections'
|
|
22
|
-
})
|
|
23
|
-
});
|
|
17
|
+
await context.writeBuildArtifact('plugins/connections.js', generateImportFile({
|
|
18
|
+
types: components.types.connections,
|
|
19
|
+
importPath: 'connections'
|
|
20
|
+
}));
|
|
24
21
|
}
|
|
25
22
|
export default writeConnectionImports;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -24,11 +24,8 @@ export default {
|
|
|
24
24
|
};`;
|
|
25
25
|
async function writeIconImports({ components , context }) {
|
|
26
26
|
const templateFn = nunjucksFunction(template);
|
|
27
|
-
await context.writeBuildArtifact({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
packages: components.icons
|
|
31
|
-
})
|
|
32
|
-
});
|
|
27
|
+
await context.writeBuildArtifact('plugins/icons.js', templateFn({
|
|
28
|
+
packages: components.icons
|
|
29
|
+
}));
|
|
33
30
|
}
|
|
34
31
|
export default writeIconImports;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,20 +14,13 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import generateImportFile from './generateImportFile.js';
|
|
16
16
|
async function writeOperatorImports({ components , context }) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
await context.writeBuildArtifact({
|
|
26
|
-
filePath: 'plugins/operatorsServer.js',
|
|
27
|
-
content: generateImportFile({
|
|
28
|
-
types: components.types.operators.server,
|
|
29
|
-
importPath: 'operators/server'
|
|
30
|
-
})
|
|
31
|
-
});
|
|
17
|
+
await context.writeBuildArtifact('plugins/operatorsClient.js', generateImportFile({
|
|
18
|
+
types: components.types.operators.client,
|
|
19
|
+
importPath: 'operators/client'
|
|
20
|
+
}));
|
|
21
|
+
await context.writeBuildArtifact('plugins/operatorsServer.js', generateImportFile({
|
|
22
|
+
types: components.types.operators.server,
|
|
23
|
+
importPath: 'operators/server'
|
|
24
|
+
}));
|
|
32
25
|
}
|
|
33
26
|
export default writeOperatorImports;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,17 +14,15 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { nunjucksFunction } from '@lowdefy/nunjucks';
|
|
16
16
|
const template = `@import '@lowdefy/layout/style.less';
|
|
17
|
+
@import '@lowdefy/client/style.less';
|
|
17
18
|
{% for style in styles -%}
|
|
18
19
|
@import '{{ style }}';
|
|
19
20
|
{% endfor -%}
|
|
20
21
|
`;
|
|
21
22
|
async function writeStyleImports({ components , context }) {
|
|
22
23
|
const templateFn = nunjucksFunction(template);
|
|
23
|
-
await context.writeBuildArtifact({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
styles: components.styles
|
|
27
|
-
})
|
|
28
|
-
});
|
|
24
|
+
await context.writeBuildArtifact('plugins/styles.less', templateFn({
|
|
25
|
+
styles: components.styles
|
|
26
|
+
}));
|
|
29
27
|
}
|
|
30
28
|
export default writeStyleImports;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,13 +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
|
-
*/
|
|
16
|
-
async function writeRequestsOnPage({ page , context }) {
|
|
15
|
+
*/ async function writeRequestsOnPage({ page , context }) {
|
|
17
16
|
return Promise.all(page.requests.map(async (request)=>{
|
|
18
|
-
await context.writeBuildArtifact({
|
|
19
|
-
filePath: `pages/${page.pageId}/requests/${request.requestId}.json`,
|
|
20
|
-
content: JSON.stringify(request, null, 2)
|
|
21
|
-
});
|
|
17
|
+
await context.writeBuildArtifact(`pages/${page.pageId}/requests/${request.requestId}.json`, JSON.stringify(request, null, 2));
|
|
22
18
|
delete request.properties;
|
|
23
19
|
delete request.type;
|
|
24
20
|
delete request.connectionId;
|
|
@@ -26,7 +22,6 @@ async function writeRequestsOnPage({ page , context }) {
|
|
|
26
22
|
}));
|
|
27
23
|
}
|
|
28
24
|
async function writeRequests({ components , context }) {
|
|
29
|
-
if (type.isNone(components.pages)) return;
|
|
30
25
|
const writePromises = components.pages.map((page)=>writeRequestsOnPage({
|
|
31
26
|
page,
|
|
32
27
|
context
|
package/dist/build/writeTypes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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,6 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ async function writeTypes({ components , context }) {
|
|
16
|
-
await context.writeBuildArtifact(
|
|
17
|
-
filePath: 'types.json',
|
|
18
|
-
content: JSON.stringify(components.types, null, 2)
|
|
19
|
-
});
|
|
16
|
+
await context.writeBuildArtifact('types.json', JSON.stringify(components.types, null, 2));
|
|
20
17
|
}
|
|
21
18
|
export default writeTypes;
|