apostrophe 4.30.1-beta.1 → 4.31.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 (129) hide show
  1. package/.claude/settings.local.json +15 -0
  2. package/CHANGELOG.md +22 -2
  3. package/claude-tools/detect-handles.js +46 -0
  4. package/claude-tools/minimal-hang-test.js +28 -0
  5. package/claude-tools/mongo-close-test.js +11 -0
  6. package/claude-tools/stdin-ref-test.js +14 -0
  7. package/eslint.config.js +3 -1
  8. package/modules/@apostrophecms/area/index.js +94 -2
  9. package/modules/@apostrophecms/area/lib/custom-tags/area.js +1 -40
  10. package/modules/@apostrophecms/area/ui/apos/components/AposBreadcrumbOperations.vue +0 -1
  11. package/modules/@apostrophecms/area/ui/apos/components/AposWidgetControls.vue +0 -1
  12. package/modules/@apostrophecms/attachment/index.js +4 -1
  13. package/modules/@apostrophecms/db/index.js +68 -27
  14. package/modules/@apostrophecms/doc-type/ui/apos/logic/AposDocContextMenu.js +5 -3
  15. package/modules/@apostrophecms/express/index.js +2 -0
  16. package/modules/@apostrophecms/file/index.js +9 -8
  17. package/modules/@apostrophecms/http/index.js +1 -1
  18. package/modules/@apostrophecms/i18n/i18n/en.json +3 -0
  19. package/modules/@apostrophecms/image/ui/apos/components/AposMediaManagerEditor.vue +2 -2
  20. package/modules/@apostrophecms/image/ui/apos/components/AposMediaUploader.vue +3 -0
  21. package/modules/@apostrophecms/job/index.js +9 -7
  22. package/modules/@apostrophecms/layout-widget/ui/apos/components/AposGridColumn.vue +0 -1
  23. package/modules/@apostrophecms/layout-widget/ui/apos/components/AposGridManager.vue +0 -1
  24. package/modules/@apostrophecms/login/ui/apos/components/TheAposLogin.vue +10 -2
  25. package/modules/@apostrophecms/login/ui/apos/components/TheAposLoginHeader.vue +3 -3
  26. package/modules/@apostrophecms/modal/ui/apos/components/AposModal.vue +52 -23
  27. package/modules/@apostrophecms/modal/ui/apos/components/AposModalTabs.vue +6 -1
  28. package/modules/@apostrophecms/oembed/index.js +2 -1
  29. package/modules/@apostrophecms/piece-type/index.js +2 -1
  30. package/modules/@apostrophecms/piece-type/ui/apos/components/AposDocsManagerDisplay.vue +7 -2
  31. package/modules/@apostrophecms/recently-edited/ui/apos/components/AposCellTitle.vue +1 -0
  32. package/modules/@apostrophecms/rich-text-widget/ui/apos/components/AposRichTextWidgetEditor.vue +21 -4
  33. package/modules/@apostrophecms/schema/ui/apos/components/AposArrayEditor.vue +1 -0
  34. package/modules/@apostrophecms/schema/ui/apos/components/AposInputDateAndTime.vue +7 -2
  35. package/modules/@apostrophecms/schema/ui/apos/components/AposInputSelect.vue +1 -0
  36. package/modules/@apostrophecms/schema/ui/apos/components/AposInputWrapper.vue +1 -1
  37. package/modules/@apostrophecms/schema/ui/apos/components/AposSubform.vue +1 -0
  38. package/modules/@apostrophecms/schema/ui/apos/logic/AposSubform.js +10 -0
  39. package/modules/@apostrophecms/styles/ui/apos/components/TheAposStyles.vue +1 -0
  40. package/modules/@apostrophecms/template/index.js +117 -11
  41. package/modules/@apostrophecms/template/lib/jsxLoader.js +128 -0
  42. package/modules/@apostrophecms/template/lib/jsxRender.js +490 -0
  43. package/modules/@apostrophecms/template/lib/jsxRuntime.js +276 -0
  44. package/modules/@apostrophecms/template/lib/nunjucksLoader.js +11 -36
  45. package/modules/@apostrophecms/template/lib/viewWatcher.js +113 -0
  46. package/modules/@apostrophecms/ui/ui/apos/components/AposButtonGroup.vue +1 -1
  47. package/modules/@apostrophecms/ui/ui/apos/components/AposCellLastEdited.vue +1 -1
  48. package/modules/@apostrophecms/ui/ui/apos/components/AposSelect.vue +1 -0
  49. package/modules/@apostrophecms/ui/ui/apos/components/AposSlat.vue +10 -4
  50. package/modules/@apostrophecms/ui/ui/apos/components/AposSlatList.vue +6 -1
  51. package/modules/@apostrophecms/ui/ui/apos/components/AposSubformPreview.vue +1 -1
  52. package/modules/@apostrophecms/ui/ui/apos/components/AposTreeHeader.vue +1 -1
  53. package/modules/@apostrophecms/ui/ui/apos/scss/global/_inputs.scss +2 -0
  54. package/modules/@apostrophecms/ui/ui/apos/scss/global/_theme.scss +1 -0
  55. package/modules/@apostrophecms/uploadfs/index.js +3 -0
  56. package/modules/@apostrophecms/util/index.js +20 -3
  57. package/package.json +14 -10
  58. package/test/add-missing-schema-fields-project/node_modules/.package-lock.json +131 -0
  59. package/test/add-missing-schema-fields-project/test.js +22 -3
  60. package/test/assets.js +110 -67
  61. package/test/db-tools.js +365 -0
  62. package/test/db.js +24 -15
  63. package/test/default-adapter.js +256 -0
  64. package/test/external-front.js +419 -1
  65. package/test/files.js +28 -0
  66. package/test/job.js +1 -1
  67. package/test/modules/jsx-area-test/index.js +23 -0
  68. package/test/modules/jsx-area-test/views/bad-area.jsx +7 -0
  69. package/test/modules/jsx-area-test/views/with-area-ctx.jsx +13 -0
  70. package/test/modules/jsx-area-test/views/with-area.jsx +7 -0
  71. package/test/modules/jsx-area-test/views/with-widget-ctx.jsx +12 -0
  72. package/test/modules/jsx-area-test/views/with-widget.jsx +7 -0
  73. package/test/modules/jsx-async-widget/index.js +6 -0
  74. package/test/modules/jsx-async-widget/views/widget.jsx +11 -0
  75. package/test/modules/jsx-bridge-test/index.js +1 -0
  76. package/test/modules/jsx-bridge-test/views/cross-module.jsx +7 -0
  77. package/test/modules/jsx-bridge-test/views/disambig-name-only.jsx +7 -0
  78. package/test/modules/jsx-bridge-test/views/disambig-target.jsx +8 -0
  79. package/test/modules/jsx-bridge-test/views/disambig-with-template-name.jsx +7 -0
  80. package/test/modules/jsx-bridge-test/views/include-html.jsx +7 -0
  81. package/test/modules/jsx-bridge-test/views/include-target.html +4 -0
  82. package/test/modules/jsx-bridge-test/views/jsx-extends-via-extend.jsx +9 -0
  83. package/test/modules/jsx-bridge-test/views/jsx-extends.jsx +9 -0
  84. package/test/modules/jsx-bridge-test/views/jsx-layout.jsx +14 -0
  85. package/test/modules/jsx-bridge-test/views/njk-extends.jsx +14 -0
  86. package/test/modules/jsx-bridge-test/views/njk-layout.html +9 -0
  87. package/test/modules/jsx-bridge-test/views/short-form.jsx +7 -0
  88. package/test/modules/jsx-bridge-test/views/short-target.jsx +3 -0
  89. package/test/modules/jsx-component-test/index.js +15 -0
  90. package/test/modules/jsx-component-test/views/greet.html +1 -0
  91. package/test/modules/jsx-component-test/views/uses-component.jsx +8 -0
  92. package/test/modules/jsx-ctx-widget/index.js +6 -0
  93. package/test/modules/jsx-ctx-widget/views/widget.jsx +4 -0
  94. package/test/modules/jsx-mixed-test/index.js +9 -0
  95. package/test/modules/jsx-mixed-test/views/apos-full.jsx +21 -0
  96. package/test/modules/jsx-mixed-test/views/async-list.jsx +12 -0
  97. package/test/modules/jsx-mixed-test/views/lib/format.js +3 -0
  98. package/test/modules/jsx-mixed-test/views/localized.jsx +3 -0
  99. package/test/modules/jsx-mixed-test/views/partial.jsx +3 -0
  100. package/test/modules/jsx-mixed-test/views/safe-helper.jsx +3 -0
  101. package/test/modules/jsx-mixed-test/views/syntax-error.jsx +3 -0
  102. package/test/modules/jsx-mixed-test/views/throws.jsx +5 -0
  103. package/test/modules/jsx-mixed-test/views/uses-import.jsx +5 -0
  104. package/test/modules/jsx-mixed-test/views/uses-require.jsx +5 -0
  105. package/test/modules/jsx-watcher-cross-test/index.js +5 -0
  106. package/test/modules/jsx-watcher-cross-test/views/cross-template.jsx +3 -0
  107. package/test/modules/jsx-watcher-test/index.js +5 -0
  108. package/test/modules/jsx-watcher-test/views/watcher-test.jsx +3 -0
  109. package/test/modules/template-jsx-options-test/index.js +12 -0
  110. package/test/modules/template-jsx-options-test/views/options-test.jsx +9 -0
  111. package/test/modules/template-jsx-subclass-test/index.js +3 -0
  112. package/test/modules/template-jsx-subclass-test/views/override-test.jsx +3 -0
  113. package/test/modules/template-jsx-test/index.js +9 -0
  114. package/test/modules/template-jsx-test/views/boolean-attrs.jsx +11 -0
  115. package/test/modules/template-jsx-test/views/class-and-for.jsx +7 -0
  116. package/test/modules/template-jsx-test/views/dangerously-set.jsx +3 -0
  117. package/test/modules/template-jsx-test/views/escape-attr.jsx +3 -0
  118. package/test/modules/template-jsx-test/views/escape-body.jsx +3 -0
  119. package/test/modules/template-jsx-test/views/inherit-test.jsx +3 -0
  120. package/test/modules/template-jsx-test/views/list.jsx +7 -0
  121. package/test/modules/template-jsx-test/views/override-test.jsx +3 -0
  122. package/test/modules/template-jsx-test/views/svg-attrs.jsx +27 -0
  123. package/test/modules/template-jsx-test/views/test.jsx +3 -0
  124. package/test/modules/template-jsx-test/views/void-elements.jsx +9 -0
  125. package/test/templates-jsx-watcher.js +135 -0
  126. package/test/templates-jsx.js +537 -0
  127. package/test/utils.js +103 -0
  128. package/test-lib/util.js +50 -14
  129. package/lib/mongodb-connect.js +0 -62
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apostrophe",
3
- "version": "4.30.1-beta.1",
3
+ "version": "4.31.0",
4
4
  "description": "The Apostrophe Content Management System.",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -25,6 +25,9 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@apostrophecms/vue-material-design-icons": "^1.0.0",
28
+ "@babel/core": "^7.29.0",
29
+ "@babel/plugin-transform-modules-commonjs": "^7.28.0",
30
+ "@babel/plugin-transform-react-jsx": "^7.28.0",
28
31
  "@ctrl/tinycolor": "^4.1.0",
29
32
  "@floating-ui/dom": "^1.5.3",
30
33
  "@opentelemetry/api": "^1.9.0",
@@ -105,6 +108,7 @@
105
108
  "sluggo": "^1.0.0",
106
109
  "sortablejs": "^1.15.0",
107
110
  "sortablejs-vue3": "^1.2.11",
111
+ "source-map-support": "^0.5.21",
108
112
  "tiny-emitter": "^2.1.0",
109
113
  "tough-cookie": "^4.0.0",
110
114
  "underscore.string": "^3.3.4",
@@ -116,17 +120,18 @@
116
120
  "webpack": "^5.106.1",
117
121
  "webpack-merge": "^5.7.3",
118
122
  "xregexp": "^2.0.0",
119
- "@apostrophecms/emulate-mongo-3-driver": "^1.0.6",
120
- "boring": "^1.1.1",
121
- "express-cache-on-demand": "^1.0.4",
122
123
  "broadband": "^1.1.0",
123
124
  "launder": "^1.7.1",
124
- "postcss-viewport-to-container-toggle": "^2.3.0",
125
+ "@apostrophecms/db-connect": "^1.0.1",
125
126
  "oembetter": "^1.2.0",
126
- "sanitize-html": "^2.17.4",
127
- "uploadfs": "^1.26.1"
127
+ "boring": "^1.1.1",
128
+ "express-cache-on-demand": "^1.0.4",
129
+ "sanitize-html": "^2.17.5",
130
+ "uploadfs": "^1.26.1",
131
+ "postcss-viewport-to-container-toggle": "^2.3.0"
128
132
  },
129
133
  "devDependencies": {
134
+ "chai": "^4.3.10",
130
135
  "eslint": "^9.39.1",
131
136
  "form-data": "^4.0.4",
132
137
  "mocha": "^11.7.5",
@@ -140,10 +145,9 @@
140
145
  ],
141
146
  "scripts": {
142
147
  "pretest": "npm run lint",
143
- "test": "npm run test:base && npm run test:missing && npm run test:assets && npm run test:esm",
144
- "test:base": "nyc mocha -t 10000 --ignore=test/assets.js",
148
+ "test": "npm run test:base && npm run test:missing && npm run test:esm",
149
+ "test:base": "nyc mocha -t 10000",
145
150
  "test:missing": "nyc mocha -t 10000 test/add-missing-schema-fields-project/test.js",
146
- "test:assets": "nyc mocha -t 10000 test/assets.js",
147
151
  "test:esm": "mocha -t 1000 test/esm-project/esm.js",
148
152
  "eslint": "eslint .",
149
153
  "eslint-fix": "npm run eslint -- --fix",
@@ -0,0 +1,131 @@
1
+ {
2
+ "name": "add-missing-schema-fields-project",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "../..": {
8
+ "version": "4.28.0",
9
+ "license": "MIT",
10
+ "dependencies": {
11
+ "@apostrophecms/emulate-mongo-3-driver": "workspace:^",
12
+ "@apostrophecms/vue-material-design-icons": "^1.0.0",
13
+ "@ctrl/tinycolor": "^4.1.0",
14
+ "@floating-ui/dom": "^1.5.3",
15
+ "@opentelemetry/api": "^1.9.0",
16
+ "@opentelemetry/semantic-conventions": "^1.0.1",
17
+ "@paralleldrive/cuid2": "^2.2.2",
18
+ "@tiptap/extension-color": "^2.4.0",
19
+ "@tiptap/extension-floating-menu": "^2.0.3",
20
+ "@tiptap/extension-highlight": "^2.0.3",
21
+ "@tiptap/extension-link": "^2.0.3",
22
+ "@tiptap/extension-placeholder": "^2.0.3",
23
+ "@tiptap/extension-subscript": "^2.0.3",
24
+ "@tiptap/extension-superscript": "^2.0.3",
25
+ "@tiptap/extension-table": "^2.0.3",
26
+ "@tiptap/extension-table-cell": "^2.0.3",
27
+ "@tiptap/extension-table-header": "^2.0.3",
28
+ "@tiptap/extension-table-row": "^2.0.3",
29
+ "@tiptap/extension-text-align": "^2.0.3",
30
+ "@tiptap/extension-text-style": "^2.0.3",
31
+ "@tiptap/extension-underline": "^2.0.3",
32
+ "@tiptap/starter-kit": "^2.0.3",
33
+ "@tiptap/vue-3": "^2.0.3",
34
+ "@vue/compiler-sfc": "^3.3.8",
35
+ "autoprefixer": "^10.4.1",
36
+ "bluebird": "^3.7.2",
37
+ "body-parser": "^1.18.2",
38
+ "boring": "workspace:^",
39
+ "broadband": "workspace:^",
40
+ "cheerio": "^1.0.0-rc.10",
41
+ "chokidar": "^3.5.2",
42
+ "common-tags": "^1.8.0",
43
+ "concat-with-sourcemaps": "^1.1.0",
44
+ "connect-mongo": "^5.1.0",
45
+ "cookie-parser": "^1.4.5",
46
+ "cors": "^2.8.5",
47
+ "css-loader": "^5.2.4",
48
+ "cssnano": "^7.1.1",
49
+ "csv-parse": "^5.6.0",
50
+ "dayjs": "^1.9.8",
51
+ "dompurify": "^3.2.5",
52
+ "encodeurl": "^2.0.0",
53
+ "express": "^4.16.4",
54
+ "express-bearer-token": "^3.0.0",
55
+ "express-cache-on-demand": "workspace:^",
56
+ "express-session": "^1.18.2",
57
+ "fs-extra": "^7.0.1",
58
+ "glob": "^10.4.5",
59
+ "he": "^1.2.0",
60
+ "html-to-text": "^9.0.5",
61
+ "i18next": "^20.3.2",
62
+ "i18next-http-middleware": "^3.1.5",
63
+ "import-fresh": "^3.3.0",
64
+ "is-wsl": "^2.2.0",
65
+ "jsdom": "^24.1.0",
66
+ "klona": "^2.0.4",
67
+ "launder": "^1.4.0",
68
+ "lodash": "^4.17.21",
69
+ "mini-css-extract-plugin": "^1.6.0",
70
+ "minimatch": "^3.0.4",
71
+ "mkdirp": "^0.5.5",
72
+ "multer": "^2.0.2",
73
+ "node-fetch": "^2.6.1",
74
+ "nodemailer": "^7.0.10",
75
+ "nunjucks": "^3.2.1",
76
+ "oembetter": "^1.1.3",
77
+ "parseurl": "^1.3.3",
78
+ "passport": "^0.6.0",
79
+ "passport-local": "^1.0.0",
80
+ "path-to-regexp": "^1.8.0",
81
+ "performance-now": "^2.1.0",
82
+ "pinia": "^2.1.7",
83
+ "postcss": "^8.4.47",
84
+ "postcss-html": "^1.3.0",
85
+ "postcss-loader": "^8.1.1",
86
+ "postcss-scss": "^4.0.3",
87
+ "postcss-viewport-to-container-toggle": "workspace:^",
88
+ "prompts": "^2.4.1",
89
+ "qs": "^6.10.1",
90
+ "regexp-quote": "0.0.0",
91
+ "resolve": "^1.19.0",
92
+ "resolve-from": "^5.0.0",
93
+ "sanitize-html": "workspace:^",
94
+ "sass": "^1.80.3",
95
+ "sass-loader": "^16.0.0",
96
+ "server-destroy": "^1.0.1",
97
+ "sluggo": "^1.0.0",
98
+ "sortablejs": "^1.15.0",
99
+ "sortablejs-vue3": "^1.2.11",
100
+ "tiny-emitter": "^2.1.0",
101
+ "tough-cookie": "^4.0.0",
102
+ "underscore.string": "^3.3.4",
103
+ "uploadfs": "workspace:^",
104
+ "void-elements": "^3.1.0",
105
+ "vue": "^3.5.20",
106
+ "vue-advanced-cropper": "^2.8.8",
107
+ "vue-loader": "^17.1.0",
108
+ "vue-style-loader": "^4.1.3",
109
+ "webpack": "^5.72.0",
110
+ "webpack-merge": "^5.7.3",
111
+ "xregexp": "^2.0.0"
112
+ },
113
+ "devDependencies": {
114
+ "eslint": "^9.39.1",
115
+ "eslint-config-apostrophe": "workspace:^",
116
+ "form-data": "^4.0.4",
117
+ "mocha": "^11.7.1",
118
+ "nyc": "^17.1.0",
119
+ "stylelint": "^16.5.0",
120
+ "stylelint-config-apostrophe": "workspace:^"
121
+ },
122
+ "engines": {
123
+ "node": ">=16.0.0"
124
+ }
125
+ },
126
+ "node_modules/apostrophe": {
127
+ "resolved": "../..",
128
+ "link": true
129
+ }
130
+ }
131
+ }
@@ -11,10 +11,23 @@ describe('Apostrophe - add-missing-schema-fields task', function() {
11
11
 
12
12
  let apos;
13
13
 
14
+ // When APOS_TEST_DB_PROTOCOL is set, child processes that run `node app.js`
15
+ // need the matching APOS_DB_URI so they use the same database as t.create()
16
+ const projectCwd = path.resolve(process.cwd(), 'test/add-missing-schema-fields-project/');
17
+ const testDbUri = t.getTestDbUri('add-missing-schema-fields-project');
18
+ const execEnv = testDbUri
19
+ ? {
20
+ env: {
21
+ ...process.env,
22
+ APOS_DB_URI: testDbUri
23
+ }
24
+ }
25
+ : {};
26
+
14
27
  before(async function() {
15
28
  await util.promisify(exec)(
16
29
  'npm install',
17
- { cwd: path.resolve(process.cwd(), 'test/add-missing-schema-fields-project/') }
30
+ { cwd: projectCwd }
18
31
  );
19
32
  });
20
33
 
@@ -25,7 +38,10 @@ describe('Apostrophe - add-missing-schema-fields task', function() {
25
38
  it('should not run migrations when running the task', async function() {
26
39
  await util.promisify(exec)(
27
40
  'node app.js @apostrophecms/migration:add-missing-schema-fields',
28
- { cwd: path.resolve(process.cwd(), 'test/add-missing-schema-fields-project/') }
41
+ {
42
+ cwd: projectCwd,
43
+ ...execEnv
44
+ }
29
45
  );
30
46
 
31
47
  apos = await t.create({
@@ -64,7 +80,10 @@ describe('Apostrophe - add-missing-schema-fields task', function() {
64
80
  it('should run migrations when running @apostrophecms/migration:migrate task', async function() {
65
81
  await util.promisify(exec)(
66
82
  'node app.js @apostrophecms/migration:migrate',
67
- { cwd: path.resolve(process.cwd(), 'test/add-missing-schema-fields-project/') }
83
+ {
84
+ cwd: projectCwd,
85
+ ...execEnv
86
+ }
68
87
  );
69
88
 
70
89
  apos = await t.create({