Skip to content

Commit 78fb6f3

Browse files
fix: wrong publication setting
1 parent 8cc22fe commit 78fb6f3

File tree

10 files changed

+548
-66
lines changed

10 files changed

+548
-66
lines changed

.github/workflows/push.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ jobs:
9292
if: steps.yarn-cache.outputs.cache-hit != 'true'
9393
run: yarn install
9494
- name: build
95-
if: steps.yarn-cache.outputs.cache-hit != 'true'
9695
run: yarn build
9796
- name: Release
9897
env:

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
\.idea/
22
node_modules/
3+
spec/
4+
example-app/
35
src/
46
package-lock\.json
57
*.db

example-app/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.idea/
2+
.vscode/
3+
node_modules/
4+
build/
5+
tmp/
6+
temp/

example-app/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Awesome Project Build with TypeORM
2+
3+
Steps to run this project:
4+
5+
1. Run `npm i` command
6+
2. Setup database settings inside `ormconfig.json` file
7+
3. Run `npm start` command

example-app/ormconfig.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const path = require('path')
2+
3+
const rootDir = 'build/src'
4+
5+
module.exports = {
6+
type: 'postgres',
7+
host: process.env.POSTGRES_HOST || 'localhost',
8+
port: +(process.env.POSTGRES_PORT || 5432),
9+
username: process.env.POSTGRES_USER || 'postgres',
10+
password: process.env.POSTGRES_PASSWORD || '',
11+
database: process.env.POSTGRES_DATABASE || 'database_test',
12+
entities: [path.join(rootDir, '/entity/**/*.js')],
13+
migrations: [path.join(rootDir, '/migration/**/*.js')],
14+
subscribers: [path.join(rootDir, '/subscriber/**/*.js')],
15+
synchronize: true,
16+
logging: false,
17+
cli: {
18+
migrationsDir: path.join(rootDir, '/migration'),
19+
entitiesDir: path.join(rootDir, '/entity'),
20+
subscribersDir: path.join(rootDir, '/subscriber'),
21+
},
22+
}

example-app/package.json

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
{
2-
"name": "example-app",
3-
"version": "1.0.0",
4-
"main": "index.js",
5-
"license": "MIT",
6-
"scripts": {
7-
"build": "tsc",
8-
"start": "yarn build && node build/index.js",
9-
"start:dev": "concurrently \"yarn build --watch\" \"nodemon --ext '.js' --watch ../build --watch ./build --ignore 'cypress/**/*.js' node build/src/index.js\"",
10-
"cypress:open": "cypress open",
11-
"cypress:run": "cypress run"
12-
},
13-
"devDependencies": {
14-
"@types/express": "^4.17.7",
15-
"concurrently": "^5.2.0",
16-
"cypress": "^4.11.0",
17-
"nodemon": "^2.0.4",
18-
"ts-node": "^8.10.2",
19-
"typescript": "^3.9.7"
20-
},
21-
"dependencies": {
22-
"@admin-bro/core": "^3.0.0-beta.4",
23-
"@admin-bro/express": "^3.0.0-beta.1",
24-
"express": "^4.17.1",
25-
"express-formidable": "^1.2.0",
26-
"express-session": "^1.17.1"
27-
}
2+
"name": "example-app",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"build": "tsc",
8+
"start": "ts-node src/index.ts",
9+
"start:dev": "concurrently \"yarn build --watch\" \"nodemon --ext '.js' --watch ../build --watch ./build --ignore 'cypress/**/*.js' node build/src/index.js\"",
10+
"cypress:open": "cypress open",
11+
"cypress:run": "cypress run"
12+
},
13+
"devDependencies": {
14+
"@types/express": "^4.17.7",
15+
"@types/node": "^8.0.29",
16+
"concurrently": "^5.2.0",
17+
"cypress": "^4.11.0",
18+
"nodemon": "^2.0.4",
19+
"ts-node": "3.3.0",
20+
"typescript": "3.3.3333"
21+
},
22+
"dependencies": {
23+
"@admin-bro/core": "^3.0.0-beta.4",
24+
"@admin-bro/express": "^3.0.0-beta.1",
25+
"@admin-bro/typeorm": "^1.0.0",
26+
"express": "^4.17.1",
27+
"express-formidable": "^1.2.0",
28+
"express-session": "^1.17.1",
29+
"pg": "^8.3.0",
30+
"reflect-metadata": "^0.1.10",
31+
"typeorm": "0.2.25"
32+
}
2833
}

example-app/src/entity/User.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm'
2+
3+
@Entity()
4+
export class User {
5+
@PrimaryGeneratedColumn()
6+
id: number;
7+
8+
@Column()
9+
firstName: string;
10+
11+
@Column()
12+
lastName: string;
13+
14+
@Column()
15+
age: number;
16+
}

example-app/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
import 'reflect-metadata'
2+
import { createConnection } from 'typeorm'
13
import express from 'express'
24
import AdminBro from '@admin-bro/core'
35
import { buildRouter } from '@admin-bro/express'
6+
import TypeormAdapter from '@admin-bro/typeorm'
7+
import { User } from './entity/User'
8+
9+
AdminBro.registerAdapter(TypeormAdapter)
410

511
const PORT = 3000
612

713
const run = async () => {
14+
await createConnection()
815
const app = express()
916
const admin = new AdminBro()
1017
const router = buildRouter(admin)

example-app/tsconfig.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
{
22
"compilerOptions": {
33
"outDir": "./build",
4-
"target": "es2017",
4+
"target": "es6",
55
"esModuleInterop": true,
66
"jsx": "react",
77
"strictNullChecks": true,
8-
"strictPropertyInitialization": true,
98
"strictFunctionTypes": true,
109
"strictBindCallApply": true,
1110
"noImplicitThis": true,
1211
"moduleResolution": "node",
1312
"module": "commonjs",
14-
"types": ["cypress"]
13+
"types": ["cypress"],
14+
"emitDecoratorMetadata": true,
15+
"experimentalDecorators": true,
16+
"strictPropertyInitialization": false
1517
},
1618
"include": [
1719
"./src/**/*",

0 commit comments

Comments
 (0)