Skip to content

Commit 28b81a5

Browse files
Core: Update to Strapi 5 stacked (#109)
Co-authored-by: Derrick Mehaffy <[email protected]>
1 parent 4e2e2a1 commit 28b81a5

File tree

162 files changed

+8544
-43334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+8544
-43334
lines changed

.eslintrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"env": {
3+
"commonjs": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": ["eslint:recommended", "plugin:import/recommended", "prettier"],
8+
"overrides": [
9+
{
10+
"env": {
11+
"node": true
12+
},
13+
"files": [".eslintrc.{js,cjs}"],
14+
"parserOptions": {
15+
"sourceType": "script"
16+
}
17+
}
18+
],
19+
"parserOptions": {
20+
"ecmaVersion": "latest"
21+
},
22+
"rules": {
23+
"no-undef": "off"
24+
}
25+
}

.eslintrc.js

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

.github/workflows/gh-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
tag_name: ${{ steps.meta.outputs.tag }}
2727
name: Release ${{ steps.meta.outputs.tag }}
28-
body: View [CHANGELOG.md](https://github.com/strapi-community/strapi-plugin-rest-cache/blob/main/CHANGELOG.md) for details
28+
body: View [CHANGELOG.md](https://github.com/strapi-community/plugin-rest-cache/blob/main/CHANGELOG.md) for details
2929
draft: false
3030
prerelease: false
31-
discussion_category_name: announcements
31+
discussion_category_name: announcements

.github/workflows/tests.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,27 @@ name: tests
33
on:
44
workflow_call:
55
push:
6-
branches: [main]
7-
paths:
8-
- ".github/**"
9-
- "data/**"
10-
- "packages/**"
11-
- "playgrounds/**"
12-
- "shared/**"
6+
branches:
7+
- main
8+
- 'dev/**'
139
pull_request:
1410
branches: [main]
15-
paths:
16-
- ".github/**"
17-
- "data/**"
18-
- "packages/**"
19-
- "playgrounds/**"
20-
- "shared/**"
2111

2212
jobs:
2313
linters:
2414
runs-on: ubuntu-latest
25-
15+
strategy:
16+
matrix:
17+
node: [20, 22]
2618
steps:
27-
- uses: actions/checkout@v2
28-
- uses: actions/setup-node@v1
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
2921
with:
30-
node-version: 18.x
22+
node-version: ${{ matrix.node }}
3123

3224
# cache node_modules
3325
- name: Cache dependencies
34-
uses: actions/cache@v2
26+
uses: actions/cache@v4
3527
id: yarn-cache
3628
with:
3729
path: |
@@ -49,16 +41,18 @@ jobs:
4941

5042
e2e_memory:
5143
runs-on: ubuntu-latest
52-
44+
strategy:
45+
matrix:
46+
node: [20, 22]
5347
steps:
54-
- uses: actions/checkout@v2
55-
- uses: actions/setup-node@v1
48+
- uses: actions/checkout@v4
49+
- uses: actions/setup-node@v4
5650
with:
57-
node-version: 18.x
51+
node-version: ${{ matrix.node }}
5852

5953
# cache node_modules
6054
- name: Cache dependencies
61-
uses: actions/cache@v2
55+
uses: actions/cache@v4
6256
id: yarn-cache
6357
with:
6458
path: |
@@ -74,13 +68,17 @@ jobs:
7468

7569
- run: yarn postinstall:memory
7670

71+
- run: yarn build:plugin:rest-cache
72+
7773
- name: Run Memory e2e tests
7874
working-directory: playgrounds/memory
7975
run: yarn test:e2e
8076

8177
e2e_redis:
8278
runs-on: ubuntu-latest
83-
79+
strategy:
80+
matrix:
81+
node: [20, 22]
8482
services:
8583
redis:
8684
image: bitnami/redis:latest
@@ -91,14 +89,14 @@ jobs:
9189
- 6379:6379
9290

9391
steps:
94-
- uses: actions/checkout@v2
95-
- uses: actions/setup-node@v1
92+
- uses: actions/checkout@v4
93+
- uses: actions/setup-node@v4
9694
with:
97-
node-version: 18.x
95+
node-version: ${{ matrix.node }}
9896

9997
# cache node_modules
10098
- name: Cache dependencies
101-
uses: actions/cache@v2
99+
uses: actions/cache@v4
102100
id: yarn-cache
103101
with:
104102
path: |
@@ -114,6 +112,8 @@ jobs:
114112

115113
- run: yarn postinstall:redis
116114

115+
- run: yarn build:plugin:rest-cache
116+
117117
- name: Run Redis e2e tests
118118
working-directory: playgrounds/redis
119119
run: yarn test:e2e

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v14.19.1
1+
v20.18.0

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"endOfLine": "lf",
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 2,
6+
"trailingComma": "es5",
7+
"printWidth": 100
8+
}

.prettierrc.js

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

BENCHMARKS.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Benchmarks
22

3+
These benchmarks are out of date for the current version of the plugin. They are kept here for reference and might be updated in the future.
4+
35
## Context
46

57
- Rest cache version: `4.2.4`
@@ -15,13 +17,13 @@
1517
$ ENABLE_CACHE=false yarn profile:memory
1618
```
1719

18-
| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
19-
| ----------- | ------- | ------- | ------- | ------- | ---------- | --------- | ------- |
20+
| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
21+
|-------------|---------|---------|---------|---------|------------|--------|---------|
2022
| **Latency** | 2424 ms | 2555 ms | 2921 ms | 3012 ms | 2565.12 ms | 133.23 | 3401 ms |
2123

22-
| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
23-
| ------------- | --- | ---- | ------ | ------- | ------ | ------ | ------ |
24-
| **Req/Sec** | 0 | 0 | 386 | 1000 | 383.34 | 382.38 | 39 |
24+
| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
25+
|---------------|-----|------|--------|---------|--------|--------|---------|
26+
| **Req/Sec** | 0 | 0 | 386 | 1000 | 383.34 | 382.38 | 39 |
2527
| **Bytes/Sec** | 0 B | 0 B | 453 kB | 1.17 MB | 450 kB | 449 kB | 45.7 kB |
2628

2729
### Cache enabled (without etag)
@@ -30,12 +32,12 @@ $ ENABLE_CACHE=false yarn profile:memory
3032
$ ENABLE_ETAG=false yarn profile:memory
3133
```
3234

33-
| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
34-
| ----------- | ------ | ------ | ------ | ------ | --------- | ------- | ------ |
35+
| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
36+
|-------------|--------|--------|--------|--------|-----------|----------|--------|
3537
| **Latency** | 113 ms | 116 ms | 166 ms | 175 ms | 120.04 ms | 12.86 ms | 275 ms |
3638

3739
| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
38-
| ------------- | ------- | ------- | ------- | ------- | ------- | ------ | ------- |
40+
|---------------|---------|---------|---------|---------|---------|--------|---------|
3941
| **Req/Sec** | 7451 | 7523 | 8287 | 8687 | 8293.49 | 306.35 | 6381 |
4042
| **Bytes/Sec** | 8.85 MB | 8.93 MB | 9.84 MB | 10.3 MB | 9.84 MB | 364 kB | 7.57 MB |
4143

@@ -46,10 +48,10 @@ $ yarn profile:memory
4648
```
4749

4850
| Stat | 2.5% | 50% | 97.5% | 99% | Avg | Stdev | Max |
49-
| ----------- | ------ | ------ | ------ | ------ | --------- | -------- | ------ |
51+
|-------------|--------|--------|--------|--------|-----------|----------|--------|
5052
| **Latency** | 119 ms | 125 ms | 185 ms | 197 ms | 131.05 ms | 16.87 ms | 307 ms |
5153

52-
| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
53-
| ------------- | ------- | ------- | ------- | ------- | ------- | ------ | ------- |
54-
| **Req/Sec** | 6551 | 6559 | 7651 | 8231 | 7599.39 | 472.94 | 6100 |
54+
| Stat | 1% | 2.5% | 50% | 97.5% | Avg | Stdev | Min |
55+
|---------------|---------|---------|--------|---------|---------|--------|--------|
56+
| **Req/Sec** | 6551 | 6559 | 7651 | 8231 | 7599.39 | 472.94 | 6100 |
5557
| **Bytes/Sec** | 8.05 MB | 8.07 MB | 9.4 MB | 10.1 MB | 9.34 MB | 581 kB | 7.5 MB |

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<p style="margin-top: 0;">Speed-up HTTP requests with LRU cache.</p>
55

66
<p>
7-
<a href="https://www.npmjs.org/package/strapi-plugin-rest-cache">
8-
<img src="https://img.shields.io/npm/v/strapi-plugin-rest-cache/latest.svg" alt="NPM Version" />
7+
<a href="https://www.npmjs.org/package/@strapi-community/plugin-rest-cache">
8+
<img src="https://img.shields.io/npm/v/@strapi-community/plugin-rest-cache/latest.svg" alt="NPM Version" />
99
</a>
10-
<a href="https://www.npmjs.org/package/strapi-plugin-rest-cache">
11-
<img src="https://img.shields.io/npm/dm/strapi-plugin-rest-cache" alt="Monthly download on NPM" />
10+
<a href="https://www.npmjs.org/package/@strapi-community/plugin-rest-cache">
11+
<img src="https://img.shields.io/npm/dm/@strapi-community/plugin-rest-cache" alt="Monthly download on NPM" />
1212
</a>
1313
</p>
1414
</div>
@@ -46,7 +46,7 @@ Supported Strapi Versions:
4646

4747
## 🚚 Getting Started
4848

49-
[Read the Docs to Learn More.](https://strapi-community.github.io/strapi-plugin-rest-cache/)
49+
[Read the Docs to Learn More.](https://strapi-community.github.io/plugin-rest-cache/)
5050

5151
## Contributing
5252

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<script setup lang="ts">
2+
import { useData, useRoute } from 'vitepress'
3+
import { computed } from 'vue'
4+
5+
const { site } = useData()
6+
const route = useRoute()
7+
8+
// Define which versions should show the legacy warning
9+
const legacyVersions = ['4.x.x']
10+
11+
// Check if current URL starts with any version folder name
12+
const shouldShowWarning = computed(() => {
13+
const path = route.path
14+
return legacyVersions.some(version => path.startsWith(`${site.value.base}${version}/`))
15+
})
16+
</script>
17+
18+
<template>
19+
<div v-if="shouldShowWarning" class="warning custom-block">
20+
<p class="custom-block-title">WARNING</p>
21+
<p>You're looking at the old Rest Cache plugin documentation for <strong>Strapi v4</strong>. Documentation for Strapi v5 can be <a :href="`${site.base}guide/`">found here</a>.</p>
22+
</div>
23+
</template>
24+
25+
<style scoped>
26+
.warning {
27+
margin-bottom: 2rem;
28+
}
29+
</style>

0 commit comments

Comments
 (0)