@ductape/cli 0.6.1 → 0.6.2
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/dist/index.js +90 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { runUiAdd, runUiCheck, runUiCreate, runUiDeprecate, runUiInspect, runUiInstall, runUiList, runUiPack, runUiPublish, runUiRemove, runUiUndeprecate, runUiUpdate, runUiValidate, runUiVerify } from './commands/ui.js';
|
|
2
3
|
import { Command } from 'commander';
|
|
3
4
|
import { readFileSync } from 'node:fs';
|
|
4
5
|
import { fileURLToPath } from 'node:url';
|
|
@@ -1078,6 +1079,95 @@ db
|
|
|
1078
1079
|
throw new Error('Specify a verb: connect | query');
|
|
1079
1080
|
return runDb(verb, { file: opts.file, json: opts.json });
|
|
1080
1081
|
}));
|
|
1082
|
+
const ui = program
|
|
1083
|
+
.command('ui')
|
|
1084
|
+
.description('Frontend UI pieces written once in ductape/ui/ and added to any application of the workspace, which compiles them with its own bundler');
|
|
1085
|
+
ui
|
|
1086
|
+
.command('create <name>')
|
|
1087
|
+
.description('Write a new UI piece under ductape/ui/<name>: manifest, component, styles and README')
|
|
1088
|
+
.option('--framework <framework>', 'react, vue or javascript (plain DOM code any application can use)', 'react')
|
|
1089
|
+
.option('--description <text>', 'One line saying what it is for')
|
|
1090
|
+
.option('--json', 'JSON output')
|
|
1091
|
+
.action(wrap((name, opts) => runUiCreate(name, opts)));
|
|
1092
|
+
ui
|
|
1093
|
+
.command('validate [name]')
|
|
1094
|
+
.description('Check a UI piece (or all of them): manifest, published files, imports, secrets. Offline; changes nothing')
|
|
1095
|
+
.option('--typecheck', 'Also type-check it with this project\'s TypeScript, React and Ductape SDK types')
|
|
1096
|
+
.option('--json', 'JSON output')
|
|
1097
|
+
.action(wrap((name, opts) => runUiValidate(name, { typecheck: Boolean(opts.typecheck), json: Boolean(opts.json) })));
|
|
1098
|
+
ui
|
|
1099
|
+
.command('pack <name>')
|
|
1100
|
+
.description('Validate, then write the publishable artifact with its integrity hash. Offline')
|
|
1101
|
+
.option('--out <file>', 'Where to write it (default ductape/.ui-packs/<name>@<version>.json)')
|
|
1102
|
+
.option('--json', 'JSON output')
|
|
1103
|
+
.action(wrap((name, opts) => runUiPack(name, { out: opts.out, json: Boolean(opts.json) })));
|
|
1104
|
+
ui
|
|
1105
|
+
.command('publish <name>')
|
|
1106
|
+
.description('Validate and pack ductape/ui/<name>, then publish it to this workspace. Published versions never change')
|
|
1107
|
+
.option('--typecheck', 'Type-check before publishing')
|
|
1108
|
+
.option('--dry-run', 'Validate and pack, and say what would be published, without publishing')
|
|
1109
|
+
.option('--json', 'JSON output')
|
|
1110
|
+
.action(wrap((name, opts) => runUiPublish(name, { typecheck: Boolean(opts.typecheck), dryRun: Boolean(opts.dryRun), json: Boolean(opts.json) })));
|
|
1111
|
+
ui
|
|
1112
|
+
.command('list')
|
|
1113
|
+
.description('The UI pieces published in this workspace, with their latest release')
|
|
1114
|
+
.option('--search <text>', 'Only pieces whose name or description contains this')
|
|
1115
|
+
.option('--json', 'JSON output')
|
|
1116
|
+
.action(wrap((opts) => runUiList({ search: opts.search, json: Boolean(opts.json) })));
|
|
1117
|
+
ui
|
|
1118
|
+
.command('inspect <ref>')
|
|
1119
|
+
.description('A piece\'s versions (name), or one version\'s manifest, requirements and files (name@version or name@latest)')
|
|
1120
|
+
.option('--json', 'JSON output')
|
|
1121
|
+
.action(wrap((ref, opts) => runUiInspect(ref, { json: Boolean(opts.json) })));
|
|
1122
|
+
ui
|
|
1123
|
+
.command('deprecate <ref>')
|
|
1124
|
+
.description('Mark name@version deprecated. It stays installable by exact version; latest stops choosing it')
|
|
1125
|
+
.requiredOption('--reason <text>', 'Why, shown to anyone who installs it')
|
|
1126
|
+
.option('--replacement <version>', 'The version to use instead')
|
|
1127
|
+
.option('--json', 'JSON output')
|
|
1128
|
+
.action(wrap((ref, opts) => runUiDeprecate(ref, { reason: opts.reason, replacement: opts.replacement, json: Boolean(opts.json) })));
|
|
1129
|
+
ui
|
|
1130
|
+
.command('undeprecate <ref>')
|
|
1131
|
+
.description('Clear the deprecation of name@version')
|
|
1132
|
+
.option('--json', 'JSON output')
|
|
1133
|
+
.action(wrap((ref, opts) => runUiUndeprecate(ref, { json: Boolean(opts.json) })));
|
|
1134
|
+
ui
|
|
1135
|
+
.command('add <ref>')
|
|
1136
|
+
.description('Add a published piece (name, name@version or name@latest) to this application: its verified source goes in ductape/ui/installed/, pinned in ductape/ui.lock.json, importable as #ui/<name>')
|
|
1137
|
+
.option('--ignore-peers', 'Add it even when the packages it needs are missing or the wrong version')
|
|
1138
|
+
.option('--json', 'JSON output')
|
|
1139
|
+
.action(wrap((ref, opts) => runUiAdd(ref, { ignorePeers: Boolean(opts.ignorePeers), json: Boolean(opts.json) })));
|
|
1140
|
+
ui
|
|
1141
|
+
.command('install')
|
|
1142
|
+
.description('Make ductape/ui/installed/ and package.json match ductape/ui.lock.json, fetching exactly the pinned artifacts where files are missing or changed')
|
|
1143
|
+
.option('--offline', 'Fetch nothing; fail if anything would need fetching')
|
|
1144
|
+
.option('--json', 'JSON output')
|
|
1145
|
+
.action(wrap((opts) => runUiInstall({ offline: Boolean(opts.offline), json: Boolean(opts.json) })));
|
|
1146
|
+
ui
|
|
1147
|
+
.command('update <name>')
|
|
1148
|
+
.description('Move an added piece to its latest release, or to --to <version>')
|
|
1149
|
+
.option('--to <version>', 'Exact version to move to')
|
|
1150
|
+
.option('--ignore-peers', 'Update even when the packages it needs are missing or the wrong version')
|
|
1151
|
+
.option('--json', 'JSON output')
|
|
1152
|
+
.action(wrap((name, opts) => runUiUpdate(name, { to: opts.to, ignorePeers: Boolean(opts.ignorePeers), json: Boolean(opts.json) })));
|
|
1153
|
+
ui
|
|
1154
|
+
.command('remove <name>')
|
|
1155
|
+
.description('Remove an added piece, and any piece it used that nothing else uses')
|
|
1156
|
+
.option('--json', 'JSON output')
|
|
1157
|
+
.action(wrap((name, opts) => runUiRemove(name, { json: Boolean(opts.json) })));
|
|
1158
|
+
ui
|
|
1159
|
+
.command('verify')
|
|
1160
|
+
.description('Offline check for CI: installed pieces are exactly the pinned artifacts, package.json imports them, and the packages they need are installed')
|
|
1161
|
+
.option('--skip-peers', 'Do not check the packages the pieces need')
|
|
1162
|
+
.option('--json', 'JSON output')
|
|
1163
|
+
.action(wrap((opts) => runUiVerify({ skipPeers: Boolean(opts.skipPeers), json: Boolean(opts.json) })));
|
|
1164
|
+
ui
|
|
1165
|
+
.command('check [name]')
|
|
1166
|
+
.description('Online: does the product have the actions, features and sessions the added pieces need? Uses the linked product and environment unless given')
|
|
1167
|
+
.option('--product <tag>', 'Product tag')
|
|
1168
|
+
.option('--env <slug>', 'Environment slug')
|
|
1169
|
+
.option('--json', 'JSON output')
|
|
1170
|
+
.action(wrap((name, opts) => runUiCheck(name, { product: opts.product, env: opts.env, json: Boolean(opts.json) })));
|
|
1081
1171
|
const features = program.command('features').description('Code-first Ductape Features (ductape/features/)');
|
|
1082
1172
|
const sessions = program.command('sessions').description('Session lifecycle and propagation checks');
|
|
1083
1173
|
sessions
|
package/package.json
CHANGED