Skip to content

Commit edc702b

Browse files
authored
Bump [email protected], [email protected], removed ng2-charts-schematics (#418)
1 parent 5fb61a4 commit edc702b

File tree

13 files changed

+236
-339
lines changed

13 files changed

+236
-339
lines changed

npm-shrinkwrap.json

Lines changed: 143 additions & 143 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@
2525
"license": "MIT",
2626
"private": true,
2727
"dependencies": {
28-
"@angular/animations": "~19.0.3",
29-
"@angular/cdk": "~19.0.3",
30-
"@angular/common": "~19.0.3",
31-
"@angular/compiler": "~19.0.3",
32-
"@angular/core": "~19.0.3",
33-
"@angular/forms": "~19.0.3",
34-
"@angular/localize": "~19.0.3",
35-
"@angular/material": "~19.0.3",
36-
"@angular/platform-browser": "~19.0.3",
37-
"@angular/platform-browser-dynamic": "~19.0.3",
38-
"@angular/router": "~19.0.3",
39-
"@angular/service-worker": "~19.0.3",
28+
"@angular/animations": "~19.0.4",
29+
"@angular/cdk": "~19.0.4",
30+
"@angular/common": "~19.0.4",
31+
"@angular/compiler": "~19.0.4",
32+
"@angular/core": "~19.0.4",
33+
"@angular/forms": "~19.0.4",
34+
"@angular/localize": "~19.0.4",
35+
"@angular/material": "~19.0.4",
36+
"@angular/platform-browser": "~19.0.4",
37+
"@angular/platform-browser-dynamic": "~19.0.4",
38+
"@angular/router": "~19.0.4",
39+
"@angular/service-worker": "~19.0.4",
4040
"@apollo/client": "^3.12.3",
41-
"@ng-bootstrap/ng-bootstrap": "~18.0.0-rc.0",
41+
"@ng-bootstrap/ng-bootstrap": "~18.0.0",
4242
"@popperjs/core": "^2.11.8",
4343
"@types/grecaptcha": "^3.0.9",
4444
"apollo-angular": "^8.0.0",
@@ -53,10 +53,10 @@
5353
"tslib": "^2.8.1"
5454
},
5555
"devDependencies": {
56-
"@angular-devkit/build-angular": "^19.0.3",
57-
"@angular/cli": "^19.0.3",
58-
"@angular/compiler-cli": "~19.0.3",
59-
"@angular/language-service": "19.0.3",
56+
"@angular-devkit/build-angular": "^19.0.4",
57+
"@angular/cli": "^19.0.4",
58+
"@angular/compiler-cli": "~19.0.4",
59+
"@angular/language-service": "19.0.4",
6060
"@types/node": "^22.10.2",
6161
"@types/react": "^19.0.1",
6262
"angular-eslint": "19.0.2",

src/assets/documentation/libjava.md

Lines changed: 68 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ switcher.truststore.password -> Truststore password
102102

103103
# Time in ms given to the API to respond - 3000 default value
104104
switcher.timeout -> Time in ms given to the API to respond - 3000 default value
105+
switcher.poolsize -> Number of threads used to execute the API - 2 default value
105106

106107
(Java 8 applications only)
107108
switcher.regextimeout -> Time in ms given to Timed Match Worker used for local Regex (ReDoS safety mechanism) - 3000 default value
@@ -128,8 +129,30 @@ Or simply define a custom file properties to load everything from it.
128129
MyAppFeatures.loadProperties("switcherapi-test");
129130
```
130131

132+
Or using configureClient() with @PostConstruct to handle all the configuration build boilerplate.
133+
134+
```java
135+
@ConfigurationProperties
136+
class MySwitcherClientConfig extends SwitcherContextBase {
137+
138+
@SwitcherKey
139+
public static final String MY_SWITCHER = "MY_SWITCHER";
140+
141+
@Override
142+
@PostConstruct
143+
public void configureClient() {
144+
// you can add pre-configuration here
145+
super.configureClient();
146+
// you can add post-configuration here
147+
}
148+
}
149+
```
150+
131151
2. Defining your features
132152

153+
Create a class that extends SwitcherContext if you are loading the configuration from the switcherapi.properties file.
154+
Or use SwitcherContextBase to define the configuration using the ContextBuilder or SwitcherConfig.
155+
133156
```java
134157
public class MyAppFeatures extends SwitcherContext {
135158

@@ -155,13 +178,13 @@ Switcher switcher = MyAppFeatures.getSwitcher(FEATURE01);
155178
switcher.isItOn();
156179
```
157180

158-
Or, you can submit the switcher request and get the criteria response, which contains result, reason and metadata that can be used for any additional verification.
181+
Or, you can submit the switcher request and get the switcher result, which contains result, reason and metadata that can be used for any additional verification.
159182

160183
```java
161-
CriteriaResponse response = switcher.submit();
162-
response.isItOn(); // true/false
163-
response.getReason(); // Descriptive response based on result value
164-
response.getMetadata(YourMetadata.class); // Additional information
184+
SwitcherResult result = switcher.submit();
185+
result.isItOn(); // true/false
186+
result.getReason(); // Descriptive response based on result value
187+
result.getMetadata(YourMetadata.class); // Additional information
165188
```
166189

167190
2. **Strategy validation - preparing input**
@@ -292,13 +315,23 @@ Write automated tests using this built-in test annotation to guide your test sce
292315
```java
293316
Switcher switcher = MyAppFeatures.getSwitcher(FEATURE01);
294317

295-
SwitcherExecutor.assume(FEATURE01, false);
318+
SwitcherBypass.assume(FEATURE01, false);
296319
switcher.isItOn(); // 'false'
297320

298-
SwitcherExecutor.forget(FEATURE01);
321+
SwitcherBypass.forget(FEATURE01);
299322
switcher.isItOn(); // Now, it's going to return the result retrieved from the API or the Snapshot file
300323
```
301324

325+
For more complex scenarios where you need to test features based on specific inputs, you can use test conditions.
326+
327+
```java
328+
Switcher switcher = MyAppFeatures.getSwitcher(FEATURE01).checkValue("My value").build();
329+
330+
SwitcherBypass.assume(FEATURE01, true).when(StrategyValidator.VALUE, "My value");
331+
switcher.isItOn(); // 'true'
332+
333+
```
334+
302335
</br>
303336

304337
##### - Smoke test
@@ -346,6 +379,34 @@ void testMyFeature() {
346379
}
347380
```
348381

382+
Using SwitcherTestWhen to define a specific condition for the test:
383+
```java
384+
@SwitcherTest(key = MY_SWITCHER, when = @SwitcherTestWhen(value = "My value"))
385+
void testMyFeature() {
386+
assertTrue(instance.myFeature());
387+
}
388+
```
389+
390+
#### Native Image
391+
Switcher Client is fully compatible with GraalVM Native Image out of the box.
392+
</br>Here is how you can configure the SDK to work with GraalVM:
393+
394+
```java
395+
@ConfigurationProperties
396+
public class MyNativeAppFeatureFlags extends SwitcherContextBase {
397+
398+
public static final String MY_SWITCHER = "MY_SWITCHER";
399+
400+
@Override
401+
@PostConstruct
402+
protected void configureClient() {
403+
super.registerSwitcherKeys(MY_SWITCHER);
404+
super.configureClient();
405+
}
406+
}
407+
```
408+
Check out more code examples in the [Switcher Tutorials](https://github.com/switcherapi/switcherapi-tutorials) repository.
409+
349410
* * *
350411

351412
*Did you find an error? Please, open an issue*

src/assets/documentation/libjavascript.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ Client.subscribeNotifyError((error) => {
138138
Forcing Switchers to resolve remotely can help you define exclusive features that cannot be resolved locally.
139139
This feature is ideal if you want to run the SDK in local mode but still want to resolve a specific switcher remotely.
140140

141-
```ts
141+
```js
142142
const switcher = Client.getSwitcher();
143143
await switcher.remote().isItOn('FEATURE01');
144144
```
145145

146146
</br>
147147

148148
##### - Built-in mock feature
149-
You can also bypass your switcher configuration by invoking 'Client.assume'. This is perfect for your test code where you want to test both scenarios when the switcher is true and false.
149+
You can also bypass your switcher configuration by invoking 'Client.assume'. This is perfect for your test code where you want to validate both scenarios when the switcher is true and false.
150150

151151
```js
152152
Client.assume('FEATURE01').true();
@@ -158,6 +158,12 @@ switcher.isItOn('FEATURE01'); // Now, it's going to return the result retrieved
158158
Client.assume('FEATURE01').false().withMetadata({ message: 'Feature is disabled' }); // Include metadata to emulate Relay response
159159
const response = await switcher.detail().isItOn('FEATURE01'); // false
160160
console.log(response.metadata.message); // Feature is disabled
161+
162+
Client.assume('FEATURE01').true().when(StrategiesType.VALUE, 'USER_1');
163+
switcher.checkValue('USER_1').isItOn('FEATURE01'); // true when the value is 'USER_1'
164+
165+
Client.assume('FEATURE01').true().when(StrategiesType.NETWORK, ['USER_2', 'USER_3']);
166+
switcher.checkValue('USER_1').isItOn('FEATURE01'); // false as the value is not in the list
161167
```
162168

163169
**Enabling Test Mode**

src/libs/ng2-charts-schematics/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/libs/ng2-charts-schematics/src/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/libs/ng2-charts-schematics/src/ng-add/index.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/libs/ng2-charts-schematics/src/ng-add/messages.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/libs/ng2-charts-schematics/src/ng-add/schema.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/libs/ng2-charts-schematics/src/ng-add/schema.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)