Skip to content

Commit b3bb3ee

Browse files
authored
Merge pull request #1 from RemyJeancolas/master
feat(plugin): Typescript plugin
2 parents b3c5df5 + 4baed11 commit b3bb3ee

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.nmpignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests

index.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
3+
loadPlugin: function() {
4+
5+
module.exports = Object.assign(module.exports, {
6+
7+
'migrator:migration:hook:require': function() {
8+
9+
/**
10+
* Always delay requires, otherwise your plugin will cause trouble
11+
* with db-migrates performance and generates issues to your users.
12+
*/
13+
require('typescript').register();
14+
15+
/**
16+
* Return value of this hook can be both, pure value or a promise.
17+
*/
18+
return {
19+
extensions: 'ts'
20+
};
21+
}
22+
});
23+
24+
delete module.exports.loadPlugin;
25+
},
26+
name: 'typescript',
27+
hooks: [
28+
'migrator:migration:hook:require'
29+
]
30+
};

package.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "db-migrate-plugin-typescript",
3+
"version": "1.0.0",
4+
"description": "A db-migrate plugin to enable Typescript style migrations.",
5+
"main": "index.js",
6+
"dependencies": {
7+
"typescript": "^1.8.10"
8+
},
9+
"devDependencies": {},
10+
"scripts": {
11+
"test": "echo \"Error: no test specified\" && exit 1"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git+https://github.com/db-migrate/plugin-typescript.git"
16+
},
17+
"keywords": [
18+
"dbmigrate",
19+
"db-migrate",
20+
"db",
21+
"migrate",
22+
"migration",
23+
"migrator",
24+
"database",
25+
"sql",
26+
"nosql",
27+
"newsql",
28+
"typescript",
29+
"type-script"
30+
],
31+
"author": "Rémy Jeancolas <[email protected]>",
32+
"license": "MIT",
33+
"bugs": {
34+
"url": "https://github.com/db-migrate/plugin-typescript/issues"
35+
},
36+
"homepage": "https://github.com/db-migrate/plugin-typescript#readme"
37+
}

0 commit comments

Comments
 (0)