Skip to content

[20] Fix NextJS example "showExperiments" query string and update contributing guide #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d0ce7f1
change initial commit message in changelogs (#3)
TomStrepsil Dec 24, 2024
27e436a
[#18] Fix JSDoc module names (#19)
TomStrepsil Jan 30, 2025
8116365
fix showExperiments querystring in nextJs example
TomStrepsil Feb 7, 2025
5311b33
clarify contribution guide
TomStrepsil Feb 7, 2025
5c743b1
clarify fork vs write access
TomStrepsil Feb 7, 2025
e475e94
clarify clarification, dawg
TomStrepsil Feb 7, 2025
b15ea3f
remove extra quote level in note
TomStrepsil Feb 7, 2025
3ad71f3
extra blank line, for clarity
TomStrepsil Feb 7, 2025
3a6d809
add "staged" for clarity
TomStrepsil Feb 7, 2025
4712a19
update some linux playwright screenshots?! New ubuntu image subtly c…
TomStrepsil Feb 7, 2025
15be63a
update changelog
TomStrepsil Feb 7, 2025
d36add0
empty commit, to attempt reboot of check run
TomStrepsil Feb 7, 2025
0c7086e
update danger
TomStrepsil Feb 7, 2025
bb70ed4
fixup registry
TomStrepsil Feb 7, 2025
b9e93d6
merge complete
TomStrepsil Feb 7, 2025
9b5ce0a
fix examples readme links
TomStrepsil Feb 8, 2025
041368e
add danger:local:staged
TomStrepsil Feb 9, 2025
62da38e
serve changelog & version
TomStrepsil Feb 9, 2025
f5236d3
update readme
TomStrepsil Feb 12, 2025
4493d7a
fix typo in jsdoc
TomStrepsil Feb 27, 2025
51c2c48
package-lock.json
TomStrepsil Mar 4, 2025
1f0cb29
[26] Fix public/scoped package publishing (#27)
TomStrepsil Mar 6, 2025
aad44d3
Merge branch 'main' into bug/fix-nextjs-example-show-experiments-quer…
TomStrepsil Mar 6, 2025
243b5bb
changelog typo
TomStrepsil Mar 6, 2025
d85e398
fix registry url etc (#34)
TomStrepsil Mar 6, 2025
0a426df
Merge branch 'main' into bug/fix-nextjs-example-show-experiments-quer…
TomStrepsil Mar 6, 2025
97e7f7a
undo update to danger, might as well wait for https://github.com/ASOS…
TomStrepsil Mar 6, 2025
39f2e56
consistent full-stops
TomStrepsil Mar 6, 2025
093bd57
remove note re: playwright - that's now fixed
TomStrepsil Mar 6, 2025
16b6afe
homepage in package.json and README in npm package
TomStrepsil Mar 6, 2025
63f9c72
fixup pr template
TomStrepsil Mar 6, 2025
3e54e59
consistent capitalisation
TomStrepsil Mar 6, 2025
f442486
remove dupe changelog title
TomStrepsil Mar 6, 2025
191985a
move react 17 note
TomStrepsil Mar 7, 2025
a3fa0f8
typo
TomStrepsil Mar 7, 2025
49e6d03
clarify convention based approach
TomStrepsil Mar 7, 2025
464da4d
fixup jsdoc further
TomStrepsil Mar 16, 2025
56d1508
Revert "fixup jsdoc further"
TomStrepsil Mar 16, 2025
e1a1f4c
string, not regexp!
TomStrepsil Mar 16, 2025
1735f67
clarify jsdoc, both pointCuts should use a trigger folder
TomStrepsil Mar 16, 2025
a36bc30
singular "glob" in jsdoc
TomStrepsil Mar 16, 2025
e320eb6
Merge remote-tracking branch 'upstream/main' into bug/fix-nextjs-exam…
TomStrepsil Apr 10, 2025
3af5b45
clarify react 17 react-dom/server alias
TomStrepsil Apr 16, 2025
afafb97
casing
TomStrepsil Apr 24, 2025
fb10bb5
scout rule. delete orphan file. fix typo in readme.
TomStrepsil May 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Issue

[_ISSUE_ID_](https://github.com/ASOS/web-toggle-point/issues/_ISSUE_ID_)
resolves #_ISSUE_ID_

## Details

Expand Down
22 changes: 21 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,31 @@ N.B. See changelogs for individual packages, where most change will occur:

This log covers the [monorepo](https://en.wikipedia.org/wiki/Monorepo).

## [0.10.5] - 2025-03-06

### Fixed

- updated the `CONTRIBUTING.md`:
- clarification regarding changes needing to be committed for the `danger:local` script to be effective
- clarification regarding write access or forking being needed to open a pull request

### Changed

- updated main `README.md`:
- linked to `CONTRIBUTING.md`
- added link to repo discussions, alongside the issues
- clarified the convention-based approach to advice
- updated `pull_request_template.md` to ensure "resolves #issue" is prompted, to make sure linked issues are closed automatically with PR merges

### Added

- a `danger:local:staged` command to augment the above danger fix

## [0.10.4] - 2025-03-06

### Fixed

- Ensured that the registry is explicitly set, to ensure that [`@actions/setup-node`](https://github.com/actions/setup-node) honours the `NODE_AUTH_TOKEN`
- ensured that the registry is explicitly set, to ensure that [`@actions/setup-node`](https://github.com/actions/setup-node) honours the `NODE_AUTH_TOKEN`

## [0.10.3] - 2025-02-27

Expand Down
9 changes: 9 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ On this project we follow mainline development (or trunk based development), and

Therefore you need to branch / fork from `main` and merge into `main`.

> [!NOTE]
> To contribute a pull request, [you will need to fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) or be given [write access](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request), so get in touch to discuss the latter!

### Coding style

Generally try to match the style and conventions of the code around your changes. Ultimately we want code that is clear, concise, consistent and easy to read.
Expand All @@ -35,6 +38,12 @@ npm run test:unit
npm run test:automation
npm run danger:local
```
> [!NOTE]
> N.B. The `danger:local` script requires staged changes to be committed, otherwise you will receive the message:
>
> `No git changes detected between head and main`
>
> If you'd like to check just staged commits, you can instead run `npm run danger:local:staged`

## Opening a PR

Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ A library providing a means to toggle or branch web application code.

### 🐬 Purpose

This library provides a means to toggle or branch application code.
This library provides a means to toggle or branch application code at runtime, whilst mitigating the carrying costs of doing so.

It aims to enable low friction feature toggling [aspect/advice](https://en.wikipedia.org/wiki/Advice_(programming))[^1] in a codebase.

It suggests a convention-based approach to storing variant code, aiming to mitigate [boilerplate](https://en.wikipedia.org/wiki/Boilerplate_code) whilst developing new features, and reduce the friction of accepting or rejecting toggled variations, when appropriate.
It suggests a convention-based approach to storing variant code, aiming to mitigate [boilerplate](https://en.wikipedia.org/wiki/Boilerplate_code) whilst developing new features, and reduce the friction of accepting or rejecting toggled variations, if and when the time arises.

Originally developed for experiment toggles / flags, it acts only as a means to implement a toggle point, separating any toggle router concern, so is agnostic of the type of toggle or flag.

Expand Down Expand Up @@ -84,7 +84,7 @@ Please see separate [examples documentation](../examples/README.md).

### 🔜 Future Plans

Please see [issues](https://github.com/ASOS/web-toggle-point/issues) and please consider contributing!
Please see [discussions](https://github.com/ASOS/web-toggle-point/discussions) and [issues](https://github.com/ASOS/web-toggle-point/issues), and please consider [contributing](./CONTRIBUTING.md)!

### 🔗 Links

Expand Down
4 changes: 2 additions & 2 deletions examples/express/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Some example applications based on an [express](https://expressjs.com/) router

1. [animals](./src/routes/animals/README.md)

This is a basic example using the [`webpack`](../packages/webpack/docs/README.md) package.
This is a basic example using the [`webpack`](../../packages/webpack/docs/README.md) package.

2. [config](./src/routes/config/README.md)

This example shows the use of the [`react-pointcuts`](../packages/react-pointcuts/docs/README.md), [`features`](../packages/features/docs/README.md), [`ssr`](../packages/ssr/docs/README.md) and [`webpack`](../packages/webpack/docs/README.md) packages.
This example shows the use of the [`react-pointcuts`](../../packages/react-pointcuts/docs/README.md), [`features`](../../packages/features/docs/README.md), [`ssr`](../../packages/ssr/docs/README.md) and [`webpack`](../../packages/webpack/docs/README.md) packages.
7 changes: 7 additions & 0 deletions examples/express/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.4] - 2024-02-07

### Fixed

- corrected some links to packages from the examples readme
- removed orphan `index.js` in the animals example, this has been supplanted by `router.js`

## [0.2.3] - 2024-12-24

### Changed
Expand Down
2 changes: 1 addition & 1 deletion examples/express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-toggle-point-express-example",
"version": "0.2.3",
"version": "0.2.4",
"type": "module",
"engines": {
"node": ">=20.6.0"
Expand Down
22 changes: 0 additions & 22 deletions examples/express/src/routes/animals/index.js

This file was deleted.

6 changes: 6 additions & 0 deletions examples/next/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.3] - 2025-02-07

### Fixed

- fixed a regression in the ability to use `?showExperiments` query in the experiments fixtures, regressed in version `0.2.0`.

## [0.2.2] - 2024-12-24

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion examples/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-toggle-point-next-example",
"version": "0.2.2",
"version": "0.2.3",
"private": true,
"type": "module",
"scripts": {
Expand Down
9 changes: 4 additions & 5 deletions examples/next/src/app/fixtures/experiments/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ const Example = ({ children, experiments }) => {
const searchParams = useSearchParams();
const FeaturesProvider = providerFactory();
return (
<div
className={`${styles.experiments} ${
searchParams.get("showExperiments") ? styles.debug : ""
}`}
>
<div className={styles.experiments}>
{searchParams.has("showExperiments") ? (
<code className={styles.code}>{JSON.stringify(experiments)}</code>
) : undefined}
<FeaturesProvider value={experiments}>
<div>{children}</div>
</FeaturesProvider>
Expand Down
33 changes: 12 additions & 21 deletions examples/next/src/app/fixtures/experiments/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,16 @@
}
}

.debug {
& script {
display: inline;
font-family: monospace;
width: 100%;
padding: 2px;
margin: 2px;
flex: 0 0 auto;
background: #eee;
border: 1px solid #ccc;
}
& script[id$="decisions"]{
&::before {
content: "decisions: ";
}
}
& script[id$="audience"] {
&::before {
content: "audience: ";
}
}
.code {
padding: 0.2em;
background: #eee;
border: 1px solid #ccc;
text-indent: -7em;
}
.code::before {
content: "experiments: ";
position: relative;
left: 5.5em;
top: -1.7em;
font-family: 'Didact Gothic', 'Didact Gothic Fallback';
}
12 changes: 6 additions & 6 deletions examples/serve/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ All fall back to the default if no variant matches.
```

5. (in chrome) open `chrome://settings/?search=lang` and add one of `Portuguese (Brazil)` or `German` to your preferred languages, and move that to the no 1. position.
6. re-load `localhost:3000`
6. re-load `localhost:3001`
- you should see the following (in Portuguese example):

```html
Expand All @@ -72,7 +72,7 @@ All fall back to the default if no variant matches.
Some event-themed content
```

7. now open `localhost:3000/es`
7. now open `localhost:3001/es`
- you should see the following:

```html
Expand All @@ -83,7 +83,7 @@ All fall back to the default if no variant matches.
Some event-themed content
```

8. now open `localhost:3000/it`
8. now open `localhost:3001/it`
- you should see the following:

```html
Expand All @@ -94,7 +94,7 @@ All fall back to the default if no variant matches.
Some event-themed content
```

9. now open `localhost:3000/us` or `localhost:3000/de` or `localhost:3000/fr`
9. now open `localhost:3001/us` or `localhost:3001/de` or `localhost:3001/fr`
- you should see the following:

```html
Expand All @@ -106,7 +106,7 @@ All fall back to the default if no variant matches.
```

10. set a cookie for an audience to either of `cohort-1` or `cohort-2` using `document.cookie = "audience=cohort-1"`
11. now open `localhost:3000/`
11. now open `localhost:3001/`
- you should see the following (in cohort-1 example):

```html
Expand All @@ -118,7 +118,7 @@ All fall back to the default if no variant matches.
```

12. change the system date to either 5th July 2025, 31st October or 17th March.
13. now open `localhost:3000/`
13. now open `localhost:3001/`
- you should see the following:

```html
Expand Down
6 changes: 6 additions & 0 deletions examples/serve/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.4] - 2025-05-16

### Fixed

- fixed some incorrect ports in the `README.md`

## [0.2.3] - 2025-02-27

### Changed
Expand Down
2 changes: 1 addition & 1 deletion examples/serve/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-toggle-point-serve-example",
"version": "0.2.3",
"version": "0.2.4",
"type": "module",
"private": true,
"scripts": {
Expand Down
Loading
Loading