@seangalie/precast 0.4.0 → 0.4.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/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.4.1] - 2026-11-29
9
+
10
+ ### Fixed
11
+
12
+ - Generated helper scripts, such as `.repo/ci-checks.sh` and
13
+ `.repo/check-secrets.py`, are executable. On filesystems with POSIX
14
+ permissions, every file that starts with `#!` is written as 755 and every
15
+ other file as 644, instead of copying the source file's mode, which was 644 in
16
+ the package. Native Windows keeps its own permissions.
17
+
8
18
  ## [0.4.0] - 2026-11-29
9
19
 
10
20
  ### Changed
package/dist/collect.d.ts CHANGED
@@ -2,7 +2,7 @@ import { type Context } from "./context.ts";
2
2
  import { type Tier } from "./tiers.ts";
3
3
  export interface OutputFile {
4
4
  data: Buffer;
5
- /** Permission bits copied from the source file. */
5
+ /** 755 for a script, which starts with `#!`, and 644 for everything else. */
6
6
  mode: number;
7
7
  }
8
8
  /** Output files keyed by POSIX relative path, in source order. */
package/dist/collect.js CHANGED
@@ -68,7 +68,9 @@ export function collectFiles(root, platformName, context, tier = "full") {
68
68
  if (rendered) {
69
69
  data = Buffer.from(render(data, tier, context, source), "utf8");
70
70
  }
71
- files.set(output, { data, mode: stats.mode & 0o777 });
71
+ // The source's own mode is not used: npm packs and Git checkouts on
72
+ // Windows drop executable bits, so the shebang decides.
73
+ files.set(output, { data, mode: isScript(data) ? 0o755 : 0o644 });
72
74
  }
73
75
  // A stale entry would silently stop placing a renamed file in its tier.
74
76
  if (unmatched.size > 0) {
@@ -135,6 +137,9 @@ export function comparePaths(left, right) {
135
137
  }
136
138
  return a.length - b.length;
137
139
  }
140
+ function isScript(data) {
141
+ return data[0] === 0x23 && data[1] === 0x21;
142
+ }
138
143
  /** The final extension, ignoring a leading dot, as in `name.tmpl` but not `.tmpl`. */
139
144
  function suffix(path) {
140
145
  const name = basename(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seangalie/precast",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Generate new Forgejo, GitHub, and GitLab projects with documentation, checks, and forge settings in place",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Sean Galie",