Skip to content

Commit 7cb3d5b

Browse files
Merge branch 'master' into eliminate
2 parents 3ccd76f + 3109c42 commit 7cb3d5b

File tree

15 files changed

+630
-110
lines changed

15 files changed

+630
-110
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/usr/bin/env node
2+
3+
const fs = require("fs");
4+
const path = require("path");
5+
6+
const repoRoot = path.resolve(__dirname, "..", "..");
7+
const packageJsonPath = path.join(repoRoot, "package.json");
8+
const contributingPath = path.join(repoRoot, "CONTRIBUTING.md");
9+
10+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
11+
const contributing = fs.readFileSync(contributingPath, "utf8");
12+
const lines = contributing.split(/\r?\n/);
13+
14+
function getPackageVersion(name) {
15+
const sections = [
16+
pkg.dependencies,
17+
pkg.devDependencies,
18+
pkg.peerDependencies,
19+
pkg.optionalDependencies,
20+
];
21+
22+
for (const section of sections) {
23+
if (section?.[name]) {
24+
return section[name];
25+
}
26+
}
27+
28+
return undefined;
29+
}
30+
31+
const reactVersion = getPackageVersion("react");
32+
const gatsbyVersion = getPackageVersion("gatsby");
33+
34+
if (!reactVersion || !gatsbyVersion) {
35+
console.error("Missing react or gatsby version in package.json dependency sections.");
36+
process.exit(1);
37+
}
38+
39+
const reactMajor = Number((reactVersion.match(/\d+/) || [])[0]);
40+
const gatsbyMajor = Number((gatsbyVersion.match(/\d+/) || [])[0]);
41+
42+
const issues = [];
43+
44+
function addIssue(line, message) {
45+
issues.push(`CONTRIBUTING.md:${line} ${message}`);
46+
}
47+
48+
function findLineFromIndex(index) {
49+
let offset = 0;
50+
for (let i = 0; i < lines.length; i++) {
51+
offset += lines[i].length + 1;
52+
if (offset > index) return i + 1;
53+
}
54+
return lines.length;
55+
}
56+
57+
// Check explicit dependency snippets in docs.
58+
for (const match of contributing.matchAll(/"react"\s*:\s*"([^"]+)"/g)) {
59+
const found = match[1];
60+
if (found !== reactVersion) {
61+
addIssue(
62+
findLineFromIndex(match.index || 0),
63+
`react version mismatch: found \"${found}\", expected \"${reactVersion}\"`,
64+
);
65+
}
66+
}
67+
68+
for (const match of contributing.matchAll(/"gatsby"\s*:\s*"([^"]+)"/g)) {
69+
const found = match[1];
70+
if (found !== gatsbyVersion) {
71+
addIssue(
72+
findLineFromIndex(match.index || 0),
73+
`gatsby version mismatch: found \"${found}\", expected \"${gatsbyVersion}\"`,
74+
);
75+
}
76+
}
77+
78+
// Check prose major-version references where they are explicitly mentioned.
79+
for (const match of contributing.matchAll(/\bReact\s+(\d+)\b/g)) {
80+
const foundMajor = Number(match[1]);
81+
if (!Number.isNaN(foundMajor) && foundMajor !== reactMajor) {
82+
addIssue(
83+
findLineFromIndex(match.index || 0),
84+
`React major mismatch in prose: found ${foundMajor}, expected ${reactMajor}`,
85+
);
86+
}
87+
}
88+
89+
for (const match of contributing.matchAll(/\bGatsby\s*\((\d+)(?:\.\d+)?(?:\.\d+)?\)/g)) {
90+
const foundMajor = Number(match[1]);
91+
if (!Number.isNaN(foundMajor) && foundMajor !== gatsbyMajor) {
92+
addIssue(
93+
findLineFromIndex(match.index || 0),
94+
`Gatsby major mismatch in prose: found ${foundMajor}, expected ${gatsbyMajor}`,
95+
);
96+
}
97+
}
98+
99+
if (issues.length > 0) {
100+
console.error("Version reference guard failed. Update CONTRIBUTING.md to match package.json.");
101+
for (const issue of issues) {
102+
console.error(`- ${issue}`);
103+
}
104+
process.exit(1);
105+
}
106+
107+
console.log("CONTRIBUTING.md version references match package.json.");

.github/workflows/checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
- name: NPM Install
1919
run: npm install --legacy-peer-deps
2020

21+
- name: Check CONTRIBUTING versions
22+
run: npm run check:contributing-versions
23+
2124
- name: Build
2225
run: npm run build
2326

CONTRIBUTING.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ To help you get started on contributing to Layer5 projects, refer to the [Layer5
3939

4040
Before **creating** an Issue i.e for `features`/`bugs`/`improvements` please follow these steps:
4141

42-
4342
1. Search existing Issues before creating a new Issue (look to see if the Issue has already been created).
4443
1. If it doesn't exist create a new Issue giving as much context as possible (please take note and select the correct Issue type, for example `bug`, `documentation` or `feature`.
4544
1. If you wish to work on the Issue once it has been triaged, please include this in your Issue description.
@@ -50,12 +49,12 @@ Before working on an existing Issue please follow these steps:
5049

5150
1. Comment asking for the Issue to be assigned to you.
5251
1. To best position yourself for Issues assignment, we recommend that you:
53-
1. Confirm that you have read the CONTRIBUTING.md.
54-
1. Have a functional development environment (have built and are able to run the project).
55-
1. Convey your intended approach to solving the issue.
56-
1. Put each of these items in writing in one or more comments.
52+
1. Confirm that you have read the CONTRIBUTING.md.
53+
1. Have a functional development environment (have built and are able to run the project).
54+
1. Convey your intended approach to solving the issue.
55+
1. Put each of these items in writing in one or more comments.
5756
1. After the Issue is assigned to you, you can start working on it.
58-
1. In general, **only** start working on this Issue (and open a Pull Request) when it has been assigned to you. Doing so will prevent confusion, duplicate work (some of which may go unaccepted given its duplicity), incidental stepping on toes, and the headache involved for maintainers and contributors alike as Issue assignments collide and heads bump together.
57+
1. In general, **only** start working on this Issue (and open a Pull Request) when it has been assigned to you. Doing so will prevent confusion, duplicate work (some of which may go unaccepted given its duplicity), incidental stepping on toes, and the headache involved for maintainers and contributors alike as Issue assignments collide and heads bump together.
5958
1. Reference the Issue in your Pull Request (for example `This PR fixes #123`). so that the corresponding Issue is automatically closed upon merge of your Pull Request.
6059

6160
> Notes:
@@ -81,7 +80,6 @@ We welcome everyone to review Pull Requests. It is a great way to learn, network
8180
- Do not repeat feedback, this creates more noise than value (check the existing conversation), use GitHub reactions if you agree/disagree with a comment
8281
- Do not blindly approve Pull Requests to improve your GitHub contributors graph
8382

84-
8583
## Style Guide
8684

8785
The Layer5 website is hosted in this repository and is built using Gatsbyjs. Before opening a Pull Request, please review the [design doc](https://docs.google.com/document/d/1rvUZy2_S1a2_14BAQIg6b9cMhUuu04kYzkOPDPaPptI/edit#) to learn more about the structure of the website. Once a Pull Request has been submitted, a preview deployment will be built and made available to you and other contributors on your PR to review.
@@ -138,7 +136,7 @@ If you'd like to contribute to [Sistent](https://github.com/layer5io/sistent), a
138136
```
139137
src/sections/Projects/Sistent
140138
```
141-
> Note: For other parts of the project, the file path may vary. Ensure you're working in the correct file associated with the area you're contributing to.
139+
> Note: For other parts of the project, the file path may vary. Ensure you're working in the correct file associated with the area you're contributing to.
142140
1. Add or update content. The system dynamically generates pages and routes to maintain consistency.
143141

144142
### Adding Sistent Component
@@ -148,14 +146,15 @@ We've streamlined the process by introducing a dynamic page creation workflow, s
148146
1. Navigate to the relevant directory, such as:
149147
```
150148
src/sections/Projects/Sistent
151-
```
149+
```
152150
1. To add a new page, simply update this `content.js` file with the necessary details. All content is managed in a centralized file:
153151
```
154152
src/sections/Projects/Sistent/components/content.js
155153
```
156154
1. The system will dynamically generate pages based on this content and handle routing automatically.
157155

158156
### Example
157+
159158
Refer to the [**Button component**](https://layer5.io/projects/sistent/components/button) in the Sistent Library for an example of how to structure the content.
160159

161160
# Common Types of Site Contributions
@@ -502,7 +501,7 @@ Make sure you have the following prerequisites installed on your operating syste
502501

503502
### Make Targets
504503

505-
Layer5 uses a `Makefile` that defines a set of rules and instructions (called **targets**) for creating, updating, and running parts of the project. Each target abstracts the underlying commands and logic, allowing to execute complex workflows using a simple `make <target>` command.
504+
Layer5 uses a `Makefile` that defines a set of rules and instructions (called **targets**) for creating, updating, and running parts of the project. Each target abstracts the underlying commands and logic, allowing to execute complex workflows using a simple `make <target>` command.
506505

507506
> **Note:** While using the make command on Windows, there sometimes arises an error in identifying the command even after it is installed (unrecognized command), this is because the PATH for the binary might not be set correctly.
508507
@@ -516,13 +515,13 @@ make
516515

517516
Environment variables are named values used to configure how an application behaves in different environments without modifying the code.
518517

519-
| Variable | Possible Values | Description |
520-
|---------|----------------|------------|
521-
| `BUILD_FULL_SITE` | `true`, `false` | When set to `true`, enables a full site build including all collections. If not explicitly set to `true`, the project defaults to a lightweight build. |
522-
| `LITE_BUILD_PROFILE` | `content`, `core` | Selects which collections are excluded when `BUILD_FULL_SITE=false`. `core` is the default for `make site`, `npm start`, and `npm run dev`, while `content` keeps blog, news, events, and resources enabled. |
523-
| `BUILD_COLLECTIONS_EXCLUDE` | comma-separated collection names | Adds extra collections to exclude from a lightweight build without editing project files. |
524-
| `NODE_ENV` | `development`, `production` | Determines the build and rendering mode used by Gatsby. This is automatically set by Gatsby. <br><br>• `development` - Uses **Deferred Static Generation (DSG)** i.e pages built on demand for faster startup. <br>• `production` - Uses **Server-Side Rendering (SSR)** i.e pages rendered on each request for fresh content. |
525-
| `CI` | `true`, `false` | Indicates that the build is running in a **Continuous Integration (CI)** environment (e.g., GitHub Actions). When set to `true`, special logic is applied to page paths and redirects for GitHub Pages compatibility. This is typically set automatically by the CI system and does not need to be configured manually. |
518+
| Variable | Possible Values | Description |
519+
| --------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
520+
| `BUILD_FULL_SITE` | `true`, `false` | When set to `true`, enables a full site build including all collections. If not explicitly set to `true`, the project defaults to a lightweight build. |
521+
| `LITE_BUILD_PROFILE` | `content`, `core` | Selects which collections are excluded when `BUILD_FULL_SITE=false`. `core` is the default for `make site`, `npm start`, and `npm run dev`, while `content` keeps blog, news, events, and resources enabled. |
522+
| `BUILD_COLLECTIONS_EXCLUDE` | comma-separated collection names | Adds extra collections to exclude from a lightweight build without editing project files. |
523+
| `NODE_ENV` | `development`, `production` | Determines the build and rendering mode used by Gatsby. This is automatically set by Gatsby. <br><br>• `development` - Uses **Deferred Static Generation (DSG)** i.e pages built on demand for faster startup. <br>• `production` - Uses **Server-Side Rendering (SSR)** i.e pages rendered on each request for fresh content. |
524+
| `CI` | `true`, `false` | Indicates that the build is running in a **Continuous Integration (CI)** environment (e.g., GitHub Actions). When set to `true`, special logic is applied to page paths and redirects for GitHub Pages compatibility. This is typically set automatically by the CI system and does not need to be configured manually. |
526525

527526
---
528527

@@ -626,15 +625,13 @@ git push -u origin <your_branch_name>
626625

627626
### Lint Rules
628627

629-
Layer5 uses ESLint to maintain code quality and consistency in our UI code. Use this command to trigger a lint check:
628+
Layer5 uses ESLint to maintain code quality and consistency in our UI code. Use this command to trigger a lint check:
630629

631630
```sh
632631
make lint
633632
```
634633

635-
> Note:
636-
> - Eslint in Gatsby requires generating config files from CLI. Run `gatsby build` or `gatsby develop` if you face this error during linting.
637-
634+
> Note: - Eslint in Gatsby requires generating config files from CLI. Run `gatsby build` or `gatsby develop` if you face this error during linting.
638635
639636
## Signing-off on Commits
640637

@@ -703,14 +700,15 @@ Where/When:
703700

704701
Reason: [https://github.com/springload/react-accessible-accordion/issues/351](https://github.com/springload/react-accessible-accordion/issues/351)
705702

706-
> V5 is a release we cut explicitly for React 18 support (Hence the major upgrade, this was a breaking change, the webpack fix would not work as we are using React 18 new APIs), we are sticking with V4 for React 17 and under compatibility, using V4 has no functional difference outside of React version compatibility.
703+
> This warning was common in earlier local setups when dependency trees were out-of-sync with React 18 support.
707704
708705
Layer5 currently using:
709706
"react-accessible-accordion": "^5.0.0"
710-
react": "^17.0.2"
707+
"react": "^18.2.0"
708+
"gatsby": "^5.16.1"
711709

712710
To clear the warning:
713-
Upgrade the `react`package to ^18. However upgrading may introduce too many breaking changes and complexity.
711+
Reinstall dependencies (`make setup`) and ensure your local dependency tree aligns with this repository's `package.json`.
714712

715713
---
716714

@@ -722,7 +720,7 @@ Where/When:
722720

723721
- In terminal: after `npm start` and loading page
724722

725-
Reason: In this version of Gatsby (4.20), the file:
723+
Reason: In older Gatsby 4.x versions, the file:
726724
`node_modules/gatsby/cache-dir/head/head-export-handler-for-ssr.js` is missing code to assign `key` prop to each head tag included in the `SEO` component.
727725

728726
To clear the warning:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"serve": "gatsby serve",
2222
"lint": "eslint --fix .",
2323
"checklint": "eslint .",
24+
"check:contributing-versions": "node .github/scripts/check-contributing-versions.cjs",
2425
"pretest": "eslint --ignore-path .gitignore .",
2526
"preload-fonts": "gatsby-preload-fonts",
2627
"deploy": "gatsby build && gh-pages -d public -b master",

src/collections/blog/2026/04-02-open-source-maintenance-ai-contributors/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ tags:
1414
- Community
1515
- Engineering
1616
featured: false
17-
published: true
17+
published: false
1818
resource: true
1919
---
2020

src/collections/blog/2026/04-03-claude-code-skills-not-found-sessionstart-hook/hero-image.svg

Lines changed: 149 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)