@xano/cli 0.0.89 → 0.0.90
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.
|
@@ -16,6 +16,7 @@ export default class Push extends BaseCommand {
|
|
|
16
16
|
transaction: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
17
|
truncate: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
18
|
workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
exclude: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
filter: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
21
|
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
21
22
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -53,6 +53,12 @@ Push only files matching the glob pattern
|
|
|
53
53
|
`,
|
|
54
54
|
`$ xano workspace push ./my-workspace -f "function/*" -f "table/*"
|
|
55
55
|
Push files matching multiple patterns
|
|
56
|
+
`,
|
|
57
|
+
`$ xano workspace push ./my-workspace -e "table/*"
|
|
58
|
+
Push all files except tables
|
|
59
|
+
`,
|
|
60
|
+
`$ xano workspace push ./my-workspace -f "function/*" -e "**/test*"
|
|
61
|
+
Push functions but exclude test files
|
|
56
62
|
`,
|
|
57
63
|
];
|
|
58
64
|
static flags = {
|
|
@@ -109,6 +115,12 @@ Push files matching multiple patterns
|
|
|
109
115
|
description: 'Workspace ID (optional if set in profile)',
|
|
110
116
|
required: false,
|
|
111
117
|
}),
|
|
118
|
+
exclude: Flags.string({
|
|
119
|
+
char: 'e',
|
|
120
|
+
description: 'Glob pattern to exclude files (e.g. "table/*", "**/test*"). Matched against relative paths from the push directory.',
|
|
121
|
+
multiple: true,
|
|
122
|
+
required: false,
|
|
123
|
+
}),
|
|
112
124
|
filter: Flags.string({
|
|
113
125
|
char: 'f',
|
|
114
126
|
description: 'Glob pattern to filter files (e.g. "**/func*", "table/*.xs"). Matched against relative paths from the push directory.',
|
|
@@ -166,7 +178,7 @@ Push files matching multiple patterns
|
|
|
166
178
|
let files = allFiles;
|
|
167
179
|
// Apply glob filter(s) if specified
|
|
168
180
|
if (flags.filter && flags.filter.length > 0) {
|
|
169
|
-
files =
|
|
181
|
+
files = files.filter((f) => {
|
|
170
182
|
const rel = path.relative(inputDir, f);
|
|
171
183
|
return flags.filter.some((pattern) => minimatch(rel, pattern, { matchBase: true }));
|
|
172
184
|
});
|
|
@@ -174,9 +186,20 @@ Push files matching multiple patterns
|
|
|
174
186
|
this.log(` ${ux.colorize('dim', 'Filter:')} ${flags.filter.map((p) => ux.colorize('cyan', p)).join(', ')}`);
|
|
175
187
|
this.log(` ${ux.colorize('dim', 'Matched:')} ${ux.colorize('bold', String(files.length))} of ${allFiles.length} files`);
|
|
176
188
|
}
|
|
189
|
+
// Apply glob exclude(s) if specified
|
|
190
|
+
if (flags.exclude && flags.exclude.length > 0) {
|
|
191
|
+
const beforeCount = files.length;
|
|
192
|
+
files = files.filter((f) => {
|
|
193
|
+
const rel = path.relative(inputDir, f);
|
|
194
|
+
return !flags.exclude.some((pattern) => minimatch(rel, pattern, { matchBase: true }));
|
|
195
|
+
});
|
|
196
|
+
this.log('');
|
|
197
|
+
this.log(` ${ux.colorize('dim', 'Exclude:')} ${flags.exclude.map((p) => ux.colorize('cyan', p)).join(', ')}`);
|
|
198
|
+
this.log(` ${ux.colorize('dim', 'Kept:')} ${ux.colorize('bold', String(files.length))} of ${beforeCount} files (excluded ${beforeCount - files.length})`);
|
|
199
|
+
}
|
|
177
200
|
if (files.length === 0) {
|
|
178
|
-
this.error(flags.filter
|
|
179
|
-
? `No .xs files
|
|
201
|
+
this.error(flags.filter || flags.exclude
|
|
202
|
+
? `No .xs files remain after ${[flags.filter ? `filter ${flags.filter.join(', ')}` : '', flags.exclude ? `exclude ${flags.exclude.join(', ')}` : ''].filter(Boolean).join(' and ')} in ${args.directory}`
|
|
180
203
|
: `No .xs files found in ${args.directory}`);
|
|
181
204
|
}
|
|
182
205
|
// Read each file and track file path alongside content
|