@researchdatabox/redbox-dev-tools 5.1.0-beta.12568 ā 5.1.0-beta.13939
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/bin/wrapper-webpack.js +1 -11
- package/config/tsconfig.base.json +1 -1
- package/dist/commands/form-config.js +8 -21
- package/package.json +13 -8
- package/templates/hook-archetype/standard/.nvmrc.hbs +1 -1
- package/templates/hook-archetype/standard/support/integration-testing/run-mocha-redbox.sh.hbs +1 -1
package/bin/wrapper-webpack.js
CHANGED
|
@@ -89,17 +89,7 @@ sails = {
|
|
|
89
89
|
config: webpackConfig,
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
|
-
log:
|
|
93
|
-
info: function (msg, data = null) {
|
|
94
|
-
console.info(msg, data);
|
|
95
|
-
},
|
|
96
|
-
warn: function (msg, data = null) {
|
|
97
|
-
console.warn(msg, data);
|
|
98
|
-
},
|
|
99
|
-
error: function (msg, data = null) {
|
|
100
|
-
console.error(msg, data);
|
|
101
|
-
},
|
|
102
|
-
},
|
|
92
|
+
log: require('@researchdatabox/sails-ng-common').consoleLogger,
|
|
103
93
|
};
|
|
104
94
|
async function main() {
|
|
105
95
|
if (!defineWebpackHook) {
|
|
@@ -43,21 +43,8 @@ exports.registerQuestionTreeDiagramCommand = registerQuestionTreeDiagramCommand;
|
|
|
43
43
|
exports.registerMigrateFigshareConfigCommand = registerMigrateFigshareConfigCommand;
|
|
44
44
|
const fs_1 = __importDefault(require("fs"));
|
|
45
45
|
const path = __importStar(require("path"));
|
|
46
|
+
const sails_ng_common_1 = require("@researchdatabox/sails-ng-common");
|
|
46
47
|
const redbox_core_1 = require("@researchdatabox/redbox-core");
|
|
47
|
-
const migrationLogger = {
|
|
48
|
-
silly: (...args) => console.debug(...args),
|
|
49
|
-
verbose: (...args) => console.debug(...args),
|
|
50
|
-
trace: (...args) => console.debug(...args),
|
|
51
|
-
debug: (...args) => console.debug(...args),
|
|
52
|
-
log: (...args) => console.log(...args),
|
|
53
|
-
info: (...args) => console.info(...args),
|
|
54
|
-
warn: (...args) => console.warn(...args),
|
|
55
|
-
error: (...args) => console.error(...args),
|
|
56
|
-
crit: (...args) => console.error(...args),
|
|
57
|
-
fatal: (...args) => console.error(...args),
|
|
58
|
-
silent: () => undefined,
|
|
59
|
-
blank: () => undefined,
|
|
60
|
-
};
|
|
61
48
|
function registerMigrateFormConfigCommand(program) {
|
|
62
49
|
program
|
|
63
50
|
.command('migrate-form-config')
|
|
@@ -72,7 +59,7 @@ function registerMigrateFormConfigCommand(program) {
|
|
|
72
59
|
const outputPath = path.resolve(options.output);
|
|
73
60
|
const outputFormat = options.format || "esm";
|
|
74
61
|
console.log(`\nš ļø Migrating form config to ${outputFormat} format: ${inputPath} -> ${outputPath}\n`);
|
|
75
|
-
const migrateVisitor = new redbox_core_1.MigrationV4ToV5FormConfigVisitor(
|
|
62
|
+
const migrateVisitor = new redbox_core_1.MigrationV4ToV5FormConfigVisitor(sails_ng_common_1.consoleLogger);
|
|
76
63
|
const migrated = await (0, redbox_core_1.migrateFormConfigFile)(migrateVisitor, inputPath, outputFormat);
|
|
77
64
|
if (globalOptions.dryRun) {
|
|
78
65
|
console.log('[dry-run] Migration completed; no file written.');
|
|
@@ -82,7 +69,7 @@ function registerMigrateFormConfigCommand(program) {
|
|
|
82
69
|
fs_1.default.writeFileSync(outputPath, migrated.tsContent, 'utf8');
|
|
83
70
|
console.log(`ā
Wrote migrated form config: ${outputPath}`);
|
|
84
71
|
}
|
|
85
|
-
await (0, redbox_core_1.migrateFormConfigVerify)(migrated.migrated,
|
|
72
|
+
await (0, redbox_core_1.migrateFormConfigVerify)(migrated.migrated, sails_ng_common_1.consoleLogger);
|
|
86
73
|
console.log('\nā
Done!\n');
|
|
87
74
|
}
|
|
88
75
|
catch (error) {
|
|
@@ -105,7 +92,7 @@ function registerMigrateDataClassificationCommand(program) {
|
|
|
105
92
|
const outputPath = path.resolve(options.output);
|
|
106
93
|
const outputFormat = options.format || 'esm';
|
|
107
94
|
console.log(`\nš ļø Migrating data classification to question tree to ${outputFormat} format: ${inputPath} -> ${outputPath}\n`);
|
|
108
|
-
const migrateVisitor = new redbox_core_1.MigrationV4ToV5FormConfigVisitor(
|
|
95
|
+
const migrateVisitor = new redbox_core_1.MigrationV4ToV5FormConfigVisitor(sails_ng_common_1.consoleLogger);
|
|
109
96
|
const migrated = (0, redbox_core_1.migrateDataClassification)(migrateVisitor, inputPath, outputFormat);
|
|
110
97
|
if (globalOptions.dryRun) {
|
|
111
98
|
console.log('[dry-run] Migration completed; no file written.');
|
|
@@ -115,7 +102,7 @@ function registerMigrateDataClassificationCommand(program) {
|
|
|
115
102
|
fs_1.default.writeFileSync(outputPath, migrated.tsContent, 'utf8');
|
|
116
103
|
console.log(`ā
Wrote migrated question tree config: ${outputPath}`);
|
|
117
104
|
}
|
|
118
|
-
await (0, redbox_core_1.migrateFormConfigVerify)(migrated.formConfig,
|
|
105
|
+
await (0, redbox_core_1.migrateFormConfigVerify)(migrated.formConfig, sails_ng_common_1.consoleLogger);
|
|
119
106
|
console.log('\nā
Done!\n');
|
|
120
107
|
}
|
|
121
108
|
catch (error) {
|
|
@@ -143,7 +130,7 @@ function registerClientFormConfigCommand(program) {
|
|
|
143
130
|
const record = options.record ? require(path.resolve(options.record)) : null;
|
|
144
131
|
console.log(`\nš ļø Building client form config from server form config: ${inputPath} -> ${outputPath}\n`);
|
|
145
132
|
const serverFormConfig = require(inputPath).default;
|
|
146
|
-
const clientFormConfig = await (0, redbox_core_1.createClientFormConfig)(serverFormConfig,
|
|
133
|
+
const clientFormConfig = await (0, redbox_core_1.createClientFormConfig)(serverFormConfig, sails_ng_common_1.consoleLogger, formMode, userRoles, undefined, record);
|
|
147
134
|
const tsContent = `import { FormConfigFrame } from '@researchdatabox/sails-ng-common';
|
|
148
135
|
const clientFormConfig: FormConfigFrame = ${JSON.stringify(clientFormConfig, null, 2)};
|
|
149
136
|
export default clientFormConfig;`;
|
|
@@ -155,7 +142,7 @@ export default clientFormConfig;`;
|
|
|
155
142
|
fs_1.default.writeFileSync(outputPath, tsContent, 'utf8');
|
|
156
143
|
console.log(`ā
Wrote client form config: ${outputPath}`);
|
|
157
144
|
}
|
|
158
|
-
await (0, redbox_core_1.migrateFormConfigVerify)(clientFormConfig,
|
|
145
|
+
await (0, redbox_core_1.migrateFormConfigVerify)(clientFormConfig, sails_ng_common_1.consoleLogger);
|
|
159
146
|
console.log('\nā
Done!\n');
|
|
160
147
|
}
|
|
161
148
|
catch (error) {
|
|
@@ -177,7 +164,7 @@ function registerQuestionTreeDiagramCommand(program) {
|
|
|
177
164
|
const outputPath = path.resolve(options.output);
|
|
178
165
|
console.log(`\nš ļø Creating diagram from form config: ${inputPath} -> ${outputPath}\n`);
|
|
179
166
|
const componentConfig = require(inputPath);
|
|
180
|
-
const diagram = await (0, redbox_core_1.createQuestionTreeDiagram)(componentConfig,
|
|
167
|
+
const diagram = await (0, redbox_core_1.createQuestionTreeDiagram)(componentConfig, sails_ng_common_1.consoleLogger);
|
|
181
168
|
if (globalOptions.dryRun) {
|
|
182
169
|
console.log('[dry-run] Built diagram from form config; no file written.');
|
|
183
170
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@researchdatabox/redbox-dev-tools",
|
|
3
|
-
"version": "5.1.0-beta.
|
|
3
|
+
"version": "5.1.0-beta.13939",
|
|
4
4
|
"description": "ReDBox customisation dev tools - shared configuration, generators, and migration tooling",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "index.js",
|
|
@@ -44,24 +44,24 @@
|
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/redbox-mint/redbox-portal/tree/v4.5.1#readme",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@researchdatabox/redbox-core": "5.1.0-beta.
|
|
48
|
-
"@researchdatabox/sails-ng-common": "5.1.0-beta.
|
|
47
|
+
"@researchdatabox/redbox-core": "5.1.0-beta.13939",
|
|
48
|
+
"@researchdatabox/sails-ng-common": "5.1.0-beta.13939",
|
|
49
49
|
"@tsconfig/node24": "24.0.4",
|
|
50
50
|
"@types/chai": "5.2.3",
|
|
51
51
|
"@types/lodash": "4.17.24",
|
|
52
52
|
"@types/mocha": "10.0.10",
|
|
53
53
|
"@types/node": "24.12.4",
|
|
54
|
-
"axios": "1.
|
|
54
|
+
"axios": "1.21.0",
|
|
55
55
|
"chai": "6.2.2",
|
|
56
56
|
"commander": "15.0.0",
|
|
57
|
-
"handlebars": "4.7.
|
|
57
|
+
"handlebars": "4.7.10",
|
|
58
58
|
"lodash": "4.18.1",
|
|
59
59
|
"mocha": "11.7.6",
|
|
60
60
|
"rxjs": "7.8.2",
|
|
61
61
|
"ts-node": "10.9.2",
|
|
62
62
|
"ts-morph": "28.0.0",
|
|
63
63
|
"typescript": "5.9.3",
|
|
64
|
-
"zod": "
|
|
64
|
+
"zod": "4.6.7"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@types/sinon": "21.0.1",
|
|
@@ -75,8 +75,13 @@
|
|
|
75
75
|
"overrides": {
|
|
76
76
|
"diff": "8.0.4",
|
|
77
77
|
"mocha": {
|
|
78
|
-
"serialize-javascript": "7.
|
|
79
|
-
}
|
|
78
|
+
"serialize-javascript": "7.1.3"
|
|
79
|
+
},
|
|
80
|
+
"follow-redirects": "1.16.2",
|
|
81
|
+
"brace-expansion@2": "2.1.7",
|
|
82
|
+
"brace-expansion@5": "5.0.12",
|
|
83
|
+
"glob@>=9 <14": "14.0.3",
|
|
84
|
+
"minimatch@>=7 <11": "11.0.4"
|
|
80
85
|
},
|
|
81
86
|
"publishConfig": {
|
|
82
87
|
"access": "public",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
24
|
|
1
|
+
24.22.1
|
package/templates/hook-archetype/standard/support/integration-testing/run-mocha-redbox.sh.hbs
CHANGED
|
@@ -42,7 +42,7 @@ if [[ ! -x node_modules/.bin/mocha ]] || [[ ! -x node_modules/.bin/nyc ]]; then
|
|
|
42
42
|
fi
|
|
43
43
|
|
|
44
44
|
if [[ ! -f node_modules/redoc/bundles/redoc.standalone.js ]]; then
|
|
45
|
-
npm install --no-save --ignore-scripts --strict-peer-deps redoc@
|
|
45
|
+
npm install --no-save --ignore-scripts --strict-peer-deps redoc@3.0.1
|
|
46
46
|
fi
|
|
47
47
|
|
|
48
48
|
npm run webpack
|