@lowdefy/build 4.0.0-alpha.12 → 4.0.0-alpha.15

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.
Files changed (30) hide show
  1. package/dist/build/addDefaultPages/addDefaultPages.js +2 -3
  2. package/dist/build/buildAuth/buildAuth.js +4 -1
  3. package/dist/build/buildAuth/getProtectedPages.js +2 -4
  4. package/dist/build/buildConnections.js +1 -1
  5. package/dist/build/buildImports/buildIconImports.js +4 -8
  6. package/dist/build/buildImports/buildImportsDev.js +1 -3
  7. package/dist/build/buildImports/buildImportsProd.js +1 -2
  8. package/dist/build/buildImports/buildStyleImports.js +3 -6
  9. package/dist/build/buildMenu.js +9 -13
  10. package/dist/build/buildPages/buildBlock/buildBlock.js +2 -2
  11. package/dist/build/buildPages/buildBlock/buildEvents.js +7 -9
  12. package/dist/build/buildPages/buildBlock/buildSubBlocks.js +2 -7
  13. package/dist/build/buildPages/buildPage.js +2 -2
  14. package/dist/build/buildPages/buildPages.js +3 -5
  15. package/dist/build/buildPages/buildTestPage.js +46 -0
  16. package/dist/build/buildRefs/evaluateBuildOperators.js +2 -3
  17. package/dist/build/buildTypes.js +2 -4
  18. package/dist/build/testSchema.js +4 -5
  19. package/dist/build/validateApp.js +1 -1
  20. package/dist/build/validateConfig.js +1 -1
  21. package/dist/build/writePages.js +1 -2
  22. package/dist/build/writeRequests.js +1 -2
  23. package/dist/createContext.js +54 -0
  24. package/dist/{defaultTypesMap.json → defaultTypesMap.js} +293 -291
  25. package/dist/index.js +13 -53
  26. package/dist/lowdefySchema.js +6 -0
  27. package/dist/scripts/generateDefaultTypes.js +4 -1
  28. package/dist/test/buildRefs/testBuildRefsResolver.js +1 -1
  29. package/dist/test/testContext.js +6 -1
  30. package/package.json +44 -41
package/dist/index.js CHANGED
@@ -12,13 +12,8 @@
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 { fileURLToPath } from 'url';
16
- import { mergeObjects } from '@lowdefy/helpers';
17
- import { readFile } from '@lowdefy/node-utils';
18
- import createCounter from './utils/createCounter.js';
15
+ */ import createContext from './createContext.js';
19
16
  import createPluginTypesMap from './utils/createPluginTypesMap.js';
20
- import createReadConfigFile from './utils/readConfigFile.js';
21
- import createWriteBuildArtifact from './utils/writeBuildArtifact.js';
22
17
  import addDefaultPages from './build/addDefaultPages/addDefaultPages.js';
23
18
  import buildAuth from './build/buildAuth/buildAuth.js';
24
19
  import buildConnections from './build/buildConnections.js';
@@ -43,83 +38,48 @@ import writeMenus from './build/writeMenus.js';
43
38
  import writePages from './build/writePages.js';
44
39
  import writeRequests from './build/writeRequests.js';
45
40
  import writeTypes from './build/writeTypes.js';
46
- async function createContext({ customTypesMap , directories , logger , refResolver , stage ='prod' }) {
47
- const defaultTypesMap = JSON.parse(await readFile(fileURLToPath(new URL('./defaultTypesMap.json', import.meta.url))));
48
- const context = {
49
- directories,
50
- logger,
51
- readConfigFile: createReadConfigFile({
52
- directories
53
- }),
54
- refResolver,
55
- stage,
56
- typeCounters: {
57
- actions: createCounter(),
58
- auth: {
59
- callbacks: createCounter(),
60
- events: createCounter(),
61
- providers: createCounter()
62
- },
63
- blocks: createCounter(),
64
- connections: createCounter(),
65
- requests: createCounter(),
66
- operators: {
67
- client: createCounter(),
68
- server: createCounter()
69
- }
70
- },
71
- typesMap: mergeObjects([
72
- defaultTypesMap,
73
- customTypesMap
74
- ]),
75
- writeBuildArtifact: createWriteBuildArtifact({
76
- directories
77
- })
78
- };
79
- return context;
80
- }
81
41
  async function build(options) {
82
- const context = await createContext(options);
42
+ const context = createContext(options);
83
43
  const components = await buildRefs({
84
44
  context
85
45
  });
86
- await testSchema({
46
+ testSchema({
87
47
  components,
88
48
  context
89
49
  });
90
- await validateApp({
50
+ validateApp({
91
51
  components,
92
52
  context
93
53
  });
94
- await validateConfig({
54
+ validateConfig({
95
55
  components,
96
56
  context
97
57
  });
98
- await addDefaultPages({
58
+ addDefaultPages({
99
59
  components,
100
60
  context
101
61
  });
102
- await buildAuth({
62
+ buildAuth({
103
63
  components,
104
64
  context
105
65
  });
106
- await buildConnections({
66
+ buildConnections({
107
67
  components,
108
68
  context
109
69
  });
110
- await buildPages({
70
+ buildPages({
111
71
  components,
112
72
  context
113
73
  });
114
- await buildMenu({
74
+ buildMenu({
115
75
  components,
116
76
  context
117
77
  });
118
- await buildTypes({
78
+ buildTypes({
119
79
  components,
120
80
  context
121
81
  });
122
- await buildImports({
82
+ buildImports({
123
83
  components,
124
84
  context
125
85
  });
@@ -175,5 +135,5 @@ async function build(options) {
175
135
  context
176
136
  });
177
137
  }
178
- export { createContext, createPluginTypesMap };
138
+ export { createPluginTypesMap };
179
139
  export default build;
@@ -691,6 +691,12 @@ export default {
691
691
  type: 'App "license" should be a string.'
692
692
  }
693
693
  },
694
+ version: {
695
+ type: 'string',
696
+ errorMessage: {
697
+ type: 'App "version" should be a string.'
698
+ }
699
+ },
694
700
  app: {
695
701
  $ref: '#/definitions/app'
696
702
  },
@@ -73,6 +73,9 @@ async function generateDefaultTypesMap() {
73
73
  version
74
74
  });
75
75
  }));
76
- await writeFile(path.resolve(process.cwd(), './dist/defaultTypesMap.json'), JSON.stringify(defaultTypesMap, null, 2));
76
+ await writeFile(path.resolve(process.cwd(), './dist/defaultTypesMap.js'), `const defaultTypesMap = ${JSON.stringify(defaultTypesMap, null, 2)};
77
+
78
+ export default defaultTypesMap;
79
+ `);
77
80
  }
78
81
  generateDefaultTypesMap();
@@ -17,7 +17,7 @@
17
17
  resolved: true,
18
18
  path,
19
19
  vars,
20
- contextId: context.id
20
+ stage: context.stage
21
21
  };
22
22
  }
23
23
  export default resolver;
@@ -22,12 +22,17 @@ function testContext({ writeBuildArtifact , configDirectory , readConfigFile , l
22
22
  succeed: ()=>{}
23
23
  };
24
24
  const context = {
25
- id: 'test',
25
+ stage: 'test',
26
26
  directories: {
27
27
  config: configDirectory || ''
28
28
  },
29
29
  typeCounters: {
30
30
  actions: createCounter(),
31
+ auth: {
32
+ callbacks: createCounter(),
33
+ events: createCounter(),
34
+ providers: createCounter()
35
+ },
31
36
  blocks: createCounter(),
32
37
  connections: createCounter(),
33
38
  requests: createCounter(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lowdefy/build",
3
- "version": "4.0.0-alpha.12",
4
- "licence": "Apache-2.0",
3
+ "version": "4.0.0-alpha.15",
4
+ "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
7
7
  "keywords": [
@@ -36,7 +36,10 @@
36
36
  "bin": {
37
37
  "lowdefy-build": "./dist/scripts/run.js"
38
38
  },
39
- "exports": "./dist/index.js",
39
+ "exports": {
40
+ ".": "./dist/index.js",
41
+ "./buildTestPage": "./dist/build/buildPages/buildTestPage.js"
42
+ },
40
43
  "files": [
41
44
  "dist/*"
42
45
  ],
@@ -49,49 +52,49 @@
49
52
  "test": "yarn node --experimental-vm-modules $(yarn bin jest)"
50
53
  },
51
54
  "dependencies": {
52
- "@lowdefy/ajv": "4.0.0-alpha.12",
53
- "@lowdefy/blocks-basic": "4.0.0-alpha.12",
54
- "@lowdefy/blocks-loaders": "4.0.0-alpha.12",
55
- "@lowdefy/helpers": "4.0.0-alpha.12",
56
- "@lowdefy/node-utils": "4.0.0-alpha.12",
57
- "@lowdefy/nunjucks": "4.0.0-alpha.12",
58
- "@lowdefy/operators": "4.0.0-alpha.12",
59
- "@lowdefy/operators-js": "4.0.0-alpha.12",
60
- "ajv": "8.9.0",
61
- "json5": "2.2.0",
55
+ "@lowdefy/ajv": "4.0.0-alpha.15",
56
+ "@lowdefy/blocks-basic": "4.0.0-alpha.15",
57
+ "@lowdefy/blocks-loaders": "4.0.0-alpha.15",
58
+ "@lowdefy/helpers": "4.0.0-alpha.15",
59
+ "@lowdefy/node-utils": "4.0.0-alpha.15",
60
+ "@lowdefy/nunjucks": "4.0.0-alpha.15",
61
+ "@lowdefy/operators": "4.0.0-alpha.15",
62
+ "@lowdefy/operators-js": "4.0.0-alpha.15",
63
+ "ajv": "8.11.0",
64
+ "json5": "2.2.1",
62
65
  "uuid": "8.3.2",
63
- "yaml": "2.0.0-10",
64
- "yargs": "17.3.1"
66
+ "yaml": "2.1.1",
67
+ "yargs": "17.5.1"
65
68
  },
66
69
  "devDependencies": {
67
- "@jest/globals": "27.5.1",
68
- "@lowdefy/actions-core": "4.0.0-alpha.12",
69
- "@lowdefy/blocks-antd": "4.0.0-alpha.12",
70
- "@lowdefy/blocks-color-selectors": "4.0.0-alpha.12",
71
- "@lowdefy/blocks-echarts": "4.0.0-alpha.12",
72
- "@lowdefy/blocks-markdown": "4.0.0-alpha.12",
73
- "@lowdefy/connection-axios-http": "4.0.0-alpha.12",
74
- "@lowdefy/connection-elasticsearch": "4.0.0-alpha.12",
75
- "@lowdefy/connection-google-sheets": "4.0.0-alpha.12",
76
- "@lowdefy/connection-knex": "4.0.0-alpha.12",
77
- "@lowdefy/connection-mongodb": "4.0.0-alpha.12",
78
- "@lowdefy/connection-redis": "4.0.0-alpha.12",
79
- "@lowdefy/connection-sendgrid": "4.0.0-alpha.12",
80
- "@lowdefy/connection-stripe": "4.0.0-alpha.12",
81
- "@lowdefy/operators-change-case": "4.0.0-alpha.12",
82
- "@lowdefy/operators-diff": "4.0.0-alpha.12",
83
- "@lowdefy/operators-mql": "4.0.0-alpha.12",
84
- "@lowdefy/operators-nunjucks": "4.0.0-alpha.12",
85
- "@lowdefy/operators-uuid": "4.0.0-alpha.12",
86
- "@lowdefy/operators-yaml": "4.0.0-alpha.12",
87
- "@lowdefy/plugin-next-auth": "4.0.0-alpha.12",
88
- "@swc/cli": "0.1.55",
89
- "@swc/core": "1.2.135",
90
- "@swc/jest": "0.2.17",
91
- "jest": "27.5.1"
70
+ "@jest/globals": "28.1.0",
71
+ "@lowdefy/actions-core": "4.0.0-alpha.15",
72
+ "@lowdefy/blocks-antd": "4.0.0-alpha.15",
73
+ "@lowdefy/blocks-color-selectors": "4.0.0-alpha.15",
74
+ "@lowdefy/blocks-echarts": "4.0.0-alpha.15",
75
+ "@lowdefy/blocks-markdown": "4.0.0-alpha.15",
76
+ "@lowdefy/connection-axios-http": "4.0.0-alpha.15",
77
+ "@lowdefy/connection-elasticsearch": "4.0.0-alpha.15",
78
+ "@lowdefy/connection-google-sheets": "4.0.0-alpha.15",
79
+ "@lowdefy/connection-knex": "4.0.0-alpha.15",
80
+ "@lowdefy/connection-mongodb": "4.0.0-alpha.15",
81
+ "@lowdefy/connection-redis": "4.0.0-alpha.15",
82
+ "@lowdefy/connection-sendgrid": "4.0.0-alpha.15",
83
+ "@lowdefy/connection-stripe": "4.0.0-alpha.15",
84
+ "@lowdefy/operators-change-case": "4.0.0-alpha.15",
85
+ "@lowdefy/operators-diff": "4.0.0-alpha.15",
86
+ "@lowdefy/operators-mql": "4.0.0-alpha.15",
87
+ "@lowdefy/operators-nunjucks": "4.0.0-alpha.15",
88
+ "@lowdefy/operators-uuid": "4.0.0-alpha.15",
89
+ "@lowdefy/operators-yaml": "4.0.0-alpha.15",
90
+ "@lowdefy/plugin-next-auth": "4.0.0-alpha.15",
91
+ "@swc/cli": "0.1.57",
92
+ "@swc/core": "1.2.194",
93
+ "@swc/jest": "0.2.21",
94
+ "jest": "28.1.0"
92
95
  },
93
96
  "publishConfig": {
94
97
  "access": "public"
95
98
  },
96
- "gitHead": "41b6138a81bee7da362dad06345bc9f87b2c2133"
99
+ "gitHead": "b4e4538475e997f95baa37f01f39689240e6f01c"
97
100
  }