alp-migrations 9.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +7 -7
- package/dist/definitions/Manager.d.ts +1 -1
- package/dist/definitions/Manager.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +4 -4
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/readRecursiveDirectory.d.ts +1 -2
- package/dist/definitions/readRecursiveDirectory.d.ts.map +1 -1
- package/dist/{index-node18.mjs → index-node.mjs} +32 -41
- package/dist/index-node.mjs.map +1 -0
- package/package.json +24 -22
- package/src/Manager.ts +1 -1
- package/src/index.ts +16 -15
- package/src/readRecursiveDirectory.ts +3 -3
- package/dist/index-node18.mjs.map +0 -1
- package/src/.eslintrc.json +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [11.0.0](https://github.com/christophehurpeau/alp/compare/alp-migrations@10.0.0...alp-migrations@11.0.0) (2025-10-27)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* drop node 20 and build using esbuild
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* drop node 20 and build using esbuild ([812c4c1](https://github.com/christophehurpeau/alp/commit/812c4c1b0ad19984e389af4382a8d1e60643e4f1))
|
|
15
|
+
* update nightingale packages to version 16 across multiple packages ([2f59b01](https://github.com/christophehurpeau/alp/commit/2f59b01c9c407da7c59c608a12d716058fff9c70))
|
|
16
|
+
|
|
17
|
+
Version bump for dependency: alp-node
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [10.0.0](https://github.com/christophehurpeau/alp/compare/alp-migrations@9.0.0...alp-migrations@10.0.0) (2025-08-02)
|
|
21
|
+
|
|
22
|
+
### ⚠ BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* update dependencies and drop node 20
|
|
25
|
+
* update dev dependencies, replace parse-json-object-as-map with native JSON.parse, update koa
|
|
26
|
+
* update liwi-mongo
|
|
27
|
+
* update router-segments
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* update dependencies and drop node 20 ([fc5b322](https://github.com/christophehurpeau/alp/commit/fc5b322e076e9a3c7c4a235d16734b89fd85e211))
|
|
32
|
+
* update dev dependencies, replace parse-json-object-as-map with native JSON.parse, update koa ([5ae7723](https://github.com/christophehurpeau/alp/commit/5ae77238cafc573fe72c5eb63b103802b8b2e537))
|
|
33
|
+
* update liwi-mongo ([55e04ba](https://github.com/christophehurpeau/alp/commit/55e04baac1ccc46b83880dd03076b0ab0d705ae2))
|
|
34
|
+
* update router-segments ([07ff52b](https://github.com/christophehurpeau/alp/commit/07ff52b3f851204256509056d0a4b25e1f630e5b))
|
|
35
|
+
|
|
36
|
+
Version bump for dependency: alp-node
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## [9.0.0](https://github.com/christophehurpeau/alp/compare/alp-migrations@8.2.1...alp-migrations@9.0.0) (2024-01-06)
|
|
7
40
|
|
|
8
41
|
|
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
<
|
|
1
|
+
<h1 align="center">
|
|
2
2
|
alp-migrations
|
|
3
|
-
</
|
|
3
|
+
</h1>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
migrations scripts in alp
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
<a href="https://npmjs.org/package/alp-migrations"><img src="https://img.shields.io/npm/v/alp-migrations.svg?style=flat-square"></a>
|
|
11
|
-
<a href="https://npmjs.org/package/alp-migrations"><img src="https://img.shields.io/npm/dw/alp-migrations.svg?style=flat-square"></a>
|
|
12
|
-
<a href="https://npmjs.org/package/alp-migrations"><img src="https://img.shields.io/node/v/alp-migrations.svg?style=flat-square"></a>
|
|
13
|
-
<a href="https://npmjs.org/package/alp-migrations"><img src="https://img.shields.io/npm/types/alp-migrations.svg?style=flat-square"></a>
|
|
10
|
+
<a href="https://npmjs.org/package/alp-migrations"><img src="https://img.shields.io/npm/v/alp-migrations.svg?style=flat-square" alt="npm version"></a>
|
|
11
|
+
<a href="https://npmjs.org/package/alp-migrations"><img src="https://img.shields.io/npm/dw/alp-migrations.svg?style=flat-square" alt="npm downloads"></a>
|
|
12
|
+
<a href="https://npmjs.org/package/alp-migrations"><img src="https://img.shields.io/node/v/alp-migrations.svg?style=flat-square" alt="node version"></a>
|
|
13
|
+
<a href="https://npmjs.org/package/alp-migrations"><img src="https://img.shields.io/npm/types/alp-migrations.svg?style=flat-square" alt="types"></a>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
## Install
|
|
@@ -26,7 +26,7 @@ http://alpjs.github.io/alp-migrations/docs
|
|
|
26
26
|
## Usage
|
|
27
27
|
|
|
28
28
|
```js
|
|
29
|
-
import alpMigrations from
|
|
29
|
+
import alpMigrations from "alp-migrations";
|
|
30
30
|
|
|
31
31
|
console.log(alpMigrations);
|
|
32
32
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manager.d.ts","sourceRoot":"","sources":["../../src/Manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Manager.d.ts","sourceRoot":"","sources":["../../src/Manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE9E,MAAM,WAAW,SAAU,SAAQ,cAAc;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;gBAEjB,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC;IAIxC,eAAe,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI9C,gBAAgB,CAAC,SAAS,EAAE,eAAe,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;CAG5E"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type AlpNodeApp from
|
|
2
|
-
import type MigrationsManager from
|
|
3
|
-
export { default as MigrationsManager } from
|
|
1
|
+
import type AlpNodeApp from "alp-node";
|
|
2
|
+
import type MigrationsManager from "./Manager";
|
|
3
|
+
export { default as MigrationsManager } from "./Manager";
|
|
4
4
|
export interface Options {
|
|
5
5
|
app: AlpNodeApp;
|
|
6
6
|
migrationsManager: MigrationsManager;
|
|
7
|
-
config?: AlpNodeApp[
|
|
7
|
+
config?: AlpNodeApp["config"];
|
|
8
8
|
dirname?: string;
|
|
9
9
|
}
|
|
10
10
|
export default function migrate({ app, migrationsManager, config, dirname, }: Options): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AAGvC,OAAO,KAAK,iBAAiB,MAAM,WAAW,CAAC;AAM/C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEzD,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,UAAU,CAAC;IAChB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAA8B,OAAO,CAAC,EACpC,GAAG,EACH,iBAAiB,EACjB,MAAmB,EACnB,OAAqC,GACtC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,UAAU,CAAC;AAGvC,OAAO,KAAK,iBAAiB,MAAM,WAAW,CAAC;AAM/C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEzD,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,UAAU,CAAC;IAChB,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAA8B,OAAO,CAAC,EACpC,GAAG,EACH,iBAAiB,EACjB,MAAmB,EACnB,OAAqC,GACtC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAiEzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readRecursiveDirectory.d.ts","sourceRoot":"","sources":["../../src/readRecursiveDirectory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"readRecursiveDirectory.d.ts","sourceRoot":"","sources":["../../src/readRecursiveDirectory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;CACb;AAED,wBAA8B,sBAAsB,CAClD,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GACvD,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -4,76 +4,69 @@ import { readdir, stat } from 'node:fs/promises';
|
|
|
4
4
|
|
|
5
5
|
async function readRecursiveDirectory(directory, callback) {
|
|
6
6
|
const files = await readdir(directory);
|
|
7
|
-
await Promise.all(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
await Promise.all(
|
|
8
|
+
files.map(async (file) => {
|
|
9
|
+
const path = `${directory}/${file}`;
|
|
10
|
+
const stat$1 = await stat(path);
|
|
11
|
+
if (stat$1.isDirectory()) {
|
|
12
|
+
await readRecursiveDirectory(path, callback);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
await callback({
|
|
16
|
+
filename: file,
|
|
17
|
+
basedir: directory,
|
|
18
|
+
path,
|
|
19
|
+
stat: stat$1
|
|
20
|
+
});
|
|
21
|
+
})
|
|
22
|
+
);
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
class MigrationsManager {
|
|
26
|
+
store;
|
|
24
27
|
constructor(store) {
|
|
25
28
|
this.store = store;
|
|
26
29
|
}
|
|
27
30
|
findLastVersion() {
|
|
28
|
-
return this.store.findOne({}, {
|
|
29
|
-
created: -1
|
|
30
|
-
}).then(row => row?.version);
|
|
31
|
+
return this.store.findOne({}, { created: -1 }).then((row) => row?.version);
|
|
31
32
|
}
|
|
32
33
|
addMigrationDone(migration) {
|
|
33
34
|
return this.store.insertOne(migration);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const logger = new Logger('alp:migrations');
|
|
38
|
+
const logger = new Logger("alp:migrations");
|
|
40
39
|
async function migrate({
|
|
41
40
|
app,
|
|
42
41
|
migrationsManager,
|
|
43
42
|
config = app.config,
|
|
44
43
|
dirname = `${app.dirname}/migrations`
|
|
45
44
|
}) {
|
|
46
|
-
const unhandledRejectionHandler = reason => {
|
|
47
|
-
logger.error(
|
|
48
|
-
err: reason
|
|
49
|
-
});
|
|
45
|
+
const unhandledRejectionHandler = (reason) => {
|
|
46
|
+
logger.error("unhandledRejection", { err: reason });
|
|
50
47
|
process.exit(1);
|
|
51
48
|
};
|
|
52
|
-
process.on(
|
|
49
|
+
process.on("unhandledRejection", unhandledRejectionHandler);
|
|
53
50
|
const packageVersion = config.packageConfig.version;
|
|
54
51
|
const currentVersion = await migrationsManager.findLastVersion();
|
|
55
52
|
let migrations = [];
|
|
56
|
-
logger.info(
|
|
57
|
-
|
|
58
|
-
currentVersion
|
|
59
|
-
});
|
|
60
|
-
await readRecursiveDirectory(dirname, res => {
|
|
53
|
+
logger.info("migrate", { packageVersion, currentVersion });
|
|
54
|
+
await readRecursiveDirectory(dirname, (res) => {
|
|
61
55
|
const fileName = res.path.slice(dirname.length + 1);
|
|
62
|
-
if (!fileName.endsWith(
|
|
56
|
+
if (!fileName.endsWith(".js")) {
|
|
63
57
|
return;
|
|
64
58
|
}
|
|
65
|
-
const versionExecResult = /([\d.]+)(_.*|\.js)$/.exec(fileName);
|
|
59
|
+
const versionExecResult = /([\d.]+)(?:_.*|\.js)$/.exec(fileName);
|
|
66
60
|
if (!versionExecResult?.[1]) {
|
|
67
61
|
return;
|
|
68
62
|
}
|
|
69
63
|
const version = versionExecResult[1];
|
|
70
64
|
if (currentVersion && semver.lte(version, currentVersion)) return;
|
|
71
|
-
migrations.push({
|
|
72
|
-
version,
|
|
73
|
-
fileName
|
|
74
|
-
});
|
|
65
|
+
migrations.push({ version, fileName });
|
|
75
66
|
});
|
|
76
|
-
migrations = migrations.sort(
|
|
67
|
+
migrations = migrations.sort(
|
|
68
|
+
(a, b) => semver.gt(a.version, b.version) ? 1 : -1
|
|
69
|
+
);
|
|
77
70
|
try {
|
|
78
71
|
for (const migration of migrations) {
|
|
79
72
|
logger.info(`Migration to ${migration.fileName}`);
|
|
@@ -85,8 +78,6 @@ async function migrate({
|
|
|
85
78
|
throw error;
|
|
86
79
|
}
|
|
87
80
|
logger.success(`Migration to ${migration.fileName} done !`);
|
|
88
|
-
|
|
89
|
-
// only add to db if migration version <= package version
|
|
90
81
|
if (semver.lte(migration.version, packageVersion)) {
|
|
91
82
|
await migrationsManager.addMigrationDone(migration);
|
|
92
83
|
}
|
|
@@ -95,8 +86,8 @@ async function migrate({
|
|
|
95
86
|
logger.error(error);
|
|
96
87
|
process.exit(1);
|
|
97
88
|
}
|
|
98
|
-
process.removeListener(
|
|
89
|
+
process.removeListener("unhandledRejection", unhandledRejectionHandler);
|
|
99
90
|
}
|
|
100
91
|
|
|
101
92
|
export { MigrationsManager, migrate as default };
|
|
102
|
-
//# sourceMappingURL=index-
|
|
93
|
+
//# sourceMappingURL=index-node.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-node.mjs","sources":["../src/readRecursiveDirectory.ts","../src/Manager.ts","../src/index.ts"],"sourcesContent":["import type { Stats } from \"node:fs\";\nimport { stat as fsStat, readdir } from \"node:fs/promises\";\n\nexport interface CallbackParam {\n filename: string;\n basedir: string;\n path: string;\n stat: Stats;\n}\n\nexport default async function readRecursiveDirectory(\n directory: string,\n callback: (param: CallbackParam) => Promise<void> | void,\n): Promise<void> {\n const files = await readdir(directory);\n\n await Promise.all(\n files.map(async (file): Promise<void> => {\n const path = `${directory}/${file}`;\n const stat = await fsStat(path);\n\n if (stat.isDirectory()) {\n await readRecursiveDirectory(path, callback);\n return;\n }\n await callback({\n filename: file,\n basedir: directory,\n path,\n stat,\n });\n }),\n );\n}\n","import type { MongoBaseModel, MongoInsertType, MongoStore } from \"liwi-mongo\";\n\nexport interface Migration extends MongoBaseModel {\n version: string;\n fileName: string;\n}\n\nexport default class MigrationsManager {\n store: MongoStore<Migration>;\n\n constructor(store: MongoStore<Migration>) {\n this.store = store;\n }\n\n findLastVersion(): Promise<string | undefined> {\n return this.store.findOne({}, { created: -1 }).then((row) => row?.version);\n }\n\n addMigrationDone(migration: MongoInsertType<Migration>): Promise<Migration> {\n return this.store.insertOne(migration);\n }\n}\n","/* eslint-disable unicorn/no-process-exit */\nimport type AlpNodeApp from \"alp-node\";\nimport { Logger } from \"nightingale-logger\";\nimport semver from \"semver\";\nimport type MigrationsManager from \"./Manager\";\nimport type { CallbackParam } from \"./readRecursiveDirectory\";\nimport readRecursiveDirectory from \"./readRecursiveDirectory\";\n\nconst logger = new Logger(\"alp:migrations\");\n\nexport { default as MigrationsManager } from \"./Manager\";\n\nexport interface Options {\n app: AlpNodeApp;\n migrationsManager: MigrationsManager;\n config?: AlpNodeApp[\"config\"];\n dirname?: string;\n}\n\nexport default async function migrate({\n app,\n migrationsManager,\n config = app.config,\n dirname = `${app.dirname}/migrations`,\n}: Options): Promise<void> {\n const unhandledRejectionHandler = (reason: unknown): void => {\n logger.error(\"unhandledRejection\", { err: reason });\n\n process.exit(1);\n };\n process.on(\"unhandledRejection\", unhandledRejectionHandler);\n\n const packageVersion = config.packageConfig.version as string;\n const currentVersion = await migrationsManager.findLastVersion();\n\n let migrations: { version: string; fileName: string }[] = [];\n\n logger.info(\"migrate\", { packageVersion, currentVersion });\n\n await readRecursiveDirectory(dirname, (res: CallbackParam) => {\n const fileName = res.path.slice(dirname.length + 1);\n\n if (!fileName.endsWith(\".js\")) {\n return;\n }\n\n const versionExecResult = /([\\d.]+)(?:_.*|\\.js)$/.exec(fileName);\n\n if (!versionExecResult?.[1]) {\n return;\n }\n\n const version: string = versionExecResult[1];\n\n if (currentVersion && semver.lte(version, currentVersion)) return;\n\n migrations.push({ version, fileName });\n });\n\n migrations = migrations.sort((a, b) =>\n semver.gt(a.version, b.version) ? 1 : -1,\n );\n\n try {\n for (const migration of migrations) {\n logger.info(`Migration to ${migration.fileName}`);\n try {\n const migrateFn: unknown = await import(\n `${dirname}/${migration.fileName}`\n );\n await (migrateFn as () => Promise<void>)();\n } catch (error) {\n logger.error(`Migration to ${migration.version} Failed !`);\n throw error;\n }\n\n logger.success(`Migration to ${migration.fileName} done !`);\n\n // only add to db if migration version <= package version\n if (semver.lte(migration.version, packageVersion)) {\n await migrationsManager.addMigrationDone(migration);\n }\n }\n } catch (error: any) {\n logger.error(error as Error);\n process.exit(1);\n }\n\n process.removeListener(\"unhandledRejection\", unhandledRejectionHandler);\n}\n"],"names":["stat","fsStat"],"mappings":";;;;AAUA,eAA8B,sBAAA,CAC5B,WACA,QAAA,EACe;AACf,EAAA,MAAM,KAAA,GAAQ,MAAM,OAAA,CAAQ,SAAS,CAAA;AAErC,EAAA,MAAM,OAAA,CAAQ,GAAA;AAAA,IACZ,KAAA,CAAM,GAAA,CAAI,OAAO,IAAA,KAAwB;AACvC,MAAA,MAAM,IAAA,GAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AACjC,MAAA,MAAMA,MAAA,GAAO,MAAMC,IAAA,CAAO,IAAI,CAAA;AAE9B,MAAA,IAAID,MAAA,CAAK,aAAY,EAAG;AACtB,QAAA,MAAM,sBAAA,CAAuB,MAAM,QAAQ,CAAA;AAC3C,QAAA;AAAA;AAEF,MAAA,MAAM,QAAA,CAAS;AAAA,QACb,QAAA,EAAU,IAAA;AAAA,QACV,OAAA,EAAS,SAAA;AAAA,QACT,IAAA;AAAA,cACAA;AAAA,OACD,CAAA;AAAA,KACF;AAAA,GACH;AACF;;AC1BA,MAAqB,iBAAA,CAAkB;AAAA,EACrC,KAAA;AAAA,EAEA,YAAY,KAAA,EAA8B;AACxC,IAAA,IAAA,CAAK,KAAA,GAAQ,KAAA;AAAA;AACf,EAEA,eAAA,GAA+C;AAC7C,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,OAAA,CAAQ,IAAI,EAAE,OAAA,EAAS,EAAA,EAAI,CAAA,CAAE,IAAA,CAAK,CAAC,GAAA,KAAQ,KAAK,OAAO,CAAA;AAAA;AAC3E,EAEA,iBAAiB,SAAA,EAA2D;AAC1E,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,SAAA,CAAU,SAAS,CAAA;AAAA;AAEzC;;ACbA,MAAM,MAAA,GAAS,IAAI,MAAA,CAAO,gBAAgB,CAAA;AAW1C,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
+
"version": "11.0.0",
|
|
4
4
|
"description": "migrations scripts in alp",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Christophe Hurpeau <christophe@hurpeau.com> (https://christophe.hurpeau.com)",
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
"homepage": "https://github.com/christophehurpeau/alp",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": ">=18.
|
|
16
|
+
"node": ">=22.18.0"
|
|
17
17
|
},
|
|
18
18
|
"sideEffects": false,
|
|
19
|
-
"main": "./dist/index-
|
|
19
|
+
"main": "./dist/index-node.mjs",
|
|
20
20
|
"types": "./dist/definitions/index.d.ts",
|
|
21
21
|
"exports": {
|
|
22
22
|
"./package.json": "./package.json",
|
|
23
23
|
".": {
|
|
24
24
|
"types": "./dist/definitions/index.d.ts",
|
|
25
25
|
"node": {
|
|
26
|
-
"import": "./dist/index-
|
|
26
|
+
"import": "./dist/index-node.mjs"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
},
|
|
@@ -35,39 +35,41 @@
|
|
|
35
35
|
"build": "yarn clean:build && rollup --config rollup.config.mjs && yarn run build:definitions",
|
|
36
36
|
"build:definitions": "tsc -p tsconfig.json",
|
|
37
37
|
"clean": "yarn clean:build",
|
|
38
|
-
"clean:build": "pob-
|
|
38
|
+
"clean:build": "pob-esbuild-clean-out dist",
|
|
39
39
|
"lint": "yarn run lint:eslint",
|
|
40
|
-
"lint:eslint": "yarn ../.. run eslint --
|
|
40
|
+
"lint:eslint": "yarn ../.. run eslint --quiet packages/alp-migrations",
|
|
41
41
|
"watch": "yarn clean:build && rollup --config rollup.config.mjs --watch"
|
|
42
42
|
},
|
|
43
43
|
"pob": {
|
|
44
|
-
"
|
|
44
|
+
"bundler": "rollup-esbuild",
|
|
45
|
+
"entries": [
|
|
46
|
+
"index"
|
|
47
|
+
],
|
|
48
|
+
"envs": [
|
|
45
49
|
{
|
|
46
50
|
"target": "node",
|
|
47
|
-
"version": "
|
|
51
|
+
"version": "22",
|
|
52
|
+
"omitVersionInFileName": true
|
|
48
53
|
}
|
|
49
54
|
],
|
|
50
|
-
"
|
|
51
|
-
"index"
|
|
52
|
-
]
|
|
55
|
+
"typescript": true
|
|
53
56
|
},
|
|
54
57
|
"prettier": "@pob/root/prettier-config",
|
|
55
58
|
"peerDependencies": {
|
|
56
|
-
"liwi-mongo": "^
|
|
57
|
-
"router-segments": "^
|
|
59
|
+
"liwi-mongo": "^12.0.0",
|
|
60
|
+
"router-segments": "^11.0.0"
|
|
58
61
|
},
|
|
59
62
|
"dependencies": {
|
|
60
|
-
"alp-node": "
|
|
61
|
-
"nightingale-logger": "^
|
|
63
|
+
"alp-node": "9.0.0",
|
|
64
|
+
"nightingale-logger": "^16.0.0",
|
|
62
65
|
"semver": "^7.3.5"
|
|
63
66
|
},
|
|
64
67
|
"devDependencies": {
|
|
65
|
-
"@
|
|
66
|
-
"@types/node": "
|
|
67
|
-
"@types/semver": "7.
|
|
68
|
-
"liwi-mongo": "
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"typescript": "5.3.3"
|
|
68
|
+
"@pob/rollup-esbuild": "6.7.0",
|
|
69
|
+
"@types/node": "24.3.0",
|
|
70
|
+
"@types/semver": "7.7.0",
|
|
71
|
+
"liwi-mongo": "12.0.0",
|
|
72
|
+
"router-segments": "11.0.0",
|
|
73
|
+
"typescript": "5.9.2"
|
|
72
74
|
}
|
|
73
75
|
}
|
package/src/Manager.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/* eslint-disable unicorn/no-process-exit */
|
|
2
|
-
import type AlpNodeApp from
|
|
3
|
-
import { Logger } from
|
|
4
|
-
import semver from
|
|
5
|
-
import type MigrationsManager from
|
|
6
|
-
import type { CallbackParam } from
|
|
7
|
-
import readRecursiveDirectory from
|
|
2
|
+
import type AlpNodeApp from "alp-node";
|
|
3
|
+
import { Logger } from "nightingale-logger";
|
|
4
|
+
import semver from "semver";
|
|
5
|
+
import type MigrationsManager from "./Manager";
|
|
6
|
+
import type { CallbackParam } from "./readRecursiveDirectory";
|
|
7
|
+
import readRecursiveDirectory from "./readRecursiveDirectory";
|
|
8
8
|
|
|
9
|
-
const logger = new Logger(
|
|
9
|
+
const logger = new Logger("alp:migrations");
|
|
10
10
|
|
|
11
|
-
export { default as MigrationsManager } from
|
|
11
|
+
export { default as MigrationsManager } from "./Manager";
|
|
12
12
|
|
|
13
13
|
export interface Options {
|
|
14
14
|
app: AlpNodeApp;
|
|
15
15
|
migrationsManager: MigrationsManager;
|
|
16
|
-
config?: AlpNodeApp[
|
|
16
|
+
config?: AlpNodeApp["config"];
|
|
17
17
|
dirname?: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -24,26 +24,27 @@ export default async function migrate({
|
|
|
24
24
|
dirname = `${app.dirname}/migrations`,
|
|
25
25
|
}: Options): Promise<void> {
|
|
26
26
|
const unhandledRejectionHandler = (reason: unknown): void => {
|
|
27
|
-
logger.error(
|
|
27
|
+
logger.error("unhandledRejection", { err: reason });
|
|
28
|
+
|
|
28
29
|
process.exit(1);
|
|
29
30
|
};
|
|
30
|
-
process.on(
|
|
31
|
+
process.on("unhandledRejection", unhandledRejectionHandler);
|
|
31
32
|
|
|
32
33
|
const packageVersion = config.packageConfig.version as string;
|
|
33
34
|
const currentVersion = await migrationsManager.findLastVersion();
|
|
34
35
|
|
|
35
36
|
let migrations: { version: string; fileName: string }[] = [];
|
|
36
37
|
|
|
37
|
-
logger.info(
|
|
38
|
+
logger.info("migrate", { packageVersion, currentVersion });
|
|
38
39
|
|
|
39
40
|
await readRecursiveDirectory(dirname, (res: CallbackParam) => {
|
|
40
41
|
const fileName = res.path.slice(dirname.length + 1);
|
|
41
42
|
|
|
42
|
-
if (!fileName.endsWith(
|
|
43
|
+
if (!fileName.endsWith(".js")) {
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
const versionExecResult = /([\d.]+)(_.*|\.js)$/.exec(fileName);
|
|
47
|
+
const versionExecResult = /([\d.]+)(?:_.*|\.js)$/.exec(fileName);
|
|
47
48
|
|
|
48
49
|
if (!versionExecResult?.[1]) {
|
|
49
50
|
return;
|
|
@@ -85,5 +86,5 @@ export default async function migrate({
|
|
|
85
86
|
process.exit(1);
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
process.removeListener(
|
|
89
|
+
process.removeListener("unhandledRejection", unhandledRejectionHandler);
|
|
89
90
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Stats } from
|
|
2
|
-
import {
|
|
1
|
+
import type { Stats } from "node:fs";
|
|
2
|
+
import { stat as fsStat, readdir } from "node:fs/promises";
|
|
3
3
|
|
|
4
4
|
export interface CallbackParam {
|
|
5
5
|
filename: string;
|
|
@@ -19,7 +19,7 @@ export default async function readRecursiveDirectory(
|
|
|
19
19
|
const path = `${directory}/${file}`;
|
|
20
20
|
const stat = await fsStat(path);
|
|
21
21
|
|
|
22
|
-
if (stat
|
|
22
|
+
if (stat.isDirectory()) {
|
|
23
23
|
await readRecursiveDirectory(path, callback);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-node18.mjs","sources":["../src/readRecursiveDirectory.ts","../src/Manager.ts","../src/index.ts"],"sourcesContent":["import type { Stats } from 'node:fs';\nimport { readdir, stat as fsStat } from 'node:fs/promises';\n\nexport interface CallbackParam {\n filename: string;\n basedir: string;\n path: string;\n stat: Stats;\n}\n\nexport default async function readRecursiveDirectory(\n directory: string,\n callback: (param: CallbackParam) => Promise<void> | void,\n): Promise<void> {\n const files = await readdir(directory);\n\n await Promise.all(\n files.map(async (file): Promise<void> => {\n const path = `${directory}/${file}`;\n const stat = await fsStat(path);\n\n if (stat?.isDirectory()) {\n await readRecursiveDirectory(path, callback);\n return;\n }\n await callback({\n filename: file,\n basedir: directory,\n path,\n stat,\n });\n }),\n );\n}\n","import type { MongoStore, MongoInsertType, MongoBaseModel } from 'liwi-mongo';\n\nexport interface Migration extends MongoBaseModel {\n version: string;\n fileName: string;\n}\n\nexport default class MigrationsManager {\n store: MongoStore<Migration>;\n\n constructor(store: MongoStore<Migration>) {\n this.store = store;\n }\n\n findLastVersion(): Promise<string | undefined> {\n return this.store.findOne({}, { created: -1 }).then((row) => row?.version);\n }\n\n addMigrationDone(migration: MongoInsertType<Migration>): Promise<Migration> {\n return this.store.insertOne(migration);\n }\n}\n","/* eslint-disable unicorn/no-process-exit */\nimport type AlpNodeApp from 'alp-node';\nimport { Logger } from 'nightingale-logger';\nimport semver from 'semver';\nimport type MigrationsManager from './Manager';\nimport type { CallbackParam } from './readRecursiveDirectory';\nimport readRecursiveDirectory from './readRecursiveDirectory';\n\nconst logger = new Logger('alp:migrations');\n\nexport { default as MigrationsManager } from './Manager';\n\nexport interface Options {\n app: AlpNodeApp;\n migrationsManager: MigrationsManager;\n config?: AlpNodeApp['config'];\n dirname?: string;\n}\n\nexport default async function migrate({\n app,\n migrationsManager,\n config = app.config,\n dirname = `${app.dirname}/migrations`,\n}: Options): Promise<void> {\n const unhandledRejectionHandler = (reason: unknown): void => {\n logger.error('unhandledRejection', { err: reason });\n process.exit(1);\n };\n process.on('unhandledRejection', unhandledRejectionHandler);\n\n const packageVersion = config.packageConfig.version as string;\n const currentVersion = await migrationsManager.findLastVersion();\n\n let migrations: { version: string; fileName: string }[] = [];\n\n logger.info('migrate', { packageVersion, currentVersion });\n\n await readRecursiveDirectory(dirname, (res: CallbackParam) => {\n const fileName = res.path.slice(dirname.length + 1);\n\n if (!fileName.endsWith('.js')) {\n return;\n }\n\n const versionExecResult = /([\\d.]+)(_.*|\\.js)$/.exec(fileName);\n\n if (!versionExecResult?.[1]) {\n return;\n }\n\n const version: string = versionExecResult[1];\n\n if (currentVersion && semver.lte(version, currentVersion)) return;\n\n migrations.push({ version, fileName });\n });\n\n migrations = migrations.sort((a, b) =>\n semver.gt(a.version, b.version) ? 1 : -1,\n );\n\n try {\n for (const migration of migrations) {\n logger.info(`Migration to ${migration.fileName}`);\n try {\n const migrateFn: unknown = await import(\n `${dirname}/${migration.fileName}`\n );\n await (migrateFn as () => Promise<void>)();\n } catch (error) {\n logger.error(`Migration to ${migration.version} Failed !`);\n throw error;\n }\n\n logger.success(`Migration to ${migration.fileName} done !`);\n\n // only add to db if migration version <= package version\n if (semver.lte(migration.version, packageVersion)) {\n await migrationsManager.addMigrationDone(migration);\n }\n }\n } catch (error: any) {\n logger.error(error as Error);\n process.exit(1);\n }\n\n process.removeListener('unhandledRejection', unhandledRejectionHandler);\n}\n"],"names":["readRecursiveDirectory","directory","callback","files","readdir","Promise","all","map","file","path","stat","fsStat","isDirectory","filename","basedir","MigrationsManager","constructor","store","findLastVersion","findOne","created","then","row","version","addMigrationDone","migration","insertOne","logger","Logger","migrate","app","migrationsManager","config","dirname","unhandledRejectionHandler","reason","error","err","process","exit","on","packageVersion","packageConfig","currentVersion","migrations","info","res","fileName","slice","length","endsWith","versionExecResult","exec","semver","lte","push","sort","a","b","gt","migrateFn","success","removeListener"],"mappings":";;;;AAUe,eAAeA,sBAAsBA,CAClDC,SAAiB,EACjBC,QAAwD,EACzC;AACf,EAAA,MAAMC,KAAK,GAAG,MAAMC,OAAO,CAACH,SAAS,CAAC,CAAA;EAEtC,MAAMI,OAAO,CAACC,GAAG,CACfH,KAAK,CAACI,GAAG,CAAC,MAAOC,IAAI,IAAoB;AACvC,IAAA,MAAMC,IAAI,GAAI,CAAA,EAAER,SAAU,CAAA,CAAA,EAAGO,IAAK,CAAC,CAAA,CAAA;AACnC,IAAA,MAAME,MAAI,GAAG,MAAMC,IAAM,CAACF,IAAI,CAAC,CAAA;AAE/B,IAAA,IAAIC,MAAI,EAAEE,WAAW,EAAE,EAAE;AACvB,MAAA,MAAMZ,sBAAsB,CAACS,IAAI,EAAEP,QAAQ,CAAC,CAAA;AAC5C,MAAA,OAAA;AACF,KAAA;AACA,IAAA,MAAMA,QAAQ,CAA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AE;MAClCjB,MAAM,CAACkB,IAAI,CAAE,CAAA,aAAA,EAAepB,SAAS,CAACsB,QAAS,EAAC,CAAC,CAAA;MACjD,IAAI;AACF,QAAA,MAAMa,SAAkB,GAAG,MAAM,OAC9B,CAAA,EAAE3B,OAAQ,CAAA,CAAA,EAAGR,SAAS,CAACsB,QAAS,CAAA,CACnC,CAAC,CAAA;QACD,MAAOa,SAAS,EAA0B,CAAA;OAC3C,CAAC,OAAOxB,KAAK,EAAE;QACdT,MAAM,CAACS,KAAK,CAAE,CAAA,aAAA,EAAeX,SAAS,CAACF,OAAQ,WAAU,CAAC,CAAA;AAC1D,QAAA,MAAMa,KAAK,CAAA;AACb,OAAA;MAEAT,MAAM,CAACkC,OAAO,CAAE,CAAA,aAAA,EAAepC,SAAS,CAACsB,QAAS,SAAQ,CAAC,CAAA;;AAE3D;MACA,IAAIM,MAAM,CAACC,GAAG,CAAC7B,SAAS,CAACF,OAAO,EAAEkB,cAAc,CAAC,EAAE;AACjD,QAAA,MAAMV,iBAAiB,CAACP,gBAAgB,CAACC,SAAS,CAAC,CAAA;AACrD,OAAA;AACF,KAAA;GACD,CAAC,OAAOW,KAAU,EAAE;AACnBT,IAAAA,MAAM,CAACS,KAAK,CAACA,KAAc,CAAC,CAAA;AAC5BE,IAAAA,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,GAAA;AAEAD,EAAAA,OAAO,CAACwB,cAAc,CAAC,oBAAoB,EAAE5B,yBAAyB,CAAC,CAAA;AACzE;;;;"}
|
package/src/.eslintrc.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"parser": "@typescript-eslint/parser",
|
|
4
|
-
"parserOptions": {
|
|
5
|
-
"EXPERIMENTAL_useProjectService": true,
|
|
6
|
-
"project": "packages/alp-migrations/tsconfig.json"
|
|
7
|
-
},
|
|
8
|
-
"plugins": ["@typescript-eslint"],
|
|
9
|
-
"extends": [
|
|
10
|
-
"@pob/eslint-config-typescript",
|
|
11
|
-
"@pob/eslint-config-typescript/node"
|
|
12
|
-
],
|
|
13
|
-
"ignorePatterns": ["*.d.ts"],
|
|
14
|
-
"overrides": [
|
|
15
|
-
{
|
|
16
|
-
"files": ["**/*.test.ts", "__tests__/**/*.ts"],
|
|
17
|
-
"extends": ["@pob/eslint-config-typescript/test"],
|
|
18
|
-
"env": {
|
|
19
|
-
"jest": true
|
|
20
|
-
},
|
|
21
|
-
"rules": {
|
|
22
|
-
"import/no-extraneous-dependencies": [
|
|
23
|
-
"error",
|
|
24
|
-
{
|
|
25
|
-
"devDependencies": true
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
}
|