Skip to content

Commit a7d18e7

Browse files
committed
Move to allow variant globs array
A few cherry-picks from ASOS#21...
1 parent cd2fc82 commit a7d18e7

32 files changed

+191
-149
lines changed

examples/express/docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.4] - 2025-05-27
9+
10+
### Changed
11+
12+
- updated to use `variantGlobs` array, with updated webpack plugin [0.8.0][version 0.8.0](../../../packages/webpack/docs/CHANGELOG.md#080---2025-05-27)
13+
814
## [0.2.3] - 2024-12-24
915

1016
### Changed

examples/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-toggle-point-express-example",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"type": "module",
55
"engines": {
66
"node": ">=20.6.0"

examples/express/webpack.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { fileURLToPath } from "url";
66

77
const configPointCutConfig = {
88
name: "configuration variants",
9-
variantGlob: "./src/routes/config/__variants__/*/*/*.jsx",
9+
variantGlobs: ["./src/routes/config/__variants__/*/*/*.jsx"],
1010
togglePointModule: "/src/routes/config/togglePoint.js"
1111
};
1212

@@ -48,7 +48,9 @@ const config = [
4848
configPointCutConfig,
4949
{
5050
name: "animal apis by version",
51-
variantGlob: "./src/routes/animals/api/**/v[1-9]*([0-9])/*.js",
51+
variantGlobs: [
52+
"./src/routes/animals/api/**/v{1..9}*([[:digit:]])/*.js"
53+
],
5254
joinPointResolver: (variantPath) =>
5355
posix.resolve(
5456
variantPath,

examples/next/docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.3] - 2025-05-27
9+
10+
### Changed
11+
12+
- updated to use `variantGlobs` array, with updated webpack plugin [0.8.0][version 0.8.0](../../../packages/webpack/docs/CHANGELOG.md#080---2025-05-27)
13+
814
## [0.2.2] - 2024-12-24
915

1016
### Fixed

examples/next/next.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ const togglePointInjection = new TogglePointInjection({
1212
{
1313
name: "experiments",
1414
togglePointModule: "/src/app/fixtures/experiments/withTogglePoint",
15-
variantGlob:
15+
variantGlobs: [
1616
"./src/app/fixtures/experiments/**/__variants__/*/*/!(*.spec).tsx"
17+
]
1718
}
1819
],
1920
webpackNormalModule: async () =>

examples/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-toggle-point-next-example",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"private": true,
55
"type": "module",
66
"scripts": {

examples/next/src/app/fixtures/experiments/4-varied-variant/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This example shows compound variation, in that a component varied by "feature 1"
44
can be varied again by a "feature 2". In this instance, the same point cut
5-
(for experimentation) is acting on both, since it's `variantGlob` is defined
5+
(for experimentation) is acting on both, since it has a `variantGlob` defined
66
with a recursive [`globstar`](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html#:~:text=globstar,only%20directories%20and%20subdirectories%20match.).
77

88
If an `experiments` header is set, with a `"test-feature": { "bucket": "test-variant" }`

examples/serve/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This example shows the use of [`webpack`](../../packages/webpack/docs/README.md)
66

77
It uses a `globalFeaturesStoreFactory` from the `features` package, to hold a invariant global toggle state.
88

9-
It demonstrates a setup that utilises the `toggleHandler`, `variantGlob`, and `controlResolver` options of the Webpack plugin, with some basic convention-based filesystem approaches to toggling:
9+
It demonstrates a setup that utilises the `toggleHandler`, `variantGlobs`, and `controlResolver` options of the Webpack plugin, with some basic convention-based filesystem approaches to toggling:
1010

1111
1. selecting a translations JSON file based on [`navigator.language`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language).
1212
- This uses language files stored at:

examples/serve/docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.4] - 2025-05-27
9+
10+
### Changed
11+
12+
- updated to use `variantGlobs` array, with updated webpack plugin [0.8.0][version 0.8.0](../../../packages/webpack/docs/CHANGELOG.md#080---2025-05-27)
13+
814
## [0.2.3] - 2025-02-27
915

1016
### Changed

examples/serve/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-toggle-point-serve-example",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"type": "module",
55
"private": true,
66
"scripts": {

0 commit comments

Comments
 (0)