pup-recorder 0.1.5 → 0.1.7

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/.gitattributes CHANGED
@@ -1,2 +1,3 @@
1
+ dist/** filter=lfs diff=lfs merge=lfs -text
1
2
  rust/** filter=lfs diff=lfs merge=lfs -text
2
3
  x265/** filter=lfs diff=lfs merge=lfs -text
package/build.ts CHANGED
@@ -3,18 +3,20 @@ import { rm } from "fs/promises";
3
3
  import { createRequire } from "module";
4
4
  import { join } from "path";
5
5
  import { build, type Options } from "tsup";
6
+ import { buildRust } from "./build_rust";
6
7
  import { dependencies } from "./package.json";
7
8
 
8
9
  const require = createRequire(import.meta.url);
9
10
  const tsPath = require.resolve("@typescript/native-preview/package.json");
10
11
  const tsgo = join(tsPath, "..", "bin", "tsgo.js");
11
12
 
13
+ await buildRust();
14
+
12
15
  await $`${tsgo}`;
13
16
  await rm("dist", { recursive: true, force: true });
14
17
 
15
18
  const common: Options = {
16
19
  silent: true,
17
- splitting: false,
18
20
  target: "node20",
19
21
  shims: true,
20
22
  external: Object.keys(dependencies),
@@ -22,27 +24,21 @@ const common: Options = {
22
24
  minify: true,
23
25
  treeshake: true,
24
26
  banner: { js: `import "source-map-support/register.js";` },
27
+ loader: { ".bin": "binary" },
25
28
  };
26
29
 
27
30
  await Promise.all([
28
31
  build({
29
32
  ...common,
30
- entry: [
31
- "src/index.ts", //
32
- "src/cli.ts",
33
- ],
33
+ entry: ["src/index.ts", "src/cli.ts"],
34
34
  format: "esm",
35
35
  outDir: "dist",
36
36
  dts: true,
37
37
  }),
38
38
  build({
39
39
  ...common,
40
- entry: [
41
- "src/index.ts", //
42
- "src/cli.ts",
43
- "src/app.ts",
44
- ],
40
+ entry: ["src/app.ts"],
45
41
  format: "cjs",
46
- outDir: "dist/cjs",
42
+ outDir: "dist",
47
43
  }),
48
44
  ]);
package/build_rust.ts CHANGED
@@ -32,8 +32,8 @@ async function copyArtifact(platform: string, arch: string, dir: string) {
32
32
  if (!libName) return;
33
33
  const src = join(dir, libName);
34
34
  const destDir = join("rust");
35
- const dest = join(destDir, `${platform}-${arch}.node`);
36
- const dts = `declare const sth: unknown;\nexport = sth;\n`;
35
+ const dest = join(destDir, `${platform}-${arch}.bin`);
36
+ const dts = `declare const sth: Uint8Array;\nexport = sth;\n`;
37
37
  await mkdir(destDir, { recursive: true });
38
38
  await copyFile(src, dest);
39
39
  await writeFile(`${dest}.d.ts`, dts);
@@ -54,7 +54,7 @@ async function cargoBuild(platform: string, arch: string) {
54
54
  const PLATFORMS = ["darwin", "linux", "win32"];
55
55
  const ARCHS = ["x64", "arm64"];
56
56
 
57
- async function buildRust() {
57
+ export async function buildRust() {
58
58
  await $`cargo install --quiet cargo-zigbuild cargo-xwin`;
59
59
  for (const platform of PLATFORMS) {
60
60
  for (const arch of ARCHS) {
@@ -62,5 +62,3 @@ async function buildRust() {
62
62
  }
63
63
  }
64
64
  }
65
-
66
- buildRust();