diff --git a/.babelrc b/.babelrc index c872ca6..e8f9c22 100644 --- a/.babelrc +++ b/.babelrc @@ -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}], ] -} \ No newline at end of file +} diff --git a/.gitignore b/.gitignore index 04c01ba..320c107 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -dist/ \ No newline at end of file +dist/ +package-lock.json diff --git a/README.md b/README.md index 7ab6be3..cd49587 100644 --- a/README.md +++ b/README.md @@ -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? diff --git a/database.sqlite b/database.sqlite new file mode 100644 index 0000000..1314a75 Binary files /dev/null and b/database.sqlite differ diff --git a/ormconfig.json b/ormconfig.json index 64a26b6..1651a2c 100644 --- a/ormconfig.json +++ b/ormconfig.json @@ -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" @@ -21,4 +17,4 @@ "migrationsDir": "dist/migration", "subscribersDir": "dist/subscriber" } -} \ No newline at end of file +} diff --git a/package.json b/package.json index fd3a944..e2cbf1a 100644 --- a/package.json +++ b/package.json @@ -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": {