@xano/cli 0.0.89 → 0.0.91

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,7 +16,8 @@ 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
- filter: 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>;
20
+ include: 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>;
22
23
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
@@ -48,11 +48,17 @@ Push without overwriting environment variables
48
48
  `$ xano workspace push ./my-workspace --truncate
49
49
  Truncate all table records before importing
50
50
  `,
51
- `$ xano workspace push ./my-workspace -f "**/func*"
51
+ `$ xano workspace push ./my-workspace -i "**/func*"
52
52
  Push only files matching the glob pattern
53
53
  `,
54
- `$ xano workspace push ./my-workspace -f "function/*" -f "table/*"
54
+ `$ xano workspace push ./my-workspace -i "function/*" -i "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 -i "function/*" -e "**/test*"
61
+ Push functions but exclude test files
56
62
  `,
57
63
  ];
58
64
  static flags = {
@@ -109,9 +115,15 @@ Push files matching multiple patterns
109
115
  description: 'Workspace ID (optional if set in profile)',
110
116
  required: false,
111
117
  }),
112
- filter: Flags.string({
113
- char: 'f',
114
- description: 'Glob pattern to filter files (e.g. "**/func*", "table/*.xs"). Matched against relative paths from the push directory.',
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
+ }),
124
+ include: Flags.string({
125
+ char: 'i',
126
+ description: 'Glob pattern to include files (e.g. "**/func*", "table/*.xs"). Matched against relative paths from the push directory.',
115
127
  multiple: true,
116
128
  required: false,
117
129
  }),
@@ -164,19 +176,30 @@ Push files matching multiple patterns
164
176
  // Collect all .xs files from the directory tree
165
177
  const allFiles = this.collectFiles(inputDir);
166
178
  let files = allFiles;
167
- // Apply glob filter(s) if specified
168
- if (flags.filter && flags.filter.length > 0) {
169
- files = allFiles.filter((f) => {
179
+ // Apply glob include(s) if specified
180
+ if (flags.include && flags.include.length > 0) {
181
+ files = files.filter((f) => {
170
182
  const rel = path.relative(inputDir, f);
171
- return flags.filter.some((pattern) => minimatch(rel, pattern, { matchBase: true }));
183
+ return flags.include.some((pattern) => minimatch(rel, pattern, { matchBase: true }));
172
184
  });
173
185
  this.log('');
174
- this.log(` ${ux.colorize('dim', 'Filter:')} ${flags.filter.map((p) => ux.colorize('cyan', p)).join(', ')}`);
186
+ this.log(` ${ux.colorize('dim', 'Include:')} ${flags.include.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 match filter ${flags.filter.join(', ')} in ${args.directory}`
201
+ this.error(flags.include || flags.exclude
202
+ ? `No .xs files remain after ${[flags.include ? `include ${flags.include.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