@gefyra/diffyr6-cli 1.0.0 → 1.0.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 -21
- package/README.md +447 -447
- package/config/README.md +27 -27
- package/config/default-rules.json +135 -135
- package/config/resources-r4-not-in-r6.json +42 -42
- package/package.json +54 -54
- package/src/cli.js +92 -92
- package/src/compare-profiles.js +386 -386
- package/src/config.js +147 -147
- package/src/generate-fsh.js +457 -457
- package/src/index.js +394 -394
- package/src/rules-engine.js +642 -642
- package/src/upgrade-sushi.js +553 -553
- package/src/utils/fs.js +38 -38
- package/src/utils/html.js +28 -28
- package/src/utils/process.js +101 -101
- package/src/utils/removed-resources.js +135 -135
- package/src/utils/sushi-log.js +46 -46
- package/src/utils/validator.js +103 -103
package/src/cli.js
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { runMigration } from './index.js';
|
|
4
|
-
import { loadConfig, createExampleConfig } from './config.js';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
7
|
-
|
|
8
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
-
const __dirname = path.dirname(__filename);
|
|
10
|
-
|
|
11
|
-
async function main() {
|
|
12
|
-
const args = process.argv.slice(2);
|
|
13
|
-
|
|
14
|
-
// Handle --help
|
|
15
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
16
|
-
printHelp();
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Handle --version
|
|
21
|
-
if (args.includes('--version') || args.includes('-v')) {
|
|
22
|
-
const pkg = await import('../package.json', { assert: { type: 'json' } });
|
|
23
|
-
console.log(pkg.default.version);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Handle --init
|
|
28
|
-
if (args.includes('--init')) {
|
|
29
|
-
const outputPath = args[args.indexOf('--init') + 1] || 'migration-config.json';
|
|
30
|
-
await createExampleConfig(outputPath);
|
|
31
|
-
console.log(`✓ Created example config at ${outputPath}`);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Load config
|
|
36
|
-
let configPath = 'migration-config.json';
|
|
37
|
-
const configIndex = args.indexOf('--config');
|
|
38
|
-
if (configIndex !== -1 && args[configIndex + 1]) {
|
|
39
|
-
configPath = args[configIndex + 1];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
console.log('FHIR R4 to R6 Migration Runner');
|
|
43
|
-
console.log('==============================');
|
|
44
|
-
console.log('');
|
|
45
|
-
console.log(`Loading config from: ${configPath}`);
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
const config = await loadConfig(configPath);
|
|
49
|
-
const result = await runMigration(config);
|
|
50
|
-
|
|
51
|
-
if (result.success) {
|
|
52
|
-
process.exit(0);
|
|
53
|
-
} else {
|
|
54
|
-
process.exit(1);
|
|
55
|
-
}
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.error('\n❌ Error:', error.message);
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function printHelp() {
|
|
63
|
-
console.log(`
|
|
64
|
-
FHIR R4 to R6 Migration Runner
|
|
65
|
-
|
|
66
|
-
Usage:
|
|
67
|
-
fhir-r6-migrate [options]
|
|
68
|
-
|
|
69
|
-
Options:
|
|
70
|
-
--config <path> Path to configuration file (default: migration-config.json)
|
|
71
|
-
--init [path] Create an example configuration file
|
|
72
|
-
--version, -v Show version number
|
|
73
|
-
--help, -h Show this help message
|
|
74
|
-
|
|
75
|
-
Examples:
|
|
76
|
-
# Run migration with default config
|
|
77
|
-
fhir-r6-migrate
|
|
78
|
-
|
|
79
|
-
# Run with custom config
|
|
80
|
-
fhir-r6-migrate --config my-config.json
|
|
81
|
-
|
|
82
|
-
# Create example config
|
|
83
|
-
fhir-r6-migrate --init
|
|
84
|
-
|
|
85
|
-
Configuration:
|
|
86
|
-
See README.md for detailed configuration options and examples.
|
|
87
|
-
`);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
main().catch(error => {
|
|
91
|
-
console.error('Fatal error:', error);
|
|
92
|
-
process.exit(1);
|
|
93
|
-
});
|
|
2
|
+
|
|
3
|
+
import { runMigration } from './index.js';
|
|
4
|
+
import { loadConfig, createExampleConfig } from './config.js';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
|
|
11
|
+
async function main() {
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
|
|
14
|
+
// Handle --help
|
|
15
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
16
|
+
printHelp();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Handle --version
|
|
21
|
+
if (args.includes('--version') || args.includes('-v')) {
|
|
22
|
+
const pkg = await import('../package.json', { assert: { type: 'json' } });
|
|
23
|
+
console.log(pkg.default.version);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Handle --init
|
|
28
|
+
if (args.includes('--init')) {
|
|
29
|
+
const outputPath = args[args.indexOf('--init') + 1] || 'migration-config.json';
|
|
30
|
+
await createExampleConfig(outputPath);
|
|
31
|
+
console.log(`✓ Created example config at ${outputPath}`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Load config
|
|
36
|
+
let configPath = 'migration-config.json';
|
|
37
|
+
const configIndex = args.indexOf('--config');
|
|
38
|
+
if (configIndex !== -1 && args[configIndex + 1]) {
|
|
39
|
+
configPath = args[configIndex + 1];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log('FHIR R4 to R6 Migration Runner');
|
|
43
|
+
console.log('==============================');
|
|
44
|
+
console.log('');
|
|
45
|
+
console.log(`Loading config from: ${configPath}`);
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const config = await loadConfig(configPath);
|
|
49
|
+
const result = await runMigration(config);
|
|
50
|
+
|
|
51
|
+
if (result.success) {
|
|
52
|
+
process.exit(0);
|
|
53
|
+
} else {
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error('\n❌ Error:', error.message);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function printHelp() {
|
|
63
|
+
console.log(`
|
|
64
|
+
FHIR R4 to R6 Migration Runner
|
|
65
|
+
|
|
66
|
+
Usage:
|
|
67
|
+
fhir-r6-migrate [options]
|
|
68
|
+
|
|
69
|
+
Options:
|
|
70
|
+
--config <path> Path to configuration file (default: migration-config.json)
|
|
71
|
+
--init [path] Create an example configuration file
|
|
72
|
+
--version, -v Show version number
|
|
73
|
+
--help, -h Show this help message
|
|
74
|
+
|
|
75
|
+
Examples:
|
|
76
|
+
# Run migration with default config
|
|
77
|
+
fhir-r6-migrate
|
|
78
|
+
|
|
79
|
+
# Run with custom config
|
|
80
|
+
fhir-r6-migrate --config my-config.json
|
|
81
|
+
|
|
82
|
+
# Create example config
|
|
83
|
+
fhir-r6-migrate --init
|
|
84
|
+
|
|
85
|
+
Configuration:
|
|
86
|
+
See README.md for detailed configuration options and examples.
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
main().catch(error => {
|
|
91
|
+
console.error('Fatal error:', error);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
});
|