Skip to content

Commit

Permalink
chore: using yarn verstion 4
Browse files Browse the repository at this point in the history
  • Loading branch information
chantouchsek committed Sep 9, 2024
1 parent c1194ba commit 5bad28b
Show file tree
Hide file tree
Showing 17 changed files with 6,968 additions and 5,092 deletions.
25 changes: 0 additions & 25 deletions .eslintrc

This file was deleted.

60 changes: 30 additions & 30 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
version: 2
updates:
# Fetch and update latest `npm` packages
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- chantouchsek
assignees:
- chantouchsek
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- chantouchsek
assignees:
- chantouchsek
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `npm` packages
- package-ecosystem: npm
directory: /
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- chantouchsek
assignees:
- chantouchsek
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- chantouchsek
assignees:
- chantouchsek
commit-message:
prefix: fix
prefix-development: chore
include: scope
16 changes: 8 additions & 8 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ name: Mark stale issues and pull requests

on:
schedule:
- cron: "30 1 * * *"
- cron: '30 1 * * *'

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
- uses: actions/stale@v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: Stale issue message
stale-pr-message: Stale pull request message
stale-issue-label: no-issue-activity
stale-pr-label: no-pr-activity
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: ci
on:
push:
branches:
- "main"
- main
pull_request:
branches:
- "main"
- main

jobs:
lint-and-test:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ typings/
.next

.idea

.yarn
7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

49 changes: 49 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off", "fixable": true },
{ "rule": "format/*", "severity": "off", "fixable": true },
{ "rule": "*-indent", "severity": "off", "fixable": true },
{ "rule": "*-spacing", "severity": "off", "fixable": true },
{ "rule": "*-spaces", "severity": "off", "fixable": true },
{ "rule": "*-order", "severity": "off", "fixable": true },
{ "rule": "*-dangle", "severity": "off", "fixable": true },
{ "rule": "*-newline", "severity": "off", "fixable": true },
{ "rule": "*quotes", "severity": "off", "fixable": true },
{ "rule": "*semi", "severity": "off", "fixable": true }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml",
"toml",
"xml",
"gql",
"graphql",
"astro",
"css",
"less",
"scss",
"pcss",
"postcss"
]
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For example, using the snake strategy, if you have a model like this:
```typescript
class User {
@Column()
createdAt;
createdAt
}
```

Expand All @@ -40,36 +40,36 @@ yarn add typeorm-naming-strategy
## Usage

```ts
import { createConnection } from 'typeorm';
import { createConnection } from 'typeorm'
// import { SnakeNamingStrategy } from 'typeorm-naming-strategy';
import SnakeNamingStrategy from 'typeorm-naming-strategy';
import SnakeNamingStrategy from 'typeorm-naming-strategy'

await createConnection({
//...
// ...
namingStrategy: new SnakeNamingStrategy(), // Here you'r using the strategy!
});
})
```

Alternatively you can use it in combination with a `ormconfig.js`

```js
// Use require instead of import
// const SnakeNamingStrategy = require("typeorm-naming-strategy").SnakeNamingStrategy
const SnakeNamingStrategy = require("typeorm-naming-strategy")
const SnakeNamingStrategy = require('typeorm-naming-strategy')

module.exports = {
//...
// ...
namingStrategy: new SnakeNamingStrategy(),
}
```

Or you can use it in combination with a `ormconfig.ts`

```ts
import SnakeNamingStrategy from 'typeorm-naming-strategy';
import SnakeNamingStrategy from 'typeorm-naming-strategy'

module.exports = {
//...
// ...
namingStrategy: new SnakeNamingStrategy(),
}
```
Expand All @@ -78,14 +78,12 @@ Use with NestJs configuration

```ts
import { registerAs } from '@nestjs/config'
import type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions'
import { SnakeNamingStrategy } from 'typeorm-naming-strategy'
import type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions'

export default registerAs('database', (): MysqlConnectionOptions => ({
//...
namingStrategy: new SnakeNamingStrategy(),
//...
})
)
// ...
namingStrategy: new SnakeNamingStrategy(),
// ...
}))
```

4 changes: 2 additions & 2 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Configuration = {
extends: ['@commitlint/config-conventional'],
};
}

module.exports = Configuration;
module.exports = Configuration
5 changes: 5 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import antfu from '@antfu/eslint-config'

export default antfu({

})
55 changes: 25 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "typeorm-naming-strategy",
"version": "2.0.8",
"packageManager": "yarn@1.22.22",
"packageManager": "yarn@4.4.1",
"description": "Custom naming strategies for typeorm",
"main": "dist/main.js",
"types": "dist/main.d.ts",
"files": [
"dist"
],
"engines": {
"node": "^12.20.0 || >=14.13.0"
"author": {
"name": "Chantouch Sek",
"email": "chantouchsek.cs83@gmail.com",
"url": "https://chantouch.me"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/chantouchsek/typeorm-naming-strategy"
},
"keywords": [
"typeorm",
Expand All @@ -22,40 +24,33 @@
"typeorm snake",
"naming strategies"
],
"repository": {
"type": "git",
"url": "https://github.com/chantouchsek/typeorm-naming-strategy"
},
"author": {
"name": "Chantouch Sek",
"email": "chantouchsek.cs83@gmail.com",
"url": "https://chantouch.me"
},
"lint-staged": {
"*.{ts,js}": "eslint"
"main": "dist/main.js",
"types": "dist/main.d.ts",
"files": [
"dist"
],
"engines": {
"node": "^12.20.0 || >=14.13.0"
},
"license": "MIT",
"scripts": {
"build": "rimraf dist && tsc",
"test": "vitest --run",
"test:cov": "vitest run --coverage",
"prepublish": "yarn build",
"prepare": "husky",
"lint": "eslint --ext \".ts,.js,.vue\" --ignore-path .gitignore .",
"lint": "eslint .",
"release": "standard-version && git push --follow-tags origin main && yarn publish"
},
"peerDependencies": {
"typeorm": "^0.3"
},
"devDependencies": {
"@antfu/eslint-config": "^3.4.1",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@types/node": "^22.5.4",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitest/coverage-v8": "^2.0.5",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"eslint": "^9.10.0",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
Expand All @@ -66,7 +61,7 @@
"typescript": "^5.5.4",
"vitest": "^2.0.5"
},
"peerDependencies": {
"typeorm": "^0.3"
"lint-staged": {
"*.{ts,js}": "eslint"
}
}
Loading

0 comments on commit 5bad28b

Please sign in to comment.