@mdn/fred 1.2.0 → 1.3.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 (97) hide show
  1. package/.env-dist +3 -3
  2. package/CHANGELOG.md +21 -0
  3. package/build/ssr.js +1 -0
  4. package/components/env/index.js +8 -2
  5. package/components/env/utils.js +15 -4
  6. package/components/play-runner/element.js +7 -2
  7. package/out/service-worker.js +1 -1
  8. package/out/service-worker.js.map +1 -1
  9. package/out/static/client/{9914.d49932c28ec56667.js → 9914.0e9589033d2579e2.js} +2 -2
  10. package/out/static/client/9914.0e9589033d2579e2.js.map +1 -0
  11. package/out/static/client/{index.0910bee955d71d1b.js → index.1e789b86311a8c84.js} +10 -10
  12. package/out/static/client/index.1e789b86311a8c84.js.map +1 -0
  13. package/out/static/client/{runtime.3216007ef48b58b9.js → runtime.8c7621b5c39c82eb.js} +2 -2
  14. package/out/static/client/{runtime.3216007ef48b58b9.js.map → runtime.8c7621b5c39c82eb.js.map} +1 -1
  15. package/out/static/client/stats.json +255 -255
  16. package/out/static/client/{styles-a11y-menu.87133247d94d171f.js → styles-a11y-menu.9ef9230de282e800.js} +1 -1
  17. package/out/static/client/{styles-advertising.a820b0fbd3627483.js → styles-advertising.a44392a700080714.js} +1 -1
  18. package/out/static/client/{styles-article-footer.6be3444c8d5eb565.js → styles-article-footer.86b64eeebebad91b.js} +1 -1
  19. package/out/static/client/{styles-banner.bca362a6a4f7c302.js → styles-banner.fbff125bcec971bb.js} +1 -1
  20. package/out/static/client/styles-baseline-indicator.bf566965786907bc.js +1 -0
  21. package/out/static/client/{styles-blog-index.acbed372695bc055.js → styles-blog-index.ffc8cf956c8e4373.js} +1 -1
  22. package/out/static/client/{styles-blog-post.72b868f89027427f.js → styles-blog-post.a91d641515116579.js} +1 -1
  23. package/out/static/client/{styles-breadcrumbs-bar.0e8d97523444c0fe.js → styles-breadcrumbs-bar.99a04f7eef75930e.js} +1 -1
  24. package/out/static/client/{styles-breadcrumbs.9160a3861a8ab53a.js → styles-breadcrumbs.efcc208fb9e255c5.js} +1 -1
  25. package/out/static/client/{styles-button.9ae9af48571a4080.js → styles-button.fbe882b992422121.js} +1 -1
  26. package/out/static/client/{styles-content-section.ec1b9dc73aceca10.js → styles-content-section.97477ade56571b27.js} +1 -1
  27. package/out/static/client/styles-contributor-spotlight.f38b65412f05511a.js +1 -0
  28. package/out/static/client/{styles-curriculum-about.14f748159af30620.js → styles-curriculum-about.f15ed5fd5438c809.js} +1 -1
  29. package/out/static/client/styles-curriculum-default.e5662ee1eb84c092.js +1 -0
  30. package/out/static/client/styles-curriculum-landing.6e4b9b74a02421c0.js +1 -0
  31. package/out/static/client/{styles-curriculum-module.7957e2e3bd0eafb5.js → styles-curriculum-module.4f565696a741e039.js} +1 -1
  32. package/out/static/client/styles-curriculum-overview.03c8bb59e85f60fc.js +1 -0
  33. package/out/static/client/{styles-featured-articles.fe5075936dc1689d.js → styles-featured-articles.33d674ab9d0a4b23.js} +1 -1
  34. package/out/static/client/{styles-footer.5a5264232af3c286.js → styles-footer.61afa985d6c61587.js} +1 -1
  35. package/out/static/client/{styles-generic-about.bd6c3ab10cbfb61b.js → styles-generic-about.832ee823b2a15f3d.js} +1 -1
  36. package/out/static/client/{styles-generic-community.01f6a7593bc9268d.js → styles-generic-community.747ac72340973838.js} +1 -1
  37. package/out/static/client/{styles-generic-content.37bf952fe2b843c3.js → styles-generic-content.a3756d3e18ebaa38.js} +1 -1
  38. package/out/static/client/{styles-generic-layout.d5a8393d0e416a5a.js → styles-generic-layout.35e962adef8a2f23.js} +1 -1
  39. package/out/static/client/{styles-generic-sidebar.b3d7d5203335b86b.js → styles-generic-sidebar.0292229bdf97c876.js} +1 -1
  40. package/out/static/client/{styles-generic-toc.0f2eb841500811fe.js → styles-generic-toc.0cf78fef4fb1ca04.js} +1 -1
  41. package/out/static/client/{styles-global.5e83bb0f2c4c0268.js → styles-global.73ea7609e20e907a.js} +1 -1
  42. package/out/static/client/{styles-global.a9d314985c899197.css → styles-global.d92154c94ac95c1e.css} +2 -2
  43. package/out/static/client/{styles-global.a9d314985c899197.css.map → styles-global.d92154c94ac95c1e.css.map} +1 -1
  44. package/out/static/client/{styles-heading-anchor.459f5d2b6ef27a35.js → styles-heading-anchor.40bbc9df73fbe3ed.js} +1 -1
  45. package/out/static/client/{styles-homepage-body.1353218dc43e8403.js → styles-homepage-body.4d5de7246b823efb.js} +1 -1
  46. package/out/static/client/styles-homepage-contributor-spotlight.40146b76a1b9b98d.js +1 -0
  47. package/out/static/client/{styles-homepage-footer.a2e302b524b9cb41.js → styles-homepage-footer.1d2128d057b63f1c.js} +1 -1
  48. package/out/static/client/{styles-homepage-header.61d200f9e7261cf9.js → styles-homepage-header.7f9ca8158a115853.js} +1 -1
  49. package/out/static/client/{styles-homepage-hero.49347a14601630f9.js → styles-homepage-hero.a378110befc1e2cf.js} +1 -1
  50. package/out/static/client/{styles-homepage.5659711ea0d54c03.js → styles-homepage.5fb3fbe7543e268c.js} +1 -1
  51. package/out/static/client/{styles-latest-news.c935e3ecd62721be.js → styles-latest-news.9807f67c0586ad37.js} +1 -1
  52. package/out/static/client/{styles-left-sidebar.d250c9e1d0b8e944.js → styles-left-sidebar.2b2c4b35ffab8b27.js} +1 -1
  53. package/out/static/client/{styles-logo.d710c44f8c185a20.js → styles-logo.b0bad5a338d3c9d5.js} +1 -1
  54. package/out/static/client/{styles-mandala.80f6df343c206d80.js → styles-mandala.12a581abb318dbd8.js} +1 -1
  55. package/out/static/client/{styles-menu.5cf6280521425c6e.js → styles-menu.5b31bb6fde3da1a1.js} +1 -1
  56. package/out/static/client/{styles-navigation.ce5485bf0d2aa72c.js → styles-navigation.48b5d8d8c84bded3.js} +1 -1
  57. package/out/static/client/{styles-not-found.ed1a36323c6f034f.js → styles-not-found.d239b62bbdf556a1.js} +1 -1
  58. package/out/static/client/styles-observatory-landing.35868a8dba7b4d88.js +1 -0
  59. package/out/static/client/styles-observatory-results.7639a9793cb4d5f4.js +1 -0
  60. package/out/static/client/{styles-page-layout.ebaba26f8be73ed6.js → styles-page-layout.88f6a1626ac74ab0.js} +1 -1
  61. package/out/static/client/{styles-pagination.2180f506e667ba5c.js → styles-pagination.cf614f5da0884ae8.js} +1 -1
  62. package/out/static/client/{styles-playground.022236b630f29462.js → styles-playground.372ea0d0972b1cf7.js} +1 -1
  63. package/out/static/client/styles-recent-contributions.1381c21c0d5a9068.js +1 -0
  64. package/out/static/client/{styles-reference-layout.bffd0e6da5605009.js → styles-reference-layout.d9101683510063c5.js} +1 -1
  65. package/out/static/client/{styles-reference-toc.c8955d29f707494b.js → styles-reference-toc.b16b3ae26546340c.js} +1 -1
  66. package/out/static/client/{styles-sandbox.6a001e2be84a6688.js → styles-sandbox.c6f491538eb37b5a.js} +1 -1
  67. package/out/static/client/{styles-site-search.dda21a516b8b58c1.js → styles-site-search.0c4b85eda79571bf.js} +1 -1
  68. package/out/static/client/{styles-translation-banner.affb41df0468f016.js → styles-translation-banner.89994e4b4025fca7.js} +1 -1
  69. package/out/static/client/{styles-writer-toolbar.dc0dfffc08e850d6.js → styles-writer-toolbar.8cf64ea391d384dc.js} +1 -1
  70. package/out/static/client/{styles.a184d8a933a6c3a6.js → styles.7e12510d3d62d6c2.js} +2 -2
  71. package/out/static/client/{styles.a184d8a933a6c3a6.js.map → styles.7e12510d3d62d6c2.js.map} +1 -1
  72. package/out/static/legacy/asset-manifest.json +6 -6
  73. package/out/static/legacy/{index.bde4adba6f0cf3ac.html → index.7a7a7a6c9ea9fbe7.html} +1 -1
  74. package/out/static/legacy/{index.e03b3082693746b6.js → index.fdfbaab08cf3189a.js} +3 -3
  75. package/out/static/legacy/{index.e03b3082693746b6.js.map → index.fdfbaab08cf3189a.js.map} +1 -1
  76. package/out/static/legacy/stats.json +10 -10
  77. package/out/static/legacy/{yari.bd680acb6063d7c4.js → yari.9ba4e4812214ca1d.js} +3 -3
  78. package/out/static/legacy/{yari.bd680acb6063d7c4.js.map → yari.9ba4e4812214ca1d.js.map} +1 -1
  79. package/out/static/ssr/index.js +3 -3
  80. package/out/static/ssr/index.js.map +1 -1
  81. package/out/static/ssr/stats.json +4 -4
  82. package/package.json +6 -5
  83. package/server.js +5 -5
  84. package/out/static/client/9914.d49932c28ec56667.js.map +0 -1
  85. package/out/static/client/index.0910bee955d71d1b.js.map +0 -1
  86. package/out/static/client/styles-baseline-indicator.475001c3d152eda6.js +0 -1
  87. package/out/static/client/styles-contributor-spotlight.08c74d3c426050ed.js +0 -1
  88. package/out/static/client/styles-curriculum-default.89b14c7bf3342041.js +0 -1
  89. package/out/static/client/styles-curriculum-landing.4a5fa59933fb70fd.js +0 -1
  90. package/out/static/client/styles-curriculum-overview.9614bb249432e5e3.js +0 -1
  91. package/out/static/client/styles-homepage-contributor-spotlight.db46ee4b1e184c36.js +0 -1
  92. package/out/static/client/styles-observatory-landing.987e00f1527a651f.js +0 -1
  93. package/out/static/client/styles-observatory-results.736e05f4bd6e1487.js +0 -1
  94. package/out/static/client/styles-recent-contributions.b5366c0daf414e8a.js +0 -1
  95. /package/out/static/client/{index.0910bee955d71d1b.js.LICENSE.txt → index.1e789b86311a8c84.js.LICENSE.txt} +0 -0
  96. /package/out/static/legacy/{index.e03b3082693746b6.js.LICENSE.txt → index.fdfbaab08cf3189a.js.LICENSE.txt} +0 -0
  97. /package/out/static/legacy/{yari.bd680acb6063d7c4.js.LICENSE.txt → yari.9ba4e4812214ca1d.js.LICENSE.txt} +0 -0
package/.env-dist CHANGED
@@ -2,8 +2,8 @@
2
2
  CONTENT_ROOT=../content/files
3
3
  # https://github.com/mdn/translated-content
4
4
  CONTENT_TRANSLATED_ROOT=../translated-content/files
5
- # https://github.com/mdn/mdn-studio
6
- BLOG_ROOT=../mdn-studio/content/posts
5
+ # https://github.com/mdn/blog
6
+ BLOG_ROOT=../blog/content/posts
7
7
  # https://github.com/mdn/curriculum/
8
8
  CURRICULUM_ROOT=../curriculum
9
9
  # https://github.com/mdn/mdn-contributor-spotlight
@@ -29,4 +29,4 @@ RARI_URL="http://localhost:8083"
29
29
  REACT_APP_KUMA_HOST="localhost:3000"
30
30
  REACT_APP_FXA_SIGNIN_URL="/users/fxa/login/authenticate/"
31
31
  REACT_APP_FXA_SETTINGS_URL="https://accounts.stage.mozaws.net/settings/"
32
- REACT_APP_PLACEMENT_ENABLED="true"
32
+ REACT_APP_PLACEMENT_ENABLED="true"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.0](https://github.com/mdn/fred/compare/v1.2.0...v1.3.0) (2025-09-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **package/bin:** add fred-ssr executable ([#678](https://github.com/mdn/fred/issues/678)) ([faa175d](https://github.com/mdn/fred/commit/faa175dbf31d5cc715bccbcb9673572e8323e340))
9
+ * **server:** allow specifiying port from env var ([#679](https://github.com/mdn/fred/issues/679)) ([eea7274](https://github.com/mdn/fred/commit/eea72742ed07d3e2230cc33c30a2f3a1fcc9b4d3))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **env:** prefix runtime var fallback only once ([eea7274](https://github.com/mdn/fred/commit/eea72742ed07d3e2230cc33c30a2f3a1fcc9b4d3))
15
+ * **server:** omit Playground server link in output ([eea7274](https://github.com/mdn/fred/commit/eea72742ed07d3e2230cc33c30a2f3a1fcc9b4d3))
16
+
17
+
18
+ ### Miscellaneous
19
+
20
+ * **deps-dev:** bump @mdn/browser-compat-data from 7.1.0 to 7.1.1 ([#677](https://github.com/mdn/fred/issues/677)) ([2a90bc2](https://github.com/mdn/fred/commit/2a90bc213785c778481299ae6fad996d3c5fe890))
21
+ * **deps-dev:** bump the dev group with 2 updates ([#660](https://github.com/mdn/fred/issues/660)) ([08c2d3d](https://github.com/mdn/fred/commit/08c2d3d465ad31dcac9f0722856822d5da8f833c))
22
+ * rename {mdn-studio => blog} ([#681](https://github.com/mdn/fred/issues/681)) ([39ab241](https://github.com/mdn/fred/commit/39ab241bf912f0f395634029d9fd11b784f28be1))
23
+
3
24
  ## [1.2.0](https://github.com/mdn/fred/compare/v1.1.1...v1.2.0) (2025-08-28)
4
25
 
5
26
 
package/build/ssr.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  import { readFile, writeFile } from "node:fs/promises";
2
3
 
3
4
  import { fdir } from "fdir";
@@ -1,10 +1,16 @@
1
- import { parseBool, parseString } from "./utils.js";
1
+ import { parseBool, parseInt, parseString } from "./utils.js";
2
2
 
3
3
  export const PLAYGROUND_BASE_HOST = parseString(
4
4
  "PLAYGROUND_BASE_HOST",
5
5
  "mdnplay.dev",
6
6
  );
7
- export const PLAYGROUND_LOCAL = parseBool("PLAYGROUND_LOCAL", false);
7
+ export const PLAYGROUND_LOCAL = parseBool("PLAYGROUND_LOCAL", false, {
8
+ runtime: true,
9
+ });
10
+ export const PORT = parseInt("PORT", 3000, { runtime: true });
11
+ export const PLAYGROUND_PORT = parseInt("PLAYGROUND_PORT", 3001, {
12
+ runtime: true,
13
+ });
8
14
 
9
15
  export const FXA_SIGNIN_URL = parseString(
10
16
  "FXA_SIGNIN_URL",
@@ -20,6 +20,17 @@ export function parseBool(name, fallback, options) {
20
20
  }
21
21
  }
22
22
 
23
+ /**
24
+ * @param {string} name
25
+ * @param {number} fallback
26
+ * @param {Options} [options]
27
+ */
28
+ export function parseInt(name, fallback, options) {
29
+ const stringValue = getEnv(name, options);
30
+ const numberValue = stringValue ? Number.parseInt(stringValue, 10) : fallback;
31
+ return Number.isNaN(numberValue) ? fallback : numberValue;
32
+ }
33
+
23
34
  /**
24
35
  * @param {string} name
25
36
  * @param {string} fallback
@@ -36,10 +47,10 @@ export function parseString(name, fallback, options) {
36
47
  */
37
48
  function getEnv(name, options = {}) {
38
49
  const { runtime } = { runtime: false, ...options };
39
- name = `FRED_${name}`;
50
+ const fullName = `FRED_${name}`;
40
51
  if (runtime && RUNTIME_ENV) {
41
- runtimeVariables.push(name);
42
- return process.env[name] || getEnv(name);
52
+ runtimeVariables.push(fullName);
53
+ return process.env[fullName] || getEnv(name);
43
54
  }
44
- return globalThis.__MDNEnv?.[name];
55
+ return globalThis.__MDNEnv?.[fullName];
45
56
  }
@@ -5,7 +5,12 @@ import { keyed } from "lit/directives/keyed.js";
5
5
  import { createRef, ref } from "lit/directives/ref.js";
6
6
 
7
7
  import { ThemeController } from "../color-theme/controller.js";
8
- import { PLAYGROUND_BASE_HOST, PLAYGROUND_LOCAL } from "../env/index.js";
8
+ import {
9
+ PLAYGROUND_BASE_HOST,
10
+ PLAYGROUND_LOCAL,
11
+ PLAYGROUND_PORT,
12
+ PORT,
13
+ } from "../env/index.js";
9
14
  import { compressAndBase64Encode } from "../playground/utils.js";
10
15
 
11
16
  import styles from "./element.css?lit";
@@ -101,7 +106,7 @@ export class MDNPlayRunner extends LitElement {
101
106
  const url = new URL(
102
107
  `${prefix}/runner.html`,
103
108
  PLAYGROUND_LOCAL
104
- ? location.origin.replace("3000", "3001")
109
+ ? location.origin.replace(PORT.toString(), PLAYGROUND_PORT.toString())
105
110
  : `${location.protocol}//${this._subdomain}.${PLAYGROUND_BASE_HOST}`,
106
111
  );
107
112
  // pass the uuid for postMessage isolation