@kurdel/pirx 0.1.0-beta.1
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/LICENSE +21 -0
- package/README.md +29 -0
- package/lib/commands/index.d.ts +14 -0
- package/lib/commands/index.js +13 -0
- package/lib/commands/index.js.map +1 -0
- package/lib/commands/migrate.d.ts +8 -0
- package/lib/commands/migrate.js +26 -0
- package/lib/commands/migrate.js.map +1 -0
- package/lib/components/checkmark.d.ts +7 -0
- package/lib/components/checkmark.js +13 -0
- package/lib/components/checkmark.js.map +1 -0
- package/lib/components/checkmarked-line.d.ts +10 -0
- package/lib/components/checkmarked-line.js +10 -0
- package/lib/components/checkmarked-line.js.map +1 -0
- package/lib/components/migrate-refresh.d.ts +7 -0
- package/lib/components/migrate-refresh.js +15 -0
- package/lib/components/migrate-refresh.js.map +1 -0
- package/lib/components/migrate-rollback.d.ts +7 -0
- package/lib/components/migrate-rollback.js +13 -0
- package/lib/components/migrate-rollback.js.map +1 -0
- package/lib/components/migrate-run.d.ts +7 -0
- package/lib/components/migrate-run.js +13 -0
- package/lib/components/migrate-run.js.map +1 -0
- package/lib/components/migration-list.d.ts +7 -0
- package/lib/components/migration-list.js +6 -0
- package/lib/components/migration-list.js.map +1 -0
- package/lib/hooks/use-migrate-refresh.d.ts +3 -0
- package/lib/hooks/use-migrate-refresh.js +63 -0
- package/lib/hooks/use-migrate-refresh.js.map +1 -0
- package/lib/hooks/use-migrate-rollback.d.ts +3 -0
- package/lib/hooks/use-migrate-rollback.js +43 -0
- package/lib/hooks/use-migrate-rollback.js.map +1 -0
- package/lib/hooks/use-migrate-run.d.ts +3 -0
- package/lib/hooks/use-migrate-run.js +43 -0
- package/lib/hooks/use-migrate-run.js.map +1 -0
- package/lib/hooks/use-migration-list.d.ts +7 -0
- package/lib/hooks/use-migration-list.js +9 -0
- package/lib/hooks/use-migration-list.js.map +1 -0
- package/lib/hooks/use-migration-manager.d.ts +2 -0
- package/lib/hooks/use-migration-manager.js +12 -0
- package/lib/hooks/use-migration-manager.js.map +1 -0
- package/lib/pirx.d.ts +2 -0
- package/lib/pirx.js +7 -0
- package/lib/pirx.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Andrii Sorokin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @kurdel/pirx
|
|
2
|
+
|
|
3
|
+
Command-line tooling for Kurdel applications. The current beta provides
|
|
4
|
+
interactive database migration commands backed by `@kurdel/migrations`.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install --save-dev @kurdel/pirx@beta
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx pirx migrate run
|
|
16
|
+
npx pirx migrate rollback
|
|
17
|
+
npx pirx migrate refresh
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The commands use the database and migration configuration of the current
|
|
21
|
+
Kurdel application.
|
|
22
|
+
|
|
23
|
+
## Requirements
|
|
24
|
+
|
|
25
|
+
Node.js 20.19+, 22.12+, or 24+.
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
MIT © Andrii Sorokin
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import zod from 'zod';
|
|
3
|
+
export declare const options: zod.ZodObject<{
|
|
4
|
+
name: zod.ZodString;
|
|
5
|
+
}, "strip", zod.ZodTypeAny, {
|
|
6
|
+
name: string;
|
|
7
|
+
}, {
|
|
8
|
+
name: string;
|
|
9
|
+
}>;
|
|
10
|
+
type Props = {
|
|
11
|
+
options: zod.infer<typeof options>;
|
|
12
|
+
};
|
|
13
|
+
export default function Index({ options }: Props): React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'ink';
|
|
3
|
+
import zod from 'zod';
|
|
4
|
+
export const options = zod.object({
|
|
5
|
+
name: zod.string().describe('Your name'),
|
|
6
|
+
});
|
|
7
|
+
export default function Index({ options }) {
|
|
8
|
+
return React.createElement(Text, null,
|
|
9
|
+
"Hello, ",
|
|
10
|
+
options.name,
|
|
11
|
+
"!");
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;CACzC,CAAC,CAAC;AAMH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAC,OAAO,EAAQ;IAC5C,OAAO,oBAAC,IAAI;;QAAS,OAAO,CAAC,IAAI;YAAS,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import zod from 'zod';
|
|
3
|
+
export declare const args: zod.ZodTuple<[zod.ZodEnum<["run", "rollback", "refresh"]>], null>;
|
|
4
|
+
type Props = {
|
|
5
|
+
args: zod.infer<typeof args>;
|
|
6
|
+
};
|
|
7
|
+
export default function MigrateCommand({ args: [command] }: Props): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import zod from 'zod';
|
|
3
|
+
import { argument } from 'pastel';
|
|
4
|
+
import { Box, Text } from 'ink';
|
|
5
|
+
import MigrateRun from '../components/migrate-run.js';
|
|
6
|
+
import MigrateRollback from '../components/migrate-rollback.js';
|
|
7
|
+
import MigrateRefresh from '../components/migrate-refresh.js';
|
|
8
|
+
import Checkmark from '../components/checkmark.js';
|
|
9
|
+
import useMigrationManager from '../hooks/use-migration-manager.js';
|
|
10
|
+
export const args = zod.tuple([
|
|
11
|
+
zod.enum(['run', 'rollback', 'refresh']).describe(argument({
|
|
12
|
+
name: 'command',
|
|
13
|
+
description: 'Command name',
|
|
14
|
+
})),
|
|
15
|
+
]);
|
|
16
|
+
export default function MigrateCommand({ args: [command] }) {
|
|
17
|
+
const manager = useMigrationManager();
|
|
18
|
+
return (React.createElement(Box, { flexDirection: "column", paddingLeft: 2 },
|
|
19
|
+
React.createElement(Box, { gap: 1 },
|
|
20
|
+
React.createElement(Checkmark, { done: !!manager }),
|
|
21
|
+
React.createElement(Text, null, "Connecting database")),
|
|
22
|
+
!!manager && command === 'run' && React.createElement(MigrateRun, { manager: manager }),
|
|
23
|
+
!!manager && command === 'rollback' && React.createElement(MigrateRollback, { manager: manager }),
|
|
24
|
+
!!manager && command === 'refresh' && React.createElement(MigrateRefresh, { manager: manager })));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/commands/migrate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,UAAU,MAAM,8BAA8B,CAAC;AACtD,OAAO,eAAe,MAAM,mCAAmC,CAAC;AAChE,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,SAAS,MAAM,4BAA4B,CAAC;AACnD,OAAO,mBAAmB,MAAM,mCAAmC,CAAC;AAEpE,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC;IAC5B,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,CAC/C,QAAQ,CAAC;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,cAAc;KAC5B,CAAC,CACH;CACF,CAAC,CAAC;AAMH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAS;IAC/D,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IAEtC,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC;QACxC,oBAAC,GAAG,IAAC,GAAG,EAAE,CAAC;YACT,oBAAC,SAAS,IAAC,IAAI,EAAE,CAAC,CAAC,OAAO,GAAI;YAC9B,oBAAC,IAAI,8BAA2B,CAC5B;QACL,CAAC,CAAC,OAAO,IAAI,OAAO,KAAK,KAAK,IAAI,oBAAC,UAAU,IAAC,OAAO,EAAE,OAAO,GAAG;QACjE,CAAC,CAAC,OAAO,IAAI,OAAO,KAAK,UAAU,IAAI,oBAAC,eAAe,IAAC,OAAO,EAAE,OAAO,GAAG;QAC3E,CAAC,CAAC,OAAO,IAAI,OAAO,KAAK,SAAS,IAAI,oBAAC,cAAc,IAAC,OAAO,EAAE,OAAO,GAAG,CACtE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
export default function Checkmark({ done, error = false }) {
|
|
5
|
+
if (error) {
|
|
6
|
+
return React.createElement(Text, { color: "red" }, '\u2717');
|
|
7
|
+
}
|
|
8
|
+
if (done) {
|
|
9
|
+
return React.createElement(Text, { color: "green" }, '\u2713');
|
|
10
|
+
}
|
|
11
|
+
return React.createElement(Spinner, null);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=checkmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkmark.js","sourceRoot":"","sources":["../../src/components/checkmark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,OAAO,MAAM,aAAa,CAAC;AAOlC,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,EAAS;IAC9D,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,IAAE,QAAQ,CAAQ,CAAC;IAC7C,CAAC;IACD,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,IAAE,QAAQ,CAAQ,CAAC;IAC/C,CAAC;IACD,OAAO,oBAAC,OAAO,OAAG,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import Checkmark from './checkmark.js';
|
|
4
|
+
export default function CheckmarkedLine(props) {
|
|
5
|
+
const { title, done, error = false, bold = false, color = 'white', } = props;
|
|
6
|
+
return (React.createElement(Box, { gap: 1 },
|
|
7
|
+
React.createElement(Checkmark, { done: done, error: error }),
|
|
8
|
+
React.createElement(Text, { bold: bold, color: color }, title)));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=checkmarked-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkmarked-line.js","sourceRoot":"","sources":["../../src/components/checkmarked-line.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAUvC,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAY;IAClD,MAAM,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,GAAG,KAAK,EACb,IAAI,GAAG,KAAK,EACZ,KAAK,GAAG,OAAO,GAChB,GAAG,KAAK,CAAC;IACV,OAAO,CACL,oBAAC,GAAG,IAAC,GAAG,EAAE,CAAC;QACT,oBAAC,SAAS,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAI;QACvC,oBAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,IAAG,KAAK,CAAQ,CAC1C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import useMigrateRefresh from '../hooks/use-migrate-refresh.js';
|
|
3
|
+
import CheckmarkedLine from './checkmarked-line.js';
|
|
4
|
+
import MigrationList from './migration-list.js';
|
|
5
|
+
export default function MigrateRefresh({ manager }) {
|
|
6
|
+
const [rollbackMigrationList, runMigrationList, done, error,] = useMigrateRefresh(manager);
|
|
7
|
+
return (React.createElement(Fragment, null,
|
|
8
|
+
rollbackMigrationList.length > 0 && (React.createElement(CheckmarkedLine, { done: done, error: runMigrationList.length === 0 && !!error, title: "Rolled back migrations:" })),
|
|
9
|
+
React.createElement(MigrationList, { list: rollbackMigrationList }),
|
|
10
|
+
runMigrationList.length > 0 && (React.createElement(CheckmarkedLine, { done: done, error: !!error, title: "Applying migrations:" })),
|
|
11
|
+
React.createElement(MigrationList, { list: runMigrationList }),
|
|
12
|
+
done && !error && (React.createElement(CheckmarkedLine, { done: done, error: !!error, title: "Completed successfully" })),
|
|
13
|
+
error && (React.createElement(CheckmarkedLine, { title: `Failure with message: ${error}`, done: done, error: !!error }))));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=migrate-refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-refresh.js","sourceRoot":"","sources":["../../src/components/migrate-refresh.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,eAAe,MAAM,uBAAuB,CAAC;AACpD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAIhD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,OAAO,EAAS;IACvD,MAAM,CACJ,qBAAqB,EACrB,gBAAgB,EAChB,IAAI,EACJ,KAAK,EACR,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE7B,OAAO,CACL,oBAAC,QAAQ;QACN,qBAAqB,CAAC,MAAM,GAAG,CAAC,IAAI,CACnC,oBAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,gBAAgB,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAC/C,KAAK,EAAC,yBAAyB,GAC/B,CACH;QACD,oBAAC,aAAa,IAAC,IAAI,EAAE,qBAAqB,GAAI;QAC7C,gBAAgB,CAAC,MAAM,GAAG,CAAC,IAAI,CAC9B,oBAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,KAAK,EAAC,sBAAsB,GAC5B,CACH;QACD,oBAAC,aAAa,IAAC,IAAI,EAAE,gBAAgB,GAAI;QACxC,IAAI,IAAI,CAAC,KAAK,IAAI,CACjB,oBAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,KAAK,EAAC,wBAAwB,GAC9B,CACH;QACA,KAAK,IAAI,CACR,oBAAC,eAAe,IACd,KAAK,EAAE,yBAAyB,KAAK,EAAE,EACvC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,CAAC,KAAK,GACd,CACH,CACQ,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import useMigrateRollback from '../hooks/use-migrate-rollback.js';
|
|
3
|
+
import MigrationList from './migration-list.js';
|
|
4
|
+
import CheckmarkedLine from './checkmarked-line.js';
|
|
5
|
+
export default function MigrateRollback({ manager }) {
|
|
6
|
+
const [migrationList, done, error] = useMigrateRollback(manager);
|
|
7
|
+
return (React.createElement(Fragment, null,
|
|
8
|
+
migrationList.length > 0 && (React.createElement(CheckmarkedLine, { done: done, error: !!error, title: "Rolled back migrations:" })),
|
|
9
|
+
React.createElement(MigrationList, { list: migrationList }),
|
|
10
|
+
done && !error && (React.createElement(CheckmarkedLine, { done: done, error: !!error, title: "Completed successfully" })),
|
|
11
|
+
error && (React.createElement(CheckmarkedLine, { title: `Failure with message: ${error}`, done: done, error: !!error }))));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=migrate-rollback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-rollback.js","sourceRoot":"","sources":["../../src/components/migrate-rollback.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,kBAAkB,MAAM,kCAAkC,CAAC;AAClE,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,eAAe,MAAM,uBAAuB,CAAC;AAIpD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,OAAO,EAAS;IACxD,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAEjE,OAAO,CACL,oBAAC,QAAQ;QACN,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,oBAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,KAAK,EAAC,yBAAyB,GAC/B,CACH;QACD,oBAAC,aAAa,IAAC,IAAI,EAAE,aAAa,GAAI;QACrC,IAAI,IAAI,CAAC,KAAK,IAAI,CACjB,oBAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,KAAK,EAAC,wBAAwB,GAC9B,CACH;QACA,KAAK,IAAI,CACR,oBAAC,eAAe,IACd,KAAK,EAAE,yBAAyB,KAAK,EAAE,EACvC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,CAAC,KAAK,GACd,CACH,CACQ,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
import useMigrateRun from '../hooks/use-migrate-run.js';
|
|
3
|
+
import MigrationList from './migration-list.js';
|
|
4
|
+
import CheckmarkedLine from './checkmarked-line.js';
|
|
5
|
+
export default function MigrateRun({ manager }) {
|
|
6
|
+
const [migrationList, done, error] = useMigrateRun(manager);
|
|
7
|
+
return (React.createElement(Fragment, null,
|
|
8
|
+
migrationList.length > 0 && (React.createElement(CheckmarkedLine, { done: done, error: !!error, title: "Applying migrations:" })),
|
|
9
|
+
React.createElement(MigrationList, { list: migrationList }),
|
|
10
|
+
done && !error && (React.createElement(CheckmarkedLine, { done: done, error: !!error, title: "Completed successfully" })),
|
|
11
|
+
error && (React.createElement(CheckmarkedLine, { title: `Failure with message: ${error}`, done: done, error: !!error }))));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=migrate-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-run.js","sourceRoot":"","sources":["../../src/components/migrate-run.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAChD,OAAO,eAAe,MAAM,uBAAuB,CAAC;AAIpD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,OAAO,EAAS;IACnD,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAE5D,OAAO,CACL,oBAAC,QAAQ;QACN,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,oBAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,KAAK,EAAC,sBAAsB,GAC5B,CACH;QACD,oBAAC,aAAa,IAAC,IAAI,EAAE,aAAa,GAAI;QACrC,IAAI,IAAI,CAAC,KAAK,IAAI,CACjB,oBAAC,eAAe,IACd,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,CAAC,KAAK,EACd,KAAK,EAAC,wBAAwB,GAC9B,CACH;QACA,KAAK,IAAI,CACR,oBAAC,eAAe,IACd,KAAK,EAAE,yBAAyB,KAAK,EAAE,EACvC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,CAAC,KAAK,GACd,CACH,CACQ,CACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export default function MigrationList({ list }) {
|
|
4
|
+
return (React.createElement(Box, { flexDirection: "column", paddingLeft: 2 }, list.map(item => (React.createElement(Text, { color: item.success ? 'grey' : 'red', key: item.name }, item.name)))));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=migration-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-list.js","sourceRoot":"","sources":["../../src/components/migration-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAOhC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,IAAI,EAAS;IACnD,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC,IACvC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAChB,oBAAC,IAAI,IAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,IACvD,IAAI,CAAC,IAAI,CACL,CAAC,CACT,CACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useApp } from 'ink';
|
|
3
|
+
import useMigrationList from './use-migration-list.js';
|
|
4
|
+
export default function useMigrateRefresh(manager) {
|
|
5
|
+
const { exit } = useApp();
|
|
6
|
+
const [done, setDone] = useState(false);
|
|
7
|
+
const [error, setError] = useState();
|
|
8
|
+
const [rollbackList, addRollbackMigration] = useMigrationList();
|
|
9
|
+
const [runList, addRunMigration] = useMigrationList();
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
function pushMigrationDown(migration) {
|
|
12
|
+
addRollbackMigration(true, migration);
|
|
13
|
+
}
|
|
14
|
+
manager.on('down:success', pushMigrationDown);
|
|
15
|
+
return () => {
|
|
16
|
+
manager.off('down:success', pushMigrationDown);
|
|
17
|
+
};
|
|
18
|
+
}, []);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
function pushMigrationUp(migration) {
|
|
21
|
+
addRunMigration(true, migration);
|
|
22
|
+
}
|
|
23
|
+
manager.on('up:success', pushMigrationUp);
|
|
24
|
+
return () => {
|
|
25
|
+
manager.off('up:success', pushMigrationUp);
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
function pushFailureMigrationDown(migration, error) {
|
|
30
|
+
addRollbackMigration(false, migration);
|
|
31
|
+
setError(error);
|
|
32
|
+
}
|
|
33
|
+
manager.on('down:failure', pushFailureMigrationDown);
|
|
34
|
+
return () => {
|
|
35
|
+
manager.off('down:failure', pushFailureMigrationDown);
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
function pushFailureMigrationUp(migration, error) {
|
|
40
|
+
addRunMigration(false, migration);
|
|
41
|
+
setError(error);
|
|
42
|
+
}
|
|
43
|
+
manager.on('up:failure', pushFailureMigrationUp);
|
|
44
|
+
return () => {
|
|
45
|
+
manager.off('up:failure', pushFailureMigrationUp);
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
manager
|
|
50
|
+
.refresh()
|
|
51
|
+
.then(() => {
|
|
52
|
+
setDone(true);
|
|
53
|
+
})
|
|
54
|
+
.catch(error => {
|
|
55
|
+
setError(error);
|
|
56
|
+
})
|
|
57
|
+
.finally(() => {
|
|
58
|
+
manager.close().then(() => exit());
|
|
59
|
+
});
|
|
60
|
+
}, []);
|
|
61
|
+
return [rollbackList, runList, done, error && error.message];
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=use-migrate-refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-migrate-refresh.js","sourceRoot":"","sources":["../../src/hooks/use-migrate-refresh.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useApp } from 'ink';
|
|
3
|
+
import useMigrationList from './use-migration-list.js';
|
|
4
|
+
export default function useMigrateRollback(manager) {
|
|
5
|
+
const { exit } = useApp();
|
|
6
|
+
const [done, setDone] = useState(false);
|
|
7
|
+
const [error, setError] = useState();
|
|
8
|
+
const [list, addMigration] = useMigrationList();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
function pushSuccessMigration(migration) {
|
|
11
|
+
addMigration(true, migration);
|
|
12
|
+
}
|
|
13
|
+
manager.on('down:success', pushSuccessMigration);
|
|
14
|
+
return () => {
|
|
15
|
+
manager.off('down:success', pushSuccessMigration);
|
|
16
|
+
};
|
|
17
|
+
}, []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
function pushFailureMigration(migration, error) {
|
|
20
|
+
addMigration(false, migration);
|
|
21
|
+
setError(error);
|
|
22
|
+
}
|
|
23
|
+
manager.on('down:failure', pushFailureMigration);
|
|
24
|
+
return () => {
|
|
25
|
+
manager.off('down:failure', pushFailureMigration);
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
manager
|
|
30
|
+
.rollback()
|
|
31
|
+
.then(() => {
|
|
32
|
+
setDone(true);
|
|
33
|
+
})
|
|
34
|
+
.catch(error => {
|
|
35
|
+
setError(error);
|
|
36
|
+
})
|
|
37
|
+
.finally(() => {
|
|
38
|
+
manager.close().then(() => exit());
|
|
39
|
+
});
|
|
40
|
+
}, []);
|
|
41
|
+
return [list, done, error && error.message];
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=use-migrate-rollback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-migrate-rollback.js","sourceRoot":"","sources":["../../src/hooks/use-migrate-rollback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,OAAyB;IAEzB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAa,CAAC;IAChD,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,GAAG,gBAAgB,EAAE,CAAC;IAEhD,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,oBAAoB,CAAC,SAAiB;YAC7C,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,CAAC,EAAE,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;QACjD,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;QACpD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,oBAAoB,CAAC,SAAiB,EAAE,KAAgB;YAC/D,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YAC/B,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,EAAE,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;QACjD,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;QACpD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,OAAO;aACJ,QAAQ,EAAE;aACV,IAAI,CAAC,GAAG,EAAE;YACT,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC;aACD,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useApp } from 'ink';
|
|
3
|
+
import useMigrationList from './use-migration-list.js';
|
|
4
|
+
export default function useMigrateRun(manager) {
|
|
5
|
+
const { exit } = useApp();
|
|
6
|
+
const [done, setDone] = useState(false);
|
|
7
|
+
const [error, setError] = useState();
|
|
8
|
+
const [list, addMigration] = useMigrationList();
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
function pushSuccessMigration(migration) {
|
|
11
|
+
addMigration(true, migration);
|
|
12
|
+
}
|
|
13
|
+
manager.on('up:success', pushSuccessMigration);
|
|
14
|
+
return () => {
|
|
15
|
+
manager.off('up:success', pushSuccessMigration);
|
|
16
|
+
};
|
|
17
|
+
}, []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
function pushFailureMigration(migration, error) {
|
|
20
|
+
addMigration(false, migration);
|
|
21
|
+
setError(error);
|
|
22
|
+
}
|
|
23
|
+
manager.on('up:failure', pushFailureMigration);
|
|
24
|
+
return () => {
|
|
25
|
+
manager.off('up:failure', pushFailureMigration);
|
|
26
|
+
};
|
|
27
|
+
}, []);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
manager
|
|
30
|
+
.run()
|
|
31
|
+
.then(() => {
|
|
32
|
+
setDone(true);
|
|
33
|
+
})
|
|
34
|
+
.catch(error => {
|
|
35
|
+
setError(error);
|
|
36
|
+
})
|
|
37
|
+
.finally(() => {
|
|
38
|
+
manager.close().then(() => exit());
|
|
39
|
+
});
|
|
40
|
+
}, []);
|
|
41
|
+
return [list, done, error && error.message];
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=use-migrate-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-migrate-run.js","sourceRoot":"","sources":["../../src/hooks/use-migrate-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,OAAyB;IAC7D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;IAC1B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAa,CAAC;IAChD,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,GAAG,gBAAgB,EAAE,CAAC;IAEhD,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,oBAAoB,CAAC,SAAiB;YAC7C,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;QAC/C,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;QAClD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,oBAAoB,CAAC,SAAiB,EAAE,KAAgB;YAC/D,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YAC/B,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;QAC/C,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;QAClD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;QACb,OAAO;aACJ,GAAG,EAAE;aACL,IAAI,CAAC,GAAG,EAAE;YACT,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC;aACD,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
export default function useMigrationList() {
|
|
3
|
+
const [list, setList] = useState([]);
|
|
4
|
+
function add(success, name) {
|
|
5
|
+
setList(value => [...value, { success, name }]);
|
|
6
|
+
}
|
|
7
|
+
return [list, add];
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=use-migration-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-migration-list.js","sourceRoot":"","sources":["../../src/hooks/use-migration-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASjC,MAAM,CAAC,OAAO,UAAU,gBAAgB;IACtC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAa,EAAE,CAAC,CAAC;IAEjD,SAAS,GAAG,CAAC,OAAgB,EAAE,IAAY;QACzC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { MigrationManager } from '@kurdel/migrations';
|
|
3
|
+
export default function useMigrationManager() {
|
|
4
|
+
const [loader, setLoader] = useState(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
MigrationManager.create().then(ml => {
|
|
7
|
+
setLoader(ml);
|
|
8
|
+
});
|
|
9
|
+
}, []);
|
|
10
|
+
return loader;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=use-migration-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-migration-manager.js","sourceRoot":"","sources":["../../src/hooks/use-migration-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,OAAO,UAAU,mBAAmB;IACzC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA0B,IAAI,CAAC,CAAC;IAEpE,SAAS,CAAC,GAAG,EAAE;QACb,gBAAgB,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YAClC,SAAS,CAAC,EAAE,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/lib/pirx.d.ts
ADDED
package/lib/pirx.js
ADDED
package/lib/pirx.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pirx.js","sourceRoot":"","sources":["../src/pirx.ts"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC,IAAI;CACxB,CAAC,CAAC;AAEH,MAAM,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kurdel/pirx",
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"description": "Command-line tooling for Kurdel applications",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [ "lib" ],
|
|
7
|
+
"bin": {
|
|
8
|
+
"pirx": "./lib/pirx.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"prepack": "npm run build",
|
|
12
|
+
"test": "echo \"No tests yet\"",
|
|
13
|
+
"clean": "rimraf lib types ../../.cache/tsconfig.pirx.build.tsbuildinfo",
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"build:force": "npm run clean && tsc --force"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"kurdel",
|
|
19
|
+
"cli",
|
|
20
|
+
"database",
|
|
21
|
+
"migrations"
|
|
22
|
+
],
|
|
23
|
+
"author": "Andrii Sorokin",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/ignorantic/kurdel.git",
|
|
31
|
+
"directory": "packages/pirx"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/ignorantic/kurdel/tree/main/packages/pirx#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/ignorantic/kurdel/issues"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public",
|
|
39
|
+
"tag": "beta"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@kurdel/migrations": "0.1.0-beta.1",
|
|
43
|
+
"ink": "^4.4.1",
|
|
44
|
+
"ink-spinner": "^5.0.0",
|
|
45
|
+
"pastel": "^2.0.2",
|
|
46
|
+
"react": "^18.2.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@sindresorhus/tsconfig": "^5.0.0",
|
|
50
|
+
"@types/react": "^18.2.39",
|
|
51
|
+
"typescript": "^5.3.2"
|
|
52
|
+
}
|
|
53
|
+
}
|