Skip to content

Commit 51504f2

Browse files
authored
Merge branch 'master' into feat/change-default-behavior-of-invalid-where-values-to-be-throw
2 parents 23e905e + 56c449e commit 51504f2

28 files changed

Lines changed: 10263 additions & 16399 deletions

.github/FUNDING.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
# These are supported funding model platforms
22

3-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: # Replace with a single Patreon username
53
open_collective: typeorm
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
custom: # Replace with a single custom sponsorship URL

.github/copilot-instructions.md

Lines changed: 57 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,17 @@ TypeORM is a TypeScript-based Object-Relational Mapping (ORM) library that suppo
3939
### Code Style
4040

4141
- **Formatting**: Use Prettier with these settings:
42-
- No semicolons (`"semi": false`)
43-
- Arrow function parentheses always (`"arrowParens": "always"`)
44-
- Trailing commas everywhere (`"trailingComma": "all"`)
42+
- No semicolons (`"semi": false`)
4543
- **Linting**: ESLint with TypeScript support
46-
- Use `@typescript-eslint` rules
47-
- Warnings allowed for some `@typescript-eslint/no-*` rules
48-
- Unused variables starting with `_` are ignored
44+
- Use `@typescript-eslint` rules
45+
- Warnings allowed for some `@typescript-eslint/no-*` rules
46+
- Unused variables starting with `_` are ignored
4947
- **Naming Conventions**:
50-
- Classes: PascalCase (e.g., `DataSource`, `EntityManager`)
51-
- Interfaces: PascalCase (e.g., `ColumnOptions`, `RelationOptions`)
52-
- Variables/functions: camelCase
53-
- Constants: UPPER_SNAKE_CASE for true constants
54-
- Private members: Use standard camelCase (no underscore prefix)
48+
- Classes: PascalCase (e.g., `DataSource`, `EntityManager`)
49+
- Interfaces: PascalCase (e.g., `ColumnOptions`, `RelationOptions`)
50+
- Variables/functions: camelCase
51+
- Constants: UPPER_SNAKE_CASE for true constants
52+
- Private members: Use standard camelCase (no underscore prefix)
5553

5654
### TypeScript Patterns
5755

@@ -67,6 +65,7 @@ TypeORM is a TypeScript-based Object-Relational Mapping (ORM) library that suppo
6765
### Test Structure
6866

6967
Tests are organized in `test/` directory:
68+
7069
- **`test/functional/`** - Feature and integration tests organized by functionality (preferred)
7170
- **`test/github-issues/`** - Tests for specific GitHub issues
7271
- **`test/unit/`** - Unit tests for individual components
@@ -77,50 +76,62 @@ Tests are organized in `test/` directory:
7776
### Test Writing Guidelines
7877

7978
1. **Use the standard test template**:
79+
8080
```typescript
81+
import { expect } from "chai"
8182
import "reflect-metadata"
82-
import { createTestingConnections, closeTestingConnections, reloadTestingDatabases } from "../../utils/test-utils"
83+
import {
84+
closeTestingConnections,
85+
createTestingConnections,
86+
reloadTestingDatabases,
87+
} from "../../utils/test-utils"
8388
import { DataSource } from "../../../src/data-source/DataSource"
84-
import { expect } from "chai"
8589

8690
describe("description of functionality", () => {
8791
let dataSources: DataSource[]
88-
before(async () => dataSources = await createTestingConnections({
89-
entities: [__dirname + "/entity/*{.js,.ts}"],
90-
schemaCreate: true,
91-
dropSchema: true,
92-
}))
92+
before(
93+
async () =>
94+
(dataSources = await createTestingConnections({
95+
entities: [__dirname + "/entity/*{.js,.ts}"],
96+
schemaCreate: true,
97+
dropSchema: true,
98+
})),
99+
)
93100
beforeEach(() => reloadTestingDatabases(dataSources))
94101
after(() => closeTestingConnections(dataSources))
95102

96-
it("should do something specific", () => Promise.all(dataSources.map(async dataSource => {
97-
// Test implementation
98-
})))
103+
it("should do something specific", () =>
104+
Promise.all(
105+
dataSources.map(async (dataSource) => {
106+
// Test implementation
107+
}),
108+
))
99109
})
100110
```
101111

102112
2. **Test Configuration**:
103-
- Tests run against multiple databases (as configured in `ormconfig.json`)
104-
- Each test should work across all supported databases unless database-specific
105-
- Place entity files in `./entity/` relative to test file for automatic loading
106-
- Use `Promise.all(dataSources.map(...))` pattern to test against all databases
113+
- Tests run against multiple databases (as configured in `ormconfig.json`)
114+
- Each test should work across all supported databases unless database-specific
115+
- Place entity files in `./entity/` relative to test file for automatic loading
116+
- Use `Promise.all(dataSources.map(...))` pattern to test against all databases
107117

108118
3. **Test Naming**:
109-
- Use descriptive `describe()` blocks for features
110-
- Use "should..." format for `it()` descriptions
111-
- Reference GitHub issue numbers when fixing specific issues
119+
- Use descriptive `describe()` blocks for features
120+
- Use "should..." format for `it()` descriptions
121+
- Reference GitHub issue numbers when fixing specific issues
112122

113123
4. **Running Tests**:
114-
- Full test suite: `npm test` (compiles then runs tests)
115-
- Fast iteration: `npm run test:fast` (runs without recompiling)
116-
- Specific tests: `npm run test:fast -- --grep "pattern"`
117-
- Watch mode: `npm run compile -- --watch` + `npm run test:fast`
124+
- Full test suite: `pnpm run test` (compiles then runs tests)
125+
- Fast iteration: `pnpm run test:fast` (runs without recompiling)
126+
- Specific tests: `pnpm run test:fast -- --grep "pattern"`
127+
- Watch mode: `pnpm run compile -- --watch` + `pnpm run test:fast`
118128

119129
## Database-Specific Considerations
120130

121131
### Multi-Database Support
122132

123133
When writing code or tests:
134+
124135
- Ensure compatibility across all supported databases
125136
- Use driver-specific code only in `src/driver/` directory
126137
- Test database-agnostic code against multiple databases
@@ -130,6 +141,7 @@ When writing code or tests:
130141
### Driver Implementation
131142

132143
Each driver in `src/driver/` implements common interfaces:
144+
133145
- Connection management
134146
- Query execution
135147
- Schema synchronization
@@ -168,20 +180,20 @@ Each driver in `src/driver/` implements common interfaces:
168180

169181
### Commands
170182

171-
- **Build**: `npm run compile` - Compiles TypeScript to `build/compiled/`
172-
- **Package**: `npm run package` - Creates distribution in `build/package/`
173-
- **Pack**: `npm run pack` - Creates `.tgz` file in `build/`
174-
- **Test**: `npm test` - Compile and run all tests
175-
- **Lint**: `npm run lint` - Run ESLint
176-
- **Format**: `npm run format` - Run Prettier
177-
- **Watch**: `npm run watch` - Watch mode for TypeScript compilation
183+
- **Build**: `pnpm run compile` - Compiles TypeScript to `build/compiled/`
184+
- **Package**: `pnpm run package` - Creates distribution in `build/package/`
185+
- **Pack**: `pnpm pack` - Creates `.tgz` file in `build/`
186+
- **Test**: `pnpm run test` - Compile and run all tests
187+
- **Lint**: `pnpm run lint` - Run ESLint
188+
- **Format**: `pnpm run format` - Run Prettier
189+
- **Watch**: `pnpm run watch` - Watch mode for TypeScript compilation
178190

179191
### Development Setup
180192

181-
1. Install dependencies: `npm install`
193+
1. Install dependencies: `pnpm install`
182194
2. Copy config: `cp ormconfig.sample.json ormconfig.json`
183195
3. Configure database connections in `ormconfig.json`
184-
4. Optionally use Docker: `docker-compose up` for database services
196+
4. Optionally use Docker: `docker compose up` for database services
185197

186198
### Pre-commit Hooks
187199

@@ -194,6 +206,7 @@ Each driver in `src/driver/` implements common interfaces:
194206
### Commit Message Format
195207

196208
Follow conventional commits:
209+
197210
```
198211
<type>: <subject>
199212
@@ -204,7 +217,8 @@ Follow conventional commits:
204217

205218
**Types**: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `chore`, `revert`
206219

207-
**Subject**:
220+
**Subject**:
221+
208222
- Use imperative, present tense
209223
- Don't capitalize first letter
210224
- No period at the end
@@ -232,7 +246,7 @@ export class User {
232246
@Column()
233247
name: string
234248

235-
@OneToMany(() => Photo, photo => photo.user)
249+
@OneToMany(() => Photo, (photo) => photo.user)
236250
photos: Photo[]
237251
}
238252
```

.github/workflows/preview.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,12 @@ jobs:
1818
- uses: actions/checkout@v6
1919
with:
2020
fetch-depth: 0
21-
22-
- name: Use Node.js
23-
uses: actions/setup-node@v6
21+
- uses: pnpm/action-setup@v4
22+
- uses: actions/setup-node@v6
2423
with:
25-
node-version-file: .nvmrc
26-
27-
- name: Install dependencies
28-
run: npm ci
29-
30-
- name: Build
31-
run: npm run package
24+
node-version: 20
25+
cache: "pnpm"
3226

33-
- name: Release preview version
34-
run: npm run publish:preview
27+
- run: pnpm install
28+
- run: pnpm run package
29+
- run: pnpm run publish:preview

.github/workflows/publish-package.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ jobs:
1212
id-token: write
1313
steps:
1414
- uses: actions/checkout@v6
15+
- uses: pnpm/action-setup@v4
1516
- uses: actions/setup-node@v6
1617
with:
17-
node-version-file: .nvmrc
18+
node-version: 20
1819
registry-url: "https://registry.npmjs.org"
19-
- run: npm ci
20-
- run: npm run package
20+
cache: "pnpm"
21+
22+
- run: pnpm install
23+
- run: pnpm run package
2124
- run: |
2225
cd build/package
23-
npm publish --provenance --access public
26+
pnpm publish --provenance --access public
2427
env:
2528
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)