Skip to content

Commit

Permalink
chore: enable corepack and upgrade pnpm (#1543)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 authored Jun 29, 2024
1 parent 0a293ca commit 18a4877
Show file tree
Hide file tree
Showing 17 changed files with 12,370 additions and 9,910 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: ^7.15.0
version: 9.4.0

- name: Use Node.js ${{ matrix.node-version }}
uses: buildjet/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: ^7.15.0
version: 9.4.0

- name: Use Node.js ${{ matrix.node-version }}
uses: buildjet/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: ^7.15.0
version: 9.4.0

- name: Use Node.js ${{ matrix.node-version }}
uses: buildjet/setup-node@v3
Expand Down
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ I want to think you first for considering contributing to ZenStack 🙏🏻. It'

## Prerequisites

- [Node.js](https://nodejs.org/): v18 or above
- [pnpm](https://pnpm.io/): v8.x
- [Node.js](https://nodejs.org/): v20 or above
- [pnpm](https://pnpm.io/): v9.4.0

If you want to run the tests, you should be aware that some of the integration tests run against postgres. These tests will attempt to set up and subsequently their own database, so you'll need to provide a connection details for a postgres user with at least those permissions. To provide connection details, you can configure the following environment variables or provide them when executing `pnpm test` commands.

- `ZENSTACK_TEST_DB_USER`: The postgres username, for a user with permission to create/drop databases. Default: `postgres`.
- `ZENSTACK_TEST_DB_PASS`: Password for said user. Default: `abc123`.
- `ZENSTACK_TEST_DB_NAME`: Default database to connect onto. This database isn't used any further, so it's recommended to just use the default `postgres` database. Default: `postgres`.
- `ZENSTACK_TEST_DB_HOST`: Hostname or IP to connect onto. Default: `localhost`.
- `ZENSTACK_TEST_DB_PORT`: Port number to connect onto. Default: `5432`.
- `ZENSTACK_TEST_DB_USER`: The postgres username, for a user with permission to create/drop databases. Default: `postgres`.
- `ZENSTACK_TEST_DB_PASS`: Password for said user. Default: `abc123`.
- `ZENSTACK_TEST_DB_NAME`: Default database to connect onto. This database isn't used any further, so it's recommended to just use the default `postgres` database. Default: `postgres`.
- `ZENSTACK_TEST_DB_HOST`: Hostname or IP to connect onto. Default: `localhost`.
- `ZENSTACK_TEST_DB_PORT`: Port number to connect onto. Default: `5432`.

## Get started

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"keywords": [],
"author": "",
"license": "MIT",
"packageManager": "[email protected]+sha256.b6fd0bfda555e7e584ad7e56b30c68b01d5a04f9ee93989f4b93ca8473c49c74",
"devDependencies": {
"@changesets/cli": "^2.26.0",
"@types/jest": "^29.5.10",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/tanstack-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@tanstack/svelte-query": "^4.29.7",
"@tanstack/svelte-query-v5": "npm:@tanstack/svelte-query@^5.0.0",
"@tanstack/vue-query": "^4.37.0",
"@testing-library/react": "^14.0.0",
"@testing-library/react": "14.0.0",
"@types/react": "18.2.0",
"@types/semver": "^7.3.13",
"@types/tmp": "^0.2.3",
Expand Down
5 changes: 0 additions & 5 deletions packages/plugins/tanstack-query/tests/react-hooks-v5.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/**
* @jest-environment jsdom
*/

/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-explicit-any */
/// <reference types="@types/jest" />

import { QueryClient, QueryClientProvider } from '@tanstack/react-query-v5';
import { act, renderHook, waitFor } from '@testing-library/react';
import nock from 'nock';
Expand Down
5 changes: 0 additions & 5 deletions packages/plugins/tanstack-query/tests/react-hooks.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/**
* @jest-environment jsdom
*/

/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-explicit-any */
/// <reference types="@types/jest" />

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { act, renderHook, waitFor } from '@testing-library/react';
import nock from 'nock';
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@types/prettier": "^2.7.2",
"@types/tmp": "^0.2.3",
"@zenstackhq/testtools": "workspace:*",
"next": "^13.4.7",
"next": "13.4.7",
"tmp": "^0.2.3"
}
}
5 changes: 5 additions & 0 deletions packages/schema/src/cli/plugin-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ export class PluginRunner {
}

private getPluginModulePath(provider: string, schemaPath: string) {
if (process.env.ZENSTACK_TEST === '1' && provider.startsWith('@zenstackhq/')) {
// test code runs with its own sandbox of node_modules, make sure we don't
// accidentally resolve to the external ones
return path.resolve(`node_modules/${provider}`);
}
let pluginModulePath = provider;
if (provider.startsWith('@core/')) {
pluginModulePath = provider.replace(/^@core/, path.join(__dirname, '../plugins'));
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"fastify-plugin": "^4.5.0",
"h3": "^1.8.2",
"isomorphic-fetch": "^3.0.0",
"next": "^13.4.5",
"next": "13.4.7",
"nuxt": "^3.7.4",
"reflect-metadata": "^0.2.2",
"supertest": "^6.3.3"
Expand Down
1 change: 1 addition & 0 deletions packages/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "ES2020",
"lib": ["ESNext", "DOM"],
"outDir": "dist",
"strictPropertyInitialization": false
Expand Down
Loading

0 comments on commit 18a4877

Please sign in to comment.