@lowdefy/build 0.0.0-experimental-20251203191458 → 0.0.0-experimental-20251203205559

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.
@@ -40,6 +40,7 @@ const defaultPackages = [
40
40
  '@lowdefy/operators-change-case',
41
41
  '@lowdefy/operators-diff',
42
42
  '@lowdefy/operators-js',
43
+ '@lowdefy/operators-jsonata',
43
44
  '@lowdefy/operators-moment',
44
45
  '@lowdefy/operators-mql',
45
46
  '@lowdefy/operators-nunjucks',
@@ -26,9 +26,6 @@ function testContext({ writeBuildArtifact, configDirectory, readConfigFile, logg
26
26
  directories: {
27
27
  config: configDirectory || ''
28
28
  },
29
- entitlements: [
30
- 'AUTH'
31
- ],
32
29
  typeCounters: {
33
30
  actions: createCounter(),
34
31
  auth: {
@@ -0,0 +1,89 @@
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
+ */ /**
16
+ * Find all files affected by changes to the given files.
17
+ * Traverses the dependency graph upward to find all transitive dependents.
18
+ *
19
+ * @param {string[]} changedFiles - Array of file paths that changed
20
+ * @param {Map<string, Set<string>>} dependencyGraph - Map of file -> Set of files that depend on it
21
+ * @returns {Set<string>} - Set of all affected file paths (including the changed files)
22
+ */ function getAffectedFiles(changedFiles, dependencyGraph) {
23
+ const affected = new Set();
24
+ const queue = [
25
+ ...changedFiles
26
+ ];
27
+ while(queue.length > 0){
28
+ const file = queue.shift();
29
+ if (affected.has(file)) {
30
+ continue;
31
+ }
32
+ affected.add(file);
33
+ // Find files that depend on this file
34
+ const dependents = dependencyGraph.get(file);
35
+ if (dependents) {
36
+ for (const dependent of dependents){
37
+ if (!affected.has(dependent)) {
38
+ queue.push(dependent);
39
+ }
40
+ }
41
+ }
42
+ }
43
+ return affected;
44
+ }
45
+ /**
46
+ * Invalidate cache entries for changed files and their dependents.
47
+ *
48
+ * @param {Object} options
49
+ * @param {string[]} options.changedFiles - Array of file paths that changed
50
+ * @param {Map<string, Set<string>>} options.dependencyGraph - Dependency graph
51
+ * @param {Map<string, any>} options.parsedContentCache - Cache of parsed file content
52
+ * @param {Map<string, any>} options.refCache - Cache of resolved refs
53
+ * @param {Map<string, Set<string>>} options.pathToRefHashes - Maps file path to ref hashes
54
+ * @param {Object} options.logger - Logger instance
55
+ * @returns {Set<string>} - Set of affected file paths that were invalidated
56
+ */ function invalidateChangedFiles({ changedFiles, dependencyGraph, parsedContentCache, refCache, pathToRefHashes, logger }) {
57
+ if (!changedFiles || changedFiles.length === 0) {
58
+ return new Set();
59
+ }
60
+ const affectedFiles = getAffectedFiles(changedFiles, dependencyGraph);
61
+ // Invalidate parsedContentCache entries for affected files
62
+ // The cache keys may include vars suffix for nunjucks files, so we need to check prefixes
63
+ for (const cacheKey of parsedContentCache.keys()){
64
+ const filePath = cacheKey.split('::')[0]; // Remove vars suffix if present
65
+ if (affectedFiles.has(filePath)) {
66
+ parsedContentCache.delete(cacheKey);
67
+ }
68
+ }
69
+ // Invalidate refCache entries for affected files using pathToRefHashes mapping
70
+ if (refCache && pathToRefHashes) {
71
+ for (const filePath of affectedFiles){
72
+ const hashes = pathToRefHashes.get(filePath);
73
+ if (hashes) {
74
+ for (const hash of hashes){
75
+ refCache.delete(hash);
76
+ }
77
+ // Also clear the path mapping since it will be rebuilt
78
+ pathToRefHashes.delete(filePath);
79
+ }
80
+ }
81
+ }
82
+ if (logger?.level === 'debug' && affectedFiles.size > 0) {
83
+ logger.debug(`Incremental build: ${changedFiles.length} file(s) changed`);
84
+ logger.debug(`Incremental build: ${affectedFiles.size} file(s) affected`);
85
+ }
86
+ return affectedFiles;
87
+ }
88
+ export default invalidateChangedFiles;
89
+ export { getAffectedFiles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/build",
3
- "version": "0.0.0-experimental-20251203191458",
3
+ "version": "0.0.0-experimental-20251203205559",
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-20251203191458",
48
- "@lowdefy/blocks-basic": "0.0.0-experimental-20251203191458",
49
- "@lowdefy/blocks-loaders": "0.0.0-experimental-20251203191458",
50
- "@lowdefy/helpers": "0.0.0-experimental-20251203191458",
51
- "@lowdefy/node-utils": "0.0.0-experimental-20251203191458",
52
- "@lowdefy/nunjucks": "0.0.0-experimental-20251203191458",
53
- "@lowdefy/operators": "0.0.0-experimental-20251203191458",
54
- "@lowdefy/operators-js": "0.0.0-experimental-20251203191458",
47
+ "@lowdefy/ajv": "0.0.0-experimental-20251203205559",
48
+ "@lowdefy/blocks-basic": "0.0.0-experimental-20251203205559",
49
+ "@lowdefy/blocks-loaders": "0.0.0-experimental-20251203205559",
50
+ "@lowdefy/helpers": "0.0.0-experimental-20251203205559",
51
+ "@lowdefy/node-utils": "0.0.0-experimental-20251203205559",
52
+ "@lowdefy/nunjucks": "0.0.0-experimental-20251203205559",
53
+ "@lowdefy/operators": "0.0.0-experimental-20251203205559",
54
+ "@lowdefy/operators-js": "0.0.0-experimental-20251203205559",
55
55
  "ajv": "8.12.0",
56
56
  "json5": "2.2.3",
57
57
  "yaml": "2.3.4",
@@ -59,35 +59,36 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@jest/globals": "28.1.3",
62
- "@lowdefy/actions-core": "0.0.0-experimental-20251203191458",
63
- "@lowdefy/actions-pdf-make": "0.0.0-experimental-20251203191458",
64
- "@lowdefy/blocks-aggrid": "0.0.0-experimental-20251203191458",
65
- "@lowdefy/blocks-algolia": "0.0.0-experimental-20251203191458",
66
- "@lowdefy/blocks-antd": "0.0.0-experimental-20251203191458",
67
- "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20251203191458",
68
- "@lowdefy/blocks-echarts": "0.0.0-experimental-20251203191458",
69
- "@lowdefy/blocks-google-maps": "0.0.0-experimental-20251203191458",
70
- "@lowdefy/blocks-markdown": "0.0.0-experimental-20251203191458",
71
- "@lowdefy/blocks-qr": "0.0.0-experimental-20251203191458",
72
- "@lowdefy/connection-axios-http": "0.0.0-experimental-20251203191458",
73
- "@lowdefy/connection-elasticsearch": "0.0.0-experimental-20251203191458",
74
- "@lowdefy/connection-google-sheets": "0.0.0-experimental-20251203191458",
75
- "@lowdefy/connection-knex": "0.0.0-experimental-20251203191458",
76
- "@lowdefy/connection-mongodb": "0.0.0-experimental-20251203191458",
77
- "@lowdefy/connection-redis": "0.0.0-experimental-20251203191458",
78
- "@lowdefy/connection-sendgrid": "0.0.0-experimental-20251203191458",
79
- "@lowdefy/connection-stripe": "0.0.0-experimental-20251203191458",
80
- "@lowdefy/operators-change-case": "0.0.0-experimental-20251203191458",
81
- "@lowdefy/operators-diff": "0.0.0-experimental-20251203191458",
82
- "@lowdefy/operators-moment": "0.0.0-experimental-20251203191458",
83
- "@lowdefy/operators-mql": "0.0.0-experimental-20251203191458",
84
- "@lowdefy/operators-nunjucks": "0.0.0-experimental-20251203191458",
85
- "@lowdefy/operators-uuid": "0.0.0-experimental-20251203191458",
86
- "@lowdefy/operators-yaml": "0.0.0-experimental-20251203191458",
87
- "@lowdefy/plugin-auth0": "0.0.0-experimental-20251203191458",
88
- "@lowdefy/plugin-aws": "0.0.0-experimental-20251203191458",
89
- "@lowdefy/plugin-csv": "0.0.0-experimental-20251203191458",
90
- "@lowdefy/plugin-next-auth": "0.0.0-experimental-20251203191458",
62
+ "@lowdefy/actions-core": "0.0.0-experimental-20251203205559",
63
+ "@lowdefy/actions-pdf-make": "0.0.0-experimental-20251203205559",
64
+ "@lowdefy/blocks-aggrid": "0.0.0-experimental-20251203205559",
65
+ "@lowdefy/blocks-algolia": "0.0.0-experimental-20251203205559",
66
+ "@lowdefy/blocks-antd": "0.0.0-experimental-20251203205559",
67
+ "@lowdefy/blocks-color-selectors": "0.0.0-experimental-20251203205559",
68
+ "@lowdefy/blocks-echarts": "0.0.0-experimental-20251203205559",
69
+ "@lowdefy/blocks-google-maps": "0.0.0-experimental-20251203205559",
70
+ "@lowdefy/blocks-markdown": "0.0.0-experimental-20251203205559",
71
+ "@lowdefy/blocks-qr": "0.0.0-experimental-20251203205559",
72
+ "@lowdefy/connection-axios-http": "0.0.0-experimental-20251203205559",
73
+ "@lowdefy/connection-elasticsearch": "0.0.0-experimental-20251203205559",
74
+ "@lowdefy/connection-google-sheets": "0.0.0-experimental-20251203205559",
75
+ "@lowdefy/connection-knex": "0.0.0-experimental-20251203205559",
76
+ "@lowdefy/connection-mongodb": "0.0.0-experimental-20251203205559",
77
+ "@lowdefy/connection-redis": "0.0.0-experimental-20251203205559",
78
+ "@lowdefy/connection-sendgrid": "0.0.0-experimental-20251203205559",
79
+ "@lowdefy/connection-stripe": "0.0.0-experimental-20251203205559",
80
+ "@lowdefy/operators-change-case": "0.0.0-experimental-20251203205559",
81
+ "@lowdefy/operators-diff": "0.0.0-experimental-20251203205559",
82
+ "@lowdefy/operators-jsonata": "0.0.0-experimental-20251203205559",
83
+ "@lowdefy/operators-moment": "0.0.0-experimental-20251203205559",
84
+ "@lowdefy/operators-mql": "0.0.0-experimental-20251203205559",
85
+ "@lowdefy/operators-nunjucks": "0.0.0-experimental-20251203205559",
86
+ "@lowdefy/operators-uuid": "0.0.0-experimental-20251203205559",
87
+ "@lowdefy/operators-yaml": "0.0.0-experimental-20251203205559",
88
+ "@lowdefy/plugin-auth0": "0.0.0-experimental-20251203205559",
89
+ "@lowdefy/plugin-aws": "0.0.0-experimental-20251203205559",
90
+ "@lowdefy/plugin-csv": "0.0.0-experimental-20251203205559",
91
+ "@lowdefy/plugin-next-auth": "0.0.0-experimental-20251203205559",
91
92
  "@swc/cli": "0.1.63",
92
93
  "@swc/core": "1.3.99",
93
94
  "@swc/jest": "0.2.29",