robuild 0.0.8 → 0.0.9

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.
@@ -2063,42 +2063,30 @@ async function triggerRebuild(watchCtx) {
2063
2063
  * Get patterns for files to watch
2064
2064
  */
2065
2065
  async function getWatchPatterns(config, ctx, watchOptions) {
2066
- if (watchOptions.include && watchOptions.include.length > 0) return watchOptions.include.map(normalizeGlobPattern);
2067
- const patterns = /* @__PURE__ */ new Set();
2068
- const addPattern = (pattern) => {
2069
- if (!pattern) return;
2070
- patterns.add(normalizeGlobPattern(pattern));
2071
- };
2072
- const addFilePatterns = (inputFile) => {
2073
- const absoluteInput = resolveToAbsolute(inputFile, ctx);
2074
- const filePattern = normalizeRelativeToPkg(absoluteInput, ctx);
2075
- if (filePattern && filePattern !== ".") addPattern(filePattern);
2076
- addPattern(getDirGlobPattern(dirname(absoluteInput), ctx));
2077
- };
2078
- const addDirectoryPatterns = (inputDir) => {
2079
- const absoluteDir = resolveToAbsolute(inputDir, ctx);
2080
- addPattern(getDirGlobPattern(absoluteDir, ctx));
2081
- };
2066
+ if (watchOptions.include && watchOptions.include.length > 0) return watchOptions.include;
2067
+ const patterns = [];
2082
2068
  for (const entry of config.entries || []) if (typeof entry === "string") {
2083
2069
  const [input] = entry.split(":");
2084
- if (input.endsWith("/")) addDirectoryPatterns(input);
2070
+ if (input.endsWith("/")) patterns.push(`${input}**/*`);
2085
2071
  else {
2086
2072
  const inputs = input.split(",");
2087
- for (const inputFile of inputs) addFilePatterns(inputFile);
2073
+ for (const inputFile of inputs) {
2074
+ patterns.push(inputFile);
2075
+ const dir = inputFile.substring(0, inputFile.lastIndexOf("/"));
2076
+ if (dir) patterns.push(`${dir}/**/*`);
2077
+ }
2088
2078
  }
2089
- } else if (entry.type === "transform") addDirectoryPatterns(entry.input);
2079
+ } else if (entry.type === "transform") patterns.push(`${entry.input}/**/*`);
2090
2080
  else {
2091
2081
  const inputs = Array.isArray(entry.input) ? entry.input : [entry.input];
2092
- for (const inputFile of inputs) addFilePatterns(inputFile);
2082
+ for (const inputFile of inputs) {
2083
+ patterns.push(inputFile);
2084
+ const dir = inputFile.substring(0, inputFile.lastIndexOf("/"));
2085
+ if (dir) patterns.push(`${dir}/**/*`);
2086
+ }
2093
2087
  }
2094
- if (patterns.size === 0) [
2095
- "src/**/*",
2096
- "*.ts",
2097
- "*.js",
2098
- "*.mjs",
2099
- "*.json"
2100
- ].forEach((pattern) => addPattern(pattern));
2101
- return Array.from(patterns);
2088
+ if (patterns.length === 0) patterns.push("src/**/*", "*.ts", "*.js", "*.mjs", "*.json");
2089
+ return [...new Set(patterns)];
2102
2090
  }
2103
2091
  /**
2104
2092
  * Get patterns for files to ignore
@@ -2121,26 +2109,6 @@ function getIgnorePatterns(config, watchOptions) {
2121
2109
  if (config.ignoreWatch && config.ignoreWatch.length > 0) allIgnores.push(...normalizeIgnorePatterns(config.ignoreWatch));
2122
2110
  return allIgnores;
2123
2111
  }
2124
- function resolveToAbsolute(path, ctx) {
2125
- return isAbsolute(path) ? path : join(ctx.pkgDir, path);
2126
- }
2127
- function normalizeGlobPattern(pattern) {
2128
- return pattern.replace(/\\/g, "/");
2129
- }
2130
- function normalizeRelativeToPkg(target, ctx) {
2131
- const relativePath = relative(ctx.pkgDir, target);
2132
- if (!relativePath || relativePath === "") return ".";
2133
- if (relativePath.includes(":")) return normalizeGlobPattern(target);
2134
- return normalizeGlobPattern(relativePath);
2135
- }
2136
- function getDirGlobPattern(directory, ctx) {
2137
- const normalizedDir = normalizeRelativeToPkg(directory, ctx);
2138
- if (!normalizedDir || normalizedDir === "." || normalizedDir === "./") return "**/*";
2139
- return `${stripTrailingSlash(normalizedDir)}/**/*`;
2140
- }
2141
- function stripTrailingSlash(path) {
2142
- return path.replace(/\/+$/, "");
2143
- }
2144
2112
 
2145
2113
  //#endregion
2146
2114
  //#region src/build.ts
@@ -1,7 +1,7 @@
1
1
  //#region package.json
2
2
  var name = "robuild";
3
3
  var type = "module";
4
- var version = "0.0.8";
4
+ var version = "0.0.9";
5
5
  var packageManager = "pnpm@10.11.1";
6
6
  var description = "Zero-config ESM/TS package builder. Powered by Rolldown and Oxc";
7
7
  var license = "MIT";
@@ -32,7 +32,7 @@ var scripts = {
32
32
  var dependencies = {
33
33
  "c12": "^3.0.4",
34
34
  "cac": "^6.7.14",
35
- "chokidar": "^4.0.3",
35
+ "chokidar": "^3.0.3",
36
36
  "consola": "^3.4.2",
37
37
  "defu": "^6.1.4",
38
38
  "exsolve": "^1.0.5",
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { build } from "./_chunks/build-CHtyq9DQ.mjs";
2
+ import { build } from "./_chunks/build-BwB_tOe9.mjs";
3
3
  import { consola } from "consola";
4
4
  import { parseArgs } from "node:util";
5
5
  import { loadConfig } from "c12";
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { build } from "./_chunks/build-CHtyq9DQ.mjs";
1
+ import { build } from "./_chunks/build-BwB_tOe9.mjs";
2
2
  import { defineConfig } from "./_chunks/config-B_2eqpNJ.mjs";
3
3
 
4
4
  export { build, defineConfig };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "robuild",
3
3
  "type": "module",
4
- "version": "0.0.8",
4
+ "version": "0.0.9",
5
5
  "packageManager": "pnpm@10.11.1",
6
6
  "description": "Zero-config ESM/TS package builder. Powered by Rolldown and Oxc",
7
7
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "dependencies": {
35
35
  "c12": "^3.0.4",
36
36
  "cac": "^6.7.14",
37
- "chokidar": "^4.0.3",
37
+ "chokidar": "^3.0.3",
38
38
  "consola": "^3.4.2",
39
39
  "defu": "^6.1.4",
40
40
  "exsolve": "^1.0.5",