webuix 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. package/build.ts +19 -5
  2. package/package.json +3 -3
package/build.ts CHANGED
@@ -1,3 +1,22 @@
1
+ import { writeFileSync, readFileSync } from "fs";
2
+ import { execSync } from "child_process";
3
+
4
+ // Get Git commit count
5
+ const count = parseInt(execSync("git rev-list --count HEAD").toString().trim(), 10);
6
+
7
+ // Compute MAJOR.MINOR.PATCH
8
+ const MAJOR = Math.floor(count / 10000);
9
+ const MINOR = Math.floor((count / 100) % 100);
10
+ const PATCH = count % 100;
11
+ const version = `${MAJOR}.${MINOR}.${PATCH}`;
12
+
13
+ // Update package.json
14
+ const pkgPath = "./package.json";
15
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
16
+ pkg.version = version;
17
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
18
+
19
+ // Run Bun build
1
20
  Bun.build({
2
21
  entrypoints: ["./src/index.ts", "./src/wrappers/index.ts"],
3
22
  outdir: "./dist",
@@ -5,11 +24,6 @@ Bun.build({
5
24
  target: "browser",
6
25
  format: "cjs",
7
26
  splitting: true,
8
- // naming: {
9
- // entry: `[name].bundle.${ext}`,
10
- // chunk: `[name]-[hash].${ext}`,
11
- // asset: "[name]-[hash][ext]",
12
- // },
13
27
  }).catch((err) => {
14
28
  console.error(err);
15
29
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webuix",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "description": "A library to make your life easier when working with MMRL's WebUI",
6
6
  "source": "src/index.ts",
@@ -9,7 +9,7 @@
9
9
  "types": "dist/index.d.ts",
10
10
  "scripts": {
11
11
  "build": "bun run build.ts",
12
- "upload": "npm run build && npm publish"
12
+ "upload": "bun run build && npm publish"
13
13
  },
14
14
  "keywords": [],
15
15
  "author": "",
@@ -20,4 +20,4 @@
20
20
  "peerDependencies": {
21
21
  "typescript": "^5.0.0"
22
22
  }
23
- }
23
+ }