@lowdefy/build 0.0.0-experimental-20251010122007 → 0.0.0-experimental-20251203145918

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
@@ -42,7 +42,6 @@ import writeMaps from './build/writeMaps.js';
42
42
  import writeMenus from './build/writeMenus.js';
43
43
  import writePages from './build/writePages.js';
44
44
  import writePluginImports from './build/writePluginImports/writePluginImports.js';
45
- import writePluginDocs from './build/writePluginDocs/writePluginDocs.js';
46
45
  import writeRequests from './build/writeRequests.js';
47
46
  import writeTypes from './build/writeTypes.js';
48
47
  async function build(options) {
@@ -125,19 +124,20 @@ async function build(options) {
125
124
  components,
126
125
  context
127
126
  });
128
- await writePages({
127
+ console.log('components.pages', components.pages.map((page)=>page.id));
128
+ await writeMaps({
129
129
  components,
130
130
  context
131
131
  });
132
- await writeConfig({
132
+ await writePages({
133
133
  components,
134
134
  context
135
135
  });
136
- await writeGlobal({
136
+ await writeConfig({
137
137
  components,
138
138
  context
139
139
  });
140
- await writeMaps({
140
+ await writeGlobal({
141
141
  components,
142
142
  context
143
143
  });
@@ -153,9 +153,6 @@ async function build(options) {
153
153
  components,
154
154
  context
155
155
  });
156
- await writePluginDocs({
157
- context
158
- });
159
156
  await writeJs({
160
157
  components,
161
158
  context
@@ -17,6 +17,7 @@ function createCheckDuplicateId({ message }) {
17
17
  const template = nunjucksFunction(message);
18
18
  const ids = new Set();
19
19
  function checkDuplicateId({ id, blockId, eventId, menuId, pageId }) {
20
+ console.log('checkDuplicateId', ids.has(id.toLowerCase()), id, id.toLowerCase());
20
21
  if (ids.has(id.toLowerCase())) throw new Error(template({
21
22
  id,
22
23
  blockId,
@@ -0,0 +1,15 @@
1
+ import { type } from '@lowdefy/helpers';
2
+ import crypto from 'crypto';
3
+ // Sort object keys to ensure stable stringification
4
+ function stableStringify(obj) {
5
+ if (type.isObject(obj)) {
6
+ return '{' + Object.keys(obj).sort().map((k)=>`"${k}":${stableStringify(obj[k])}`).join(',') + '}';
7
+ }
8
+ if (type.isArray(obj)) {
9
+ return '[' + obj.map(stableStringify).join(',') + ']';
10
+ }
11
+ return JSON.stringify(obj);
12
+ }
13
+ export default function makeRefHash(refDef) {
14
+ return crypto.createHash('sha1').update(stableStringify(refDef) || '').digest('base64');
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/build",
3
- "version": "0.0.0-experimental-20251010122007",
3
+ "version": "0.0.0-experimental-20251203145918",
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-20251010122007",
48
- "@lowdefy/blocks-basic": "0.0.0-experimental-20251010122007",
49
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20251010122007",
50
- "@lowdefy/helpers": "0.0.0-experimental-20251010122007",
51
- "@lowdefy/node-utils": "0.0.0-experimental-20251010122007",
52
- "@lowdefy/nunjucks": "0.0.0-experimental-20251010122007",
53
- "@lowdefy/operators": "0.0.0-experimental-20251010122007",
54
- "@lowdefy/operators-js": "0.0.0-experimental-20251010122007",
47
+ "@lowdefy/ajv": "0.0.0-experimental-20251203145918",
48
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20251203145918",
49
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20251203145918",
50
+ "@lowdefy/helpers": "0.0.0-experimental-20251203145918",
51
+ "@lowdefy/node-utils": "0.0.0-experimental-20251203145918",
52
+ "@lowdefy/nunjucks": "0.0.0-experimental-20251203145918",
53
+ "@lowdefy/operators": "0.0.0-experimental-20251203145918",
54
+ "@lowdefy/operators-js": "0.0.0-experimental-20251203145918",
55
55
  "ajv": "8.12.0",
56
56
  "json5": "2.2.3",
57
57
  "yaml": "2.3.4",
@@ -59,35 +59,35 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@jest/globals": "28.1.3",
62
- "@lowdefy/actions-core": "0.0.0-experimental-20251010122007",
63
- "@lowdefy/actions-pdf-make": "0.0.0-experimental-20251010122007",
64
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20251010122007",
65
- "@lowdefy/blocks-algolia": "0.0.0-experimental-20251010122007",
66
- "@lowdefy/blocks-antd": "0.0.0-experimental-20251010122007",
67
- "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20251010122007",
68
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20251010122007",
69
- "@lowdefy/blocks-google-maps": "0.0.0-experimental-20251010122007",
70
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20251010122007",
71
- "@lowdefy/blocks-qr": "0.0.0-experimental-20251010122007",
72
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20251010122007",
73
- "@lowdefy/connection-elasticsearch": "0.0.0-experimental-20251010122007",
74
- "@lowdefy/connection-google-sheets": "0.0.0-experimental-20251010122007",
75
- "@lowdefy/connection-knex": "0.0.0-experimental-20251010122007",
76
- "@lowdefy/connection-mongodb": "0.0.0-experimental-20251010122007",
77
- "@lowdefy/connection-redis": "0.0.0-experimental-20251010122007",
78
- "@lowdefy/connection-sendgrid": "0.0.0-experimental-20251010122007",
79
- "@lowdefy/connection-stripe": "0.0.0-experimental-20251010122007",
80
- "@lowdefy/operators-change-case": "0.0.0-experimental-20251010122007",
81
- "@lowdefy/operators-diff": "0.0.0-experimental-20251010122007",
82
- "@lowdefy/operators-moment": "0.0.0-experimental-20251010122007",
83
- "@lowdefy/operators-mql": "0.0.0-experimental-20251010122007",
84
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20251010122007",
85
- "@lowdefy/operators-uuid": "0.0.0-experimental-20251010122007",
86
- "@lowdefy/operators-yaml": "0.0.0-experimental-20251010122007",
87
- "@lowdefy/plugin-auth0": "0.0.0-experimental-20251010122007",
88
- "@lowdefy/plugin-aws": "0.0.0-experimental-20251010122007",
89
- "@lowdefy/plugin-csv": "0.0.0-experimental-20251010122007",
90
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20251010122007",
62
+ "@lowdefy/actions-core": "0.0.0-experimental-20251203145918",
63
+ "@lowdefy/actions-pdf-make": "0.0.0-experimental-20251203145918",
64
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20251203145918",
65
+ "@lowdefy/blocks-algolia": "0.0.0-experimental-20251203145918",
66
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20251203145918",
67
+ "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20251203145918",
68
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20251203145918",
69
+ "@lowdefy/blocks-google-maps": "0.0.0-experimental-20251203145918",
70
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20251203145918",
71
+ "@lowdefy/blocks-qr": "0.0.0-experimental-20251203145918",
72
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20251203145918",
73
+ "@lowdefy/connection-elasticsearch": "0.0.0-experimental-20251203145918",
74
+ "@lowdefy/connection-google-sheets": "0.0.0-experimental-20251203145918",
75
+ "@lowdefy/connection-knex": "0.0.0-experimental-20251203145918",
76
+ "@lowdefy/connection-mongodb": "0.0.0-experimental-20251203145918",
77
+ "@lowdefy/connection-redis": "0.0.0-experimental-20251203145918",
78
+ "@lowdefy/connection-sendgrid": "0.0.0-experimental-20251203145918",
79
+ "@lowdefy/connection-stripe": "0.0.0-experimental-20251203145918",
80
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20251203145918",
81
+ "@lowdefy/operators-diff": "0.0.0-experimental-20251203145918",
82
+ "@lowdefy/operators-moment": "0.0.0-experimental-20251203145918",
83
+ "@lowdefy/operators-mql": "0.0.0-experimental-20251203145918",
84
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20251203145918",
85
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20251203145918",
86
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20251203145918",
87
+ "@lowdefy/plugin-auth0": "0.0.0-experimental-20251203145918",
88
+ "@lowdefy/plugin-aws": "0.0.0-experimental-20251203145918",
89
+ "@lowdefy/plugin-csv": "0.0.0-experimental-20251203145918",
90
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20251203145918",
91
91
  "@swc/cli": "0.1.63",
92
92
  "@swc/core": "1.3.99",
93
93
  "@swc/jest": "0.2.29",
@@ -1,63 +0,0 @@
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 fs from 'fs';
16
- import path from 'path';
17
- async function writeDocs({ context, items }) {
18
- try {
19
- for (const { type, config, category, connectionType } of items){
20
- // Try to read documentation.md from the package
21
- let documentationContent = '';
22
- try {
23
- const packagePath = path.join(process.cwd(), 'node_modules', config.package);
24
- let documentationPath;
25
- if (category === 'requests') {
26
- documentationPath = path.join(packagePath, 'dist', 'connections', connectionType, config.originalTypeName, 'documentation.md');
27
- } else if (category === 'operators') {
28
- // For operators, determine the environment
29
- let env = 'shared';
30
- if (config.groups && config.groups.length === 1) {
31
- if (config.groups.includes('client')) {
32
- env = 'client';
33
- } else if (config.groups.includes('server')) {
34
- env = 'server';
35
- }
36
- }
37
- // If groups has both or none, use 'shared'
38
- const name = config.originalTypeName.replace(/^_/, '');
39
- documentationPath = path.join(packagePath, 'dist', 'operators', env, name, 'documentation.md');
40
- } else {
41
- documentationPath = path.join(packagePath, 'dist', category, config.originalTypeName, 'documentation.md');
42
- }
43
- if (fs.existsSync(documentationPath)) {
44
- documentationContent = fs.readFileSync(documentationPath, 'utf8');
45
- }
46
- } catch (error) {
47
- // Continue without documentation if it can't be read
48
- context.logger.warn(`Could not read documentation for ${type}:`, error.message);
49
- }
50
- const documentationFileName = `${type}.md`;
51
- let outputPath;
52
- if (category === 'requests') {
53
- outputPath = `docs/requests/${connectionType}/${documentationFileName}`;
54
- } else {
55
- outputPath = `docs/${category}/${documentationFileName}`;
56
- }
57
- await context.writeBuildArtifact(outputPath, documentationContent);
58
- }
59
- } catch (error) {
60
- context.logger.warn('Failed to write plugin docs:', error.message);
61
- }
62
- }
63
- export default writeDocs;
@@ -1,103 +0,0 @@
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 writeDocs from './writeDocs.js';
16
- async function writePluginDocs({ context }) {
17
- if (context.stage !== 'dev') {
18
- return;
19
- }
20
- const blocks = context.typesMap.blocks || {};
21
- const actions = context.typesMap.actions || {};
22
- const connections = context.typesMap.connections || {};
23
- const operators = context.typesMap.operators || {};
24
- const allRequests = context.typesMap.requests || {};
25
- // Group requests by package name
26
- const requestsByPackage = {};
27
- for (const [type, config] of Object.entries(allRequests)){
28
- const packageName = config.package;
29
- if (!requestsByPackage[packageName]) {
30
- requestsByPackage[packageName] = [];
31
- }
32
- requestsByPackage[packageName].push({
33
- type,
34
- config
35
- });
36
- }
37
- // Add blocks and actions
38
- const items = [
39
- ...Object.entries(blocks).map(([type, config])=>({
40
- type,
41
- config,
42
- category: 'blocks'
43
- })),
44
- ...Object.entries(actions).map(([type, config])=>({
45
- type,
46
- config,
47
- category: 'actions'
48
- }))
49
- ];
50
- // Add connections and their associated requests
51
- for (const [type, config] of Object.entries(connections)){
52
- items.push({
53
- type,
54
- config,
55
- category: 'connections'
56
- });
57
- const requests = requestsByPackage[config.package] || [];
58
- for (const { type: requestType, config: requestConfig } of requests){
59
- items.push({
60
- type: requestType,
61
- config: requestConfig,
62
- category: 'requests',
63
- connectionType: type
64
- });
65
- }
66
- }
67
- // Add operators
68
- const allOperators = {};
69
- if (operators.client) {
70
- for (const [operatorType, operatorConfig] of Object.entries(operators.client)){
71
- allOperators[operatorType] = {
72
- ...operatorConfig,
73
- groups: [
74
- 'client'
75
- ]
76
- };
77
- }
78
- }
79
- if (operators.server) {
80
- for (const [operatorType, operatorConfig] of Object.entries(operators.server)){
81
- if (allOperators[operatorType]) {
82
- allOperators[operatorType].groups.push('server');
83
- } else {
84
- allOperators[operatorType] = {
85
- ...operatorConfig,
86
- groups: [
87
- 'server'
88
- ]
89
- };
90
- }
91
- }
92
- }
93
- items.push(...Object.entries(allOperators).map(([type, config])=>({
94
- type,
95
- config,
96
- category: 'operators'
97
- })));
98
- await writeDocs({
99
- context,
100
- items
101
- });
102
- }
103
- export default writePluginDocs;