Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"presets": [
"es2015"
"@babel/preset-env"
],
"plugins": [
"transform-decorators-legacy",
"transform-class-properties"
["@babel/plugin-proposal-decorators", {"legacy": true}],
["@babel/plugin-proposal-class-properties", {"loose": true}],
]
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
dist/
dist/
package-lock.json
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Example how to use [TypeORM](https://github.com/typeorm/typeorm) with JavaScript + Babel

1. clone repository
1. clone repository
2. run `npm i`
3. edit `ormconfig.json` and change your database configuration (you can also change a database type, but don't forget to install specific database drivers)
4. run `npm start`
5. enjoy!
3. run `npm start`
4. enjoy!

## How to use CLI?

Expand Down
Binary file added database.sqlite
Binary file not shown.
10 changes: 3 additions & 7 deletions ormconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"name": "default",
"type": "mysql",
"host": "localhost",
"port": 3306,
"username": "test",
"password": "test",
"database": "test",
"type": "sqlite",
"database": "database.sqlite",
"synchronize": true,
"entities": [
"dist/entity/*.js"
Expand All @@ -21,4 +17,4 @@
"migrationsDir": "dist/migration",
"subscribersDir": "dist/subscriber"
}
}
}
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
"typeorm-example"
],
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.24.1"
"@babel/core": "^7.0.0",
"@babel/cli": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/preset-env": "^7.0.0"
},
"dependencies": {
"mysql": "^2.14.1",
"sqlite3": "^4.0.2",
"typeorm": "^0.2.0"
},
"scripts": {
Expand Down