Skip to content
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

feat: add v4 MetadataManager #4107

Open
wants to merge 18 commits into
base: v4-next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 2 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
node-version: [16, 18]
node-version: [18]
os: [ubuntu-latest]
include:
- node-version: 16
pnpm-version: 8
- node-version: 18
pnpm-version: 9
runs-on: ${{ matrix.os }}
services:
redis:
Expand Down Expand Up @@ -92,7 +87,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ matrix.pnpm-version }}
version: 9
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
Expand Down
86 changes: 12 additions & 74 deletions .github/workflows/precheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pre Check

on:
push:
branches: [main]
branches: [v4-next]
paths-ignore:
- 'site/**'
- '*.md'
Expand All @@ -19,85 +19,23 @@ jobs:
node-version: ['lts/*']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
rabbitmq:
image: rabbitmq:latest
ports:
- 5672/tcp
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
zookeeper:
image: wurstmeister/zookeeper
ports:
- 2181:2181
env:
ALLOW_ANONYMOUS_LOGIN: yes
options: >-
--health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181"
--health-interval 10s
--health-timeout 5s
--health-retries 5
kafka:
image: wurstmeister/kafka
ports:
- 9092:9092
options: >-
--health-cmd "kafka-broker-api-versions.sh --version"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 ## 修改:宿主机IP
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_ADVERTISED_PORT: 9092

# postgres:
# image: postgres:alpine
# ports:
# - 5432:5432
# env:
# POSTGRES_DB: db_ci_test
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# # needed because the postgres container does not provide a healthcheck
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.11.0
with:
mongodb-version: 4.2

- run: npm install
- run: npm run build --if-present
- run: npm run lint
- run: npm run lint:cycle
# - run: npm run test_legacy
env:
RABBITMQ_URL: amqp://localhost:${{ job.services.rabbitmq.ports[5672] }}
ALI_SDK_OSS_REGION: ${{ secrets.ALI_SDK_OSS_REGION }}
ALI_SDK_OSS_ENDPOINT: ${{ secrets.ALI_SDK_OSS_ENDPOINT }}
ALI_SDK_OSS_ID: ${{ secrets.ALI_SDK_OSS_ID }}
ALI_SDK_OSS_SECRET: ${{ secrets.ALI_SDK_OSS_SECRET }}
ALI_SDK_OSS_BUCKET: ${{ secrets.ALI_SDK_OSS_BUCKET }}
ALI_SDK_STS_ID: ${{ secrets.ALI_SDK_STS_ID }}
ALI_SDK_STS_SECRET: ${{ secrets.ALI_SDK_STS_SECRET }}
ALI_SDK_STS_BUCKET: ${{ secrets.ALI_SDK_STS_BUCKET }}
ALI_SDK_STS_ROLE: ${{ secrets.ALI_SDK_STS_ROLE }}
- run: pnpm install
- run: pnpm build --if-present
- run: pnpm lint
- run: pnpm lint:cycle
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
link-workspace-packages = true
public-hoist-pattern[] = @midwayjs/*
12 changes: 12 additions & 0 deletions .run/All Tests in async-hooks-context-manager.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in async-hooks-context-manager" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/async-hooks-context-manager/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in axios.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in axios" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/axios/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in bootstrap.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in bootstrap" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/bootstrap/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in bull-board.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in bull-board" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/bull-board/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in bull.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in bull" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/bull/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in busboy.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in busboy" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/busboy/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in cache-manager.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in cache-manager" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/cache-manager/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in captcha.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in captcha" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/captcha/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in casbin-redis-adapter.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in casbin-redis-adapter" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/casbin-redis-adapter/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in casbin-typeorm-adapter.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in casbin-typeorm-adapter" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/casbin-typeorm-adapter/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in casbin.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in casbin" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/casbin/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in code-dye.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in code-dye" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/code-dye/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in consul.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in consul" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/consul/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in core.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in core" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/core/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in cos.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in cos" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/cos/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in cron.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in cron" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/cron/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in cross-domain.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in cross-domain" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/cross-domain/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in egg.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in egg" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/web-egg/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
12 changes: 12 additions & 0 deletions .run/All Tests in etcd.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="All Tests in etcd" type="JavaScriptTestRunnerJest" folderName="midway all test">
<config-file value="$PROJECT_DIR$/packages/etcd/jest.config.js" />
<node-interpreter value="project" />
<node-options value="-r ts-node/register" />
<jest-package value="$PROJECT_DIR$/node_modules/jest" />
<working-dir value="$PROJECT_DIR$" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
Loading
Loading