tcbuilder 2.11.0 → 2.11.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/dist/tcbuild.d.ts CHANGED
@@ -39,7 +39,7 @@ type Group = {
39
39
  toBeRemoved: string[];
40
40
  includeInFinalOutput: boolean;
41
41
  depends: string[];
42
- extraSuffixes: string[];
42
+ extraSuffixes: string[] | string[][];
43
43
  appendFlagsFromExtraSuffixes: boolean;
44
44
  outPath?: string | undefined;
45
45
  }>;
@@ -67,7 +67,7 @@ declare function _groupFinalFlagsGenCb(cb: Group['finalFlagsGenCb']): ((group: G
67
67
  interface groupFileObj {
68
68
  appendFlagsFromExtraSuffixes(bool: boolean): groupFileObj;
69
69
  setOutPath(path?: string | undefined): groupFileObj;
70
- setExtraSuffixes(suffixes?: string[]): groupFileObj;
70
+ setExtraSuffixes(suffixes?: string[] | string[][]): groupFileObj;
71
71
  setDepends(depends: string[]): groupFileObj;
72
72
  getFlags(): Flags[];
73
73
  setFlags(flags: string | Flags[]): groupFileObj;
package/dist/tcbuild.js CHANGED
@@ -487,7 +487,6 @@ function findExecutable(map, exts, depth = -1) {
487
487
  }
488
488
  return map[ext] ?? findExecutable(map, exts, depth - 1);
489
489
  }
490
- const noSuffix = Symbol();
491
490
  process.once('beforeExit', async () => {
492
491
  fs.mkdirSync(path.dirname(path.join(process.cwd(), build_dir)), { recursive: true });
493
492
  const compileCommandsFiles = [];
@@ -496,9 +495,9 @@ process.once('beforeExit', async () => {
496
495
  for (const [fileName, file] of Object.entries(group.files)) {
497
496
  const fileExts = fileName.split('.').slice(1);
498
497
  const suffix = findExecutable(group.extSuffix, fileExts) ?? findExecutable(globalExtSuffix, fileExts);
499
- for (const extraSuffix of file.extraSuffixes.length > 0 ? file.extraSuffixes : [noSuffix]) {
498
+ for (const extraSuffix of file.extraSuffixes.length > 0 ? file.extraSuffixes : [Symbol()]) {
500
499
  const obj = file.outPath ??
501
- `${build_dir}/${fileName}${extraSuffix === noSuffix ? '' : `.${extraSuffix.toString()}`}${suffix ? `.${suffix}` : ''}`;
500
+ `${build_dir}/${fileName}${typeof extraSuffix === "symbol" ? '' : `.${Array.isArray(extraSuffix) ? extraSuffix.join(".") : extraSuffix}`}${suffix ? `.${suffix}` : ''}`;
502
501
  if ((file.includeInFinalOutput ||
503
502
  findExecutable(group.extIncludeInFinalOutput, fileExts) ||
504
503
  findExecutable(globalExtIncludeInFinalOutput, fileExts)) === true)
@@ -508,7 +507,11 @@ process.once('beforeExit', async () => {
508
507
  const flagsArray = [];
509
508
  flagsArray.push(...(globalSrcFlags[fileName] ?? []));
510
509
  flagsArray.push(...(file.flags ?? []));
511
- for (const ext of fileExts.concat(file.appendFlagsFromExtraSuffixes ? file.extraSuffixes : [])) {
510
+ for (const ext of fileExts.concat(file.appendFlagsFromExtraSuffixes && typeof extraSuffix !== 'symbol'
511
+ ? Array.isArray(extraSuffix)
512
+ ? extraSuffix.flat()
513
+ : extraSuffix
514
+ : [])) {
512
515
  if (ext.length > 0) {
513
516
  flagsArray.push(...(globalExtFlags[ext] ?? []));
514
517
  flagsArray.push(...(group.extFlags[ext] ?? []));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tcbuilder",
3
- "version": "2.11.0",
3
+ "version": "2.11.1",
4
4
  "description": "Build System",
5
5
  "homepage": "https://github.com/umutfahriozkan/tcbuild#readme",
6
6
  "bugs": {