@lowdefy/docs-content 7.0.0 → 7.1.0

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 (37) hide show
  1. package/content/actions/resetvalidation.md +2 -0
  2. package/content/actions/setstate.md +0 -2
  3. package/content/actions/validate.md +1 -1
  4. package/content/adapter-reference/mongodbauthadapter.md +2 -2
  5. package/content/agents/agents-introduction.md +1 -1
  6. package/content/callback-reference/auth0logoutcallback.md +1 -1
  7. package/content/concepts/ai-agent-docs.md +2 -2
  8. package/content/concepts/blocks.md +1 -1
  9. package/content/concepts/connections-and-requests.md +8 -8
  10. package/content/concepts/custom-html.md +1 -1
  11. package/content/concepts/logger.md +1 -1
  12. package/content/concepts/lowdefy-api.md +3 -3
  13. package/content/concepts/page-and-app-state.md +2 -2
  14. package/content/concepts/theming.md +1 -1
  15. package/content/connections/axioshttp.md +1 -1
  16. package/content/display-blocks/aggrid.md +3 -3
  17. package/content/migration/v3-to-v4.md +2 -2
  18. package/content/operators/_ref.md +6 -6
  19. package/content/provider-reference/auth-js-providers.md +2 -2
  20. package/content/provider-reference/openidconnectprovider.md +1 -1
  21. package/content/testing/config-tests.md +2 -2
  22. package/content/testing/journey-data-sets.md +21 -21
  23. package/content/tutorial/tutorial-create-page.md +1 -1
  24. package/content/tutorial/tutorial-requests-api.md +1 -1
  25. package/content/tutorial/tutorial-requests-sql.md +1 -1
  26. package/content/tutorial/tutorial-start.md +1 -1
  27. package/content/user-authentication/auth-configuration.md +9 -9
  28. package/content/user-authentication/protected-pages-apis.md +4 -4
  29. package/content/user-authentication/roles.md +2 -2
  30. package/content/websockets/websocket-publish.md +1 -1
  31. package/content/websockets/websockets-introduction.md +1 -1
  32. package/hazards.json +0 -12
  33. package/index.json +326 -93
  34. package/package.json +3 -2
  35. package/scripts/collectImportedFiles.js +80 -0
  36. package/scripts/recordSourceHashes.js +9 -6
  37. package/content/learn/showcase.md +0 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/docs-content",
3
- "version": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Lowdefy documentation extracted as markdown for AI coding agents.",
6
6
  "homepage": "https://lowdefy.com",
@@ -21,6 +21,7 @@
21
21
  "exports": {
22
22
  "./index.json": "./index.json",
23
23
  "./hazards.json": "./hazards.json",
24
+ "./scripts/collectImportedFiles.js": "./scripts/collectImportedFiles.js",
24
25
  "./scripts/extractAgentDocs.js": "./scripts/extractAgentDocs.js",
25
26
  "./scripts/hashDocSources.js": "./scripts/hashDocSources.js",
26
27
  "./scripts/isRedirectPage.js": "./scripts/isRedirectPage.js",
@@ -35,7 +36,7 @@
35
36
  "scripts/*"
36
37
  ],
37
38
  "dependencies": {
38
- "@lowdefy/nunjucks": "7.0.0"
39
+ "@lowdefy/nunjucks": "7.1.0"
39
40
  },
40
41
  "publishConfig": {
41
42
  "access": "public"
@@ -0,0 +1,80 @@
1
+ /*
2
+ Copyright 2020-2026 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
+
17
+ import fs from 'fs';
18
+ import path from 'path';
19
+
20
+ // Static imports and re-exports (`... from './x.js'`), side-effect imports
21
+ // (`import './x.js'`) and dynamic imports with a literal specifier.
22
+ const specifierPatterns = [
23
+ /\bfrom\s*['"]([^'"]+)['"]/g,
24
+ /\bimport\s*['"]([^'"]+)['"]/g,
25
+ /\bimport\(\s*['"]([^'"]+)['"]\s*\)/g,
26
+ ];
27
+
28
+ function isJsFile(file) {
29
+ return ['.js', '.mjs'].includes(path.extname(file));
30
+ }
31
+
32
+ function readRelativeSpecifiers(filePath) {
33
+ const source = fs.readFileSync(filePath, 'utf8');
34
+ const specifiers = new Set();
35
+ specifierPatterns.forEach((pattern) => {
36
+ for (const match of source.matchAll(pattern)) {
37
+ if (match[1].startsWith('./') || match[1].startsWith('../')) {
38
+ specifiers.add(match[1]);
39
+ }
40
+ }
41
+ });
42
+ return [...specifiers];
43
+ }
44
+
45
+ // A page can reference a JS file, such as a block's meta.js, that builds its
46
+ // content from the files it imports: AgGrid's meta.js calls createDisplayMeta.js,
47
+ // where the property schema lives. Returns those imported files, followed
48
+ // through JS files and relative to configDirectory like the refMap paths, so an
49
+ // edit to any of them changes the page's source hash. Paths use forward slashes
50
+ // on every OS, as each path is part of the hash. Only relative imports are
51
+ // followed: a package import is versioned with its package.
52
+ function collectImportedFiles({ configDirectory, files }) {
53
+ const imported = new Set();
54
+ const queue = files.filter(isJsFile).map((file) => path.resolve(configDirectory, file));
55
+ const visited = new Set(queue);
56
+ while (queue.length > 0) {
57
+ const filePath = queue.pop();
58
+ if (!fs.existsSync(filePath)) {
59
+ continue;
60
+ }
61
+ readRelativeSpecifiers(filePath).forEach((specifier) => {
62
+ const importedPath = path.resolve(path.dirname(filePath), specifier);
63
+ if (visited.has(importedPath) || !fs.existsSync(importedPath)) {
64
+ return;
65
+ }
66
+ visited.add(importedPath);
67
+ // Read for its version, as recordSourceHashes leaves it out.
68
+ if (path.basename(importedPath) === 'package.json') {
69
+ return;
70
+ }
71
+ imported.add(path.relative(configDirectory, importedPath).split(path.sep).join('/'));
72
+ if (isJsFile(importedPath)) {
73
+ queue.push(importedPath);
74
+ }
75
+ });
76
+ }
77
+ return [...imported];
78
+ }
79
+
80
+ export default collectImportedFiles;
@@ -20,21 +20,23 @@ import path, { dirname } from 'path';
20
20
  import { fileURLToPath } from 'url';
21
21
  import { parseArgs } from 'util';
22
22
 
23
+ import collectImportedFiles from './collectImportedFiles.js';
23
24
  import hashDocSources from './hashDocSources.js';
24
25
 
25
26
  // Second step of `pnpm docs:content`. extractAgentDocs runs inside the docs
26
27
  // build, which knows each page's ref id but not yet the files behind it; the
27
28
  // build's refMap.json (written at its end) maps ref ids to files and their
28
29
  // parents. For each doc this finds the ref that pages.yaml resolved to the page,
29
- // lists that ref's file and every file referenced below it, and records them
30
- // with their hash in index.json. A package.json is read for its version, which
31
- // every release bumps, not for page content, so it is left out: otherwise each
32
- // release and dependency update would mark every doc stale. The page frame
30
+ // lists that ref's file, every file referenced below it and the files those JS
31
+ // files import (collectImportedFiles), and records them with their hash in
32
+ // index.json. A package.json is read for its version, which every release
33
+ // bumps, not for page content, so it is left out: otherwise each release and
34
+ // dependency update would mark every doc stale. The page frame
33
35
  // (pageFrame, with its header, footer and feedback requests) holds no markdown
34
36
  // and wraps every page, so it is left out too: otherwise one edit to it would
35
37
  // change all the hashes, and two branches doing that would conflict in
36
38
  // index.json on every doc.
37
- function collectSourceFiles({ refMap, entryRefId, pageFrame }) {
39
+ function collectSourceFiles({ configDirectory, refMap, entryRefId, pageFrame }) {
38
40
  const children = new Map();
39
41
  Object.entries(refMap).forEach(([id, ref]) => {
40
42
  const siblings = children.get(ref.parent) ?? [];
@@ -54,6 +56,7 @@ function collectSourceFiles({ refMap, entryRefId, pageFrame }) {
54
56
  }
55
57
  queue.push(...(children.get(id) ?? []));
56
58
  }
59
+ collectImportedFiles({ configDirectory, files: [...files] }).forEach((file) => files.add(file));
57
60
  return [...files].sort();
58
61
  }
59
62
 
@@ -73,7 +76,7 @@ function recordSourceHashes({ configDirectory, outputDir, pageFrame, pagesFile,
73
76
  const sources = {};
74
77
  index.docs.forEach(({ slug }) => {
75
78
  const entryRefId = findEntryRef({ refMap, refId: index.sources[slug].refId, pagesFile });
76
- const files = collectSourceFiles({ refMap, entryRefId, pageFrame });
79
+ const files = collectSourceFiles({ configDirectory, refMap, entryRefId, pageFrame });
77
80
  sources[slug] = { files, hash: hashDocSources({ configDirectory, files }) };
78
81
  });
79
82
  fs.writeFileSync(indexPath, JSON.stringify({ ...index, sources }, null, 2));
@@ -1,8 +0,0 @@
1
- # Showcase
2
-
3
- More than 25 000 apps have been built with Lowdefy — admin panels, BI dashboards,
4
- CRMs, ticketing systems, webforms, and these docs themselves. A few open examples:
5
-
6
- Built something with Lowdefy? Share it with the community on
7
- [GitHub Discussions](https://github.com/lowdefy/lowdefy/discussions) or
8
- [Discord](https://discord.gg/WmcJgXt).