@scrabble-solver/scrabble-solver 2.16.0-alpha.1 → 2.16.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.
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-typescript","duration":1865923,"timestamp":3624103915,"id":13,"parentId":1,"tags":{},"startTime":1777394904105,"traceId":"a6018e819c838fab"},{"name":"run-webpack","duration":5804938,"timestamp":3625971823,"id":15,"parentId":1,"tags":{},"startTime":1777394905973,"traceId":"a6018e819c838fab"},{"name":"static-check","duration":167160,"timestamp":3631838911,"id":2025,"parentId":1,"tags":{},"startTime":1777394911840,"traceId":"a6018e819c838fab"},{"name":"static-generation","duration":839181,"timestamp":3632013828,"id":2043,"parentId":1,"tags":{},"startTime":1777394912015,"traceId":"a6018e819c838fab"},{"name":"collect-build-traces","duration":3589813,"timestamp":3632006433,"id":2040,"parentId":1,"tags":{},"startTime":1777394912008,"traceId":"a6018e819c838fab"},{"name":"telemetry-flush","duration":19,"timestamp":3635597409,"id":2055,"parentId":1,"tags":{},"startTime":1777394915599,"traceId":"a6018e819c838fab"},{"name":"next-build","duration":11723316,"timestamp":3623874115,"id":1,"tags":{"buildMode":"default","version":"16.2.4","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1777394903875,"traceId":"a6018e819c838fab"}]
1
+ [{"name":"run-typescript","duration":1945458,"timestamp":20189527449,"id":13,"parentId":1,"tags":{},"startTime":1777411469529,"traceId":"26b661378ec1790a"},{"name":"run-webpack","duration":6021387,"timestamp":20191474621,"id":15,"parentId":1,"tags":{},"startTime":1777411471476,"traceId":"26b661378ec1790a"},{"name":"static-check","duration":169557,"timestamp":20197557367,"id":2026,"parentId":1,"tags":{},"startTime":1777411477559,"traceId":"26b661378ec1790a"},{"name":"static-generation","duration":865466,"timestamp":20197735389,"id":2044,"parentId":1,"tags":{},"startTime":1777411477737,"traceId":"26b661378ec1790a"},{"name":"collect-build-traces","duration":3563192,"timestamp":20197727240,"id":2041,"parentId":1,"tags":{},"startTime":1777411477729,"traceId":"26b661378ec1790a"},{"name":"telemetry-flush","duration":21,"timestamp":20201291683,"id":2056,"parentId":1,"tags":{},"startTime":1777411481293,"traceId":"26b661378ec1790a"},{"name":"next-build","duration":11995899,"timestamp":20189295808,"id":1,"tags":{"buildMode":"default","version":"16.2.4","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1777411469297,"traceId":"26b661378ec1790a"}]
package/next.config.js CHANGED
@@ -10,6 +10,19 @@ module.exports = {
10
10
  loadPaths: ['./src', path.join(__dirname, '../../node_modules/include-media/dist')],
11
11
  quietDeps: true,
12
12
  },
13
+ // Force HTML revalidation on every navigation. Next.js's SSG ETag is derived from
14
+ // the page-data hash (the getStaticProps output), so getStaticProps embeds a per-build
15
+ // SHA to make that hash — and therefore the ETag — change between deploys. Without
16
+ // it, an unchanged page-data lets the browser 304 stale HTML that points at chunks
17
+ // the new server no longer has.
18
+ async headers() {
19
+ const cacheControl = { key: 'Cache-Control', value: 'public, max-age=0, must-revalidate' };
20
+ return [
21
+ { source: '/', headers: [cacheControl] },
22
+ { source: '/404', headers: [cacheControl] },
23
+ { source: '/not-found', headers: [cacheControl] },
24
+ ];
25
+ },
13
26
  webpack(config, { isServer, dev }) {
14
27
  config.module.rules.push({
15
28
  test: /\.svg$/i,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrabble-solver/scrabble-solver",
3
- "version": "2.16.0-alpha.1",
3
+ "version": "2.16.0",
4
4
  "description": "Scrabble Solver 2 - App",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,13 +29,13 @@
29
29
  "@floating-ui/react": "^0.27.19",
30
30
  "@kamilmielnik/trie": "^4.0.0",
31
31
  "@reduxjs/toolkit": "^2.11.2",
32
- "@scrabble-solver/configs": "^2.16.0-alpha.1",
33
- "@scrabble-solver/constants": "^2.16.0-alpha.1",
34
- "@scrabble-solver/dictionaries": "^2.16.0-alpha.1",
35
- "@scrabble-solver/logger": "^2.16.0-alpha.1",
36
- "@scrabble-solver/solver": "^2.16.0-alpha.1",
37
- "@scrabble-solver/types": "^2.16.0-alpha.1",
38
- "@scrabble-solver/word-definitions": "^2.16.0-alpha.1",
32
+ "@scrabble-solver/configs": "^2.16.0",
33
+ "@scrabble-solver/constants": "^2.16.0",
34
+ "@scrabble-solver/dictionaries": "^2.16.0",
35
+ "@scrabble-solver/logger": "^2.16.0",
36
+ "@scrabble-solver/solver": "^2.16.0",
37
+ "@scrabble-solver/types": "^2.16.0",
38
+ "@scrabble-solver/word-definitions": "^2.16.0",
39
39
  "classnames": "^2.5.1",
40
40
  "env-cmd": "^11.0.0",
41
41
  "include-media": "^2.0.0",
@@ -70,5 +70,5 @@
70
70
  "@types/redux": "^3.6.31",
71
71
  "sass": "^1.99.0"
72
72
  },
73
- "gitHead": "4573bb980623ca33ea99b5e08260d8402fbc6bd2"
73
+ "gitHead": "b1606c5d93d48bcdedc27c7367cb24643e5a999c"
74
74
  }
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable max-statements */
2
2
 
3
3
  import { isObject } from '@scrabble-solver/types';
4
+ import { execSync } from 'child_process';
4
5
  import fs from 'fs';
5
6
  import path from 'path';
6
7
  import { type FunctionComponent, useCallback, useState } from 'react';
@@ -137,9 +138,13 @@ const Index: FunctionComponent<Props> = ({ version }) => {
137
138
  );
138
139
  };
139
140
 
140
- export const getStaticProps = async (): Promise<{ props: Props }> => {
141
+ export const getStaticProps = async () => {
141
142
  const version = await readVersion();
142
- return { props: { version } };
143
+ // Inlined into __NEXT_DATA__ so the page-data hash (which feeds Next.js's SSG ETag)
144
+ // changes per build, letting browsers cache HTML and 304 within a build but pull
145
+ // fresh markup after a deploy. Not consumed by the component.
146
+ const buildSha = execSync('git rev-parse HEAD').toString().trim();
147
+ return { props: { version, buildSha } };
143
148
  };
144
149
 
145
150
  const readVersion = async (): Promise<string> => {