ghost 5.118.0 → 5.118.1

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 (98) hide show
  1. package/bin/minify-assets.js +119 -0
  2. package/components/{tryghost-api-framework-5.118.0.tgz → tryghost-api-framework-5.118.1.tgz} +0 -0
  3. package/components/tryghost-constants-5.118.1.tgz +0 -0
  4. package/components/tryghost-custom-fonts-5.118.1.tgz +0 -0
  5. package/components/{tryghost-custom-theme-settings-service-5.118.0.tgz → tryghost-custom-theme-settings-service-5.118.1.tgz} +0 -0
  6. package/components/tryghost-domain-events-5.118.1.tgz +0 -0
  7. package/components/tryghost-donations-5.118.1.tgz +0 -0
  8. package/components/{tryghost-email-addresses-5.118.0.tgz → tryghost-email-addresses-5.118.1.tgz} +0 -0
  9. package/components/{tryghost-email-service-5.118.0.tgz → tryghost-email-service-5.118.1.tgz} +0 -0
  10. package/components/tryghost-email-suppression-list-5.118.1.tgz +0 -0
  11. package/components/tryghost-html-to-plaintext-5.118.1.tgz +0 -0
  12. package/components/tryghost-i18n-5.118.1.tgz +0 -0
  13. package/components/{tryghost-job-manager-5.118.0.tgz → tryghost-job-manager-5.118.1.tgz} +0 -0
  14. package/components/tryghost-link-replacer-5.118.1.tgz +0 -0
  15. package/components/tryghost-magic-link-5.118.1.tgz +0 -0
  16. package/components/{tryghost-member-attribution-5.118.0.tgz → tryghost-member-attribution-5.118.1.tgz} +0 -0
  17. package/components/{tryghost-member-events-5.118.0.tgz → tryghost-member-events-5.118.1.tgz} +0 -0
  18. package/components/{tryghost-members-csv-5.118.0.tgz → tryghost-members-csv-5.118.1.tgz} +0 -0
  19. package/components/{tryghost-members-offers-5.118.0.tgz → tryghost-members-offers-5.118.1.tgz} +0 -0
  20. package/components/tryghost-mw-error-handler-5.118.1.tgz +0 -0
  21. package/components/{tryghost-mw-vhost-5.118.0.tgz → tryghost-mw-vhost-5.118.1.tgz} +0 -0
  22. package/components/tryghost-post-events-5.118.1.tgz +0 -0
  23. package/components/{tryghost-post-revisions-5.118.0.tgz → tryghost-post-revisions-5.118.1.tgz} +0 -0
  24. package/components/tryghost-posts-service-5.118.1.tgz +0 -0
  25. package/components/tryghost-prometheus-metrics-5.118.1.tgz +0 -0
  26. package/components/tryghost-security-5.118.1.tgz +0 -0
  27. package/components/tryghost-tiers-5.118.1.tgz +0 -0
  28. package/components/{tryghost-webmentions-5.118.0.tgz → tryghost-webmentions-5.118.1.tgz} +0 -0
  29. package/core/bridge.js +1 -11
  30. package/core/built/admin/assets/admin-x-activitypub/admin-x-activitypub.js +9210 -8727
  31. package/core/built/admin/assets/admin-x-settings/{CodeEditorView-1143c509.mjs → CodeEditorView-9d2a0119.mjs} +2 -2
  32. package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
  33. package/core/built/admin/assets/admin-x-settings/{index-19ebc8ad.mjs → index-48250e60.mjs} +2 -2
  34. package/core/built/admin/assets/admin-x-settings/{index-ac104f42.mjs → index-fd83d7a5.mjs} +3400 -3356
  35. package/core/built/admin/assets/admin-x-settings/{modals-994901ee.mjs → modals-8fdc40a2.mjs} +7714 -7257
  36. package/core/built/admin/assets/chunk.524.9c1e444ecff073f053f5.js +35 -0
  37. package/core/built/admin/assets/chunk.582.9b35e36c109a3c2d486b.js +37 -0
  38. package/core/built/admin/assets/{chunk.713.48f120c377bcaffdfddf.js → chunk.709.0cb431c2ada3758f5368.js} +2728 -2726
  39. package/core/built/admin/assets/{chunk.713.48f120c377bcaffdfddf.js.LICENSE.txt → chunk.709.0cb431c2ada3758f5368.js.LICENSE.txt} +2 -2
  40. package/core/built/admin/assets/{ghost-cd90a28b214ee800a007bb62cd45e6e6.js → ghost-941b0691f9ab77a31452151d2828caee.js} +388 -388
  41. package/core/built/admin/assets/{ghost-ba58e9822f7384461e926c7e23f04a75.css → ghost-c10c25cbf2256a65051bf20fdb32b1a9.css} +1 -1
  42. package/core/built/admin/assets/{ghost-dark-f1f29683b14ffa11615b3bba8b6ab92c.css → ghost-dark-6cbe9c3d45b8b605f846c4b417881e50.css} +1 -1
  43. package/core/built/admin/assets/posts/posts.js +79873 -29814
  44. package/core/built/admin/assets/stats/stats.js +14441 -14417
  45. package/core/built/admin/assets/{vendor-8e3ee8261528bb429cfe78ce79a4a82a.js → vendor-778197221846b9f24b630ecc57b8d8a9.js} +25 -25
  46. package/core/built/admin/index.html +13 -22
  47. package/core/frontend/apps/private-blogging/lib/views/private.hbs +4 -12
  48. package/core/frontend/helpers/ghost_head.js +2 -2
  49. package/core/frontend/public/admin-auth/admin-auth.min.js +1 -0
  50. package/core/frontend/public/comment-counts.min.js +1 -0
  51. package/core/frontend/public/ghost-stats.min.js +1 -0
  52. package/core/frontend/public/member-attribution.min.js +1 -0
  53. package/core/frontend/services/assets-minification/index.js +1 -11
  54. package/core/frontend/src/ghost-stats/ghost-stats.js +234 -0
  55. package/core/frontend/src/member-attribution/member-attribution.js +29 -29
  56. package/core/frontend/src/utils/privacy.js +70 -0
  57. package/core/frontend/src/utils/session-storage.js +68 -0
  58. package/core/frontend/src/utils/url-attribution.js +92 -0
  59. package/core/frontend/web/site.js +26 -6
  60. package/core/server/services/activitypub/ActivityPubService.js +0 -5
  61. package/core/server/services/activitypub/ActivityPubService.ts +0 -5
  62. package/core/server/views/error.hbs +4 -9
  63. package/core/server/web/admin/app.js +3 -5
  64. package/core/server/web/admin/middleware/serve-auth-frame-file.js +35 -0
  65. package/core/shared/config/env/config.development.docker.json +8 -0
  66. package/core/shared/config/env/config.development.json +1 -1
  67. package/core/shared/config/helpers.js +1 -21
  68. package/core/shared/labs.js +3 -6
  69. package/package.json +75 -66
  70. package/tsconfig.tsbuildinfo +1 -1
  71. package/yarn.lock +379 -351
  72. package/components/tryghost-constants-5.118.0.tgz +0 -0
  73. package/components/tryghost-custom-fonts-5.118.0.tgz +0 -0
  74. package/components/tryghost-domain-events-5.118.0.tgz +0 -0
  75. package/components/tryghost-donations-5.118.0.tgz +0 -0
  76. package/components/tryghost-email-suppression-list-5.118.0.tgz +0 -0
  77. package/components/tryghost-html-to-plaintext-5.118.0.tgz +0 -0
  78. package/components/tryghost-i18n-5.118.0.tgz +0 -0
  79. package/components/tryghost-link-replacer-5.118.0.tgz +0 -0
  80. package/components/tryghost-magic-link-5.118.0.tgz +0 -0
  81. package/components/tryghost-mw-error-handler-5.118.0.tgz +0 -0
  82. package/components/tryghost-post-events-5.118.0.tgz +0 -0
  83. package/components/tryghost-posts-service-5.118.0.tgz +0 -0
  84. package/components/tryghost-prometheus-metrics-5.118.0.tgz +0 -0
  85. package/components/tryghost-security-5.118.0.tgz +0 -0
  86. package/components/tryghost-tiers-5.118.0.tgz +0 -0
  87. package/core/built/admin/assets/admin-x-demo/admin-x-demo.js +0 -6
  88. package/core/built/admin/assets/admin-x-demo/index-09325f38.mjs +0 -11427
  89. package/core/built/admin/assets/admin-x-demo/modals-1a9ae8b7.mjs +0 -397
  90. package/core/built/admin/assets/chunk.524.5710919eb507b9a81166.js +0 -35
  91. package/core/built/admin/assets/chunk.582.c8cb99b85cfa13fc7df1.js +0 -37
  92. package/core/frontend/public/ghost-stats.js +0 -297
  93. package/core/frontend/services/assets-minification/AdminAuthAssets.js +0 -69
  94. package/core/frontend/services/assets-minification/CommentCountsAssets.js +0 -33
  95. package/core/frontend/services/assets-minification/MemberAttributionAssets.js +0 -45
  96. package/core/frontend/src/admin-auth/index.html +0 -6
  97. package/core/frontend/src/member-attribution/.eslintrc +0 -10
  98. /package/core/frontend/src/comment-counts/{js/comment-counts.js → comment-counts.js} +0 -0
@@ -0,0 +1,119 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Script to minify multiple JavaScript files using esbuild
5
+ * Supports per-file configuration for bundling and other options
6
+ *
7
+ * The tryghost/minifier package is not used because it is intended to be used at runtime,
8
+ * allowing for replacements to be made on the fly (e.g. for card-assets and theme activation).
9
+ *
10
+ * This script is intended to be run at build time, allowing for us to use the minified files
11
+ * in the production build and be able to utilize bundler benefits.
12
+ */
13
+
14
+ /* eslint-disable no-console */
15
+ const esbuild = require('esbuild');
16
+ const path = require('path');
17
+ const fs = require('fs');
18
+ const logging = require('@tryghost/logging');
19
+
20
+ // Determine the root directory by checking for common project files
21
+ function findProjectRoot() {
22
+ let currentDir = process.cwd();
23
+
24
+ // Check if we're already in ghost/core
25
+ if (currentDir.endsWith('ghost/core') || currentDir.endsWith('ghost\\core')) {
26
+ return currentDir;
27
+ }
28
+
29
+ // Look for ghost/core directory
30
+ const ghostCorePath = path.join(currentDir, 'ghost', 'core');
31
+ if (fs.existsSync(ghostCorePath)) {
32
+ return ghostCorePath;
33
+ }
34
+
35
+ return currentDir;
36
+ }
37
+
38
+ const projectRoot = findProjectRoot();
39
+ logging.debug(`Resolving paths from: ${projectRoot}`);
40
+
41
+ // Helper to resolve paths relative to project root
42
+ function resolvePath(filePath) {
43
+ return path.join(projectRoot, filePath);
44
+ }
45
+
46
+ // Define files to minify with their specific configuration
47
+ const filesToMinify = [
48
+ {
49
+ src: 'core/frontend/src/comment-counts/comment-counts.js',
50
+ dest: 'core/frontend/public/comment-counts.min.js',
51
+ options: {
52
+ bundle: false
53
+ }
54
+ },
55
+ {
56
+ src: 'core/frontend/src/ghost-stats/ghost-stats.js',
57
+ dest: 'core/frontend/public/ghost-stats.min.js',
58
+ options: {
59
+ bundle: true,
60
+ format: 'iife',
61
+ target: ['es2020']
62
+ }
63
+ },
64
+ {
65
+ src: 'core/frontend/src/member-attribution/member-attribution.js',
66
+ dest: 'core/frontend/public/member-attribution.min.js',
67
+ options: {
68
+ bundle: true,
69
+ format: 'iife',
70
+ target: ['es2020']
71
+ }
72
+ },
73
+ {
74
+ src: 'core/frontend/src/admin-auth/message-handler.js',
75
+ dest: 'core/frontend/public/admin-auth/admin-auth.min.js',
76
+ options: {
77
+ bundle: false
78
+ }
79
+ }
80
+ ];
81
+
82
+ // Process all files
83
+ (async () => {
84
+ logging.debug('Starting JS minification...');
85
+
86
+ for (const file of filesToMinify) {
87
+ try {
88
+ const srcPath = resolvePath(file.src);
89
+ const destPath = resolvePath(file.dest);
90
+
91
+ // Ensure the destination directory exists
92
+ const destDir = path.dirname(destPath);
93
+ if (!fs.existsSync(destDir)) {
94
+ fs.mkdirSync(destDir, {recursive: true});
95
+ }
96
+
97
+ // Create build configuration by merging default options with file-specific options
98
+ const buildConfig = {
99
+ entryPoints: [srcPath],
100
+ outfile: destPath,
101
+ minify: true,
102
+ platform: 'browser',
103
+ // Apply file-specific options, with defaults
104
+ ...file.options
105
+ };
106
+
107
+ await esbuild.build(buildConfig);
108
+
109
+ // Show bundling status in output
110
+ const bundleStatus = buildConfig.bundle ? 'bundled + minified' : 'minified';
111
+ logging.debug(`✓ ${file.src} → ${file.dest} (${bundleStatus})`);
112
+ } catch (error) {
113
+ console.error(`✗ Error processing ${file.src}:`, error);
114
+ process.exit(1);
115
+ }
116
+ }
117
+
118
+ logging.debug('JS processing complete');
119
+ })();
package/core/bridge.js CHANGED
@@ -16,7 +16,7 @@ const logging = require('@tryghost/logging');
16
16
  const tpl = require('@tryghost/tpl');
17
17
  const themeEngine = require('./frontend/services/theme-engine');
18
18
  const appService = require('./frontend/services/apps');
19
- const {adminAuthAssets, cardAssets,commentCountsAssets, memberAttributionAssets} = require('./frontend/services/assets-minification');
19
+ const {cardAssets} = require('./frontend/services/assets-minification');
20
20
  const routerManager = require('./frontend/services/routing').routerManager;
21
21
  const settingsCache = require('./shared/settings-cache');
22
22
  const urlService = require('./server/services/url');
@@ -51,10 +51,6 @@ class Bridge {
51
51
  return themeEngine.getActive();
52
52
  }
53
53
 
54
- ensureAdminAuthAssetsMiddleware() {
55
- return adminAuthAssets.serveMiddleware();
56
- }
57
-
58
54
  async activateTheme(loadedTheme, checkedTheme) {
59
55
  let settings = {
60
56
  locale: settingsCache.get('locale')
@@ -69,12 +65,6 @@ class Bridge {
69
65
  const cardAssetConfig = this.getCardAssetConfig();
70
66
  debug('reload card assets config', cardAssetConfig);
71
67
  cardAssets.invalidate(cardAssetConfig);
72
-
73
- // TODO: is this in the right place?
74
- // rebuild asset files
75
- commentCountsAssets.invalidate();
76
- adminAuthAssets.invalidate();
77
- memberAttributionAssets.invalidate();
78
68
  } catch (err) {
79
69
  logging.error(new errors.InternalServerError({
80
70
  message: tpl(messages.activateFailed, {theme: loadedTheme.name}),