@altairalabs/packc 0.0.1 → 1.1.0

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/bin/packc.js CHANGED
@@ -1,8 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { spawn } = require('child_process');
4
- const path = require('path');
5
- const fs = require('fs');
3
+ import { spawn } from 'node:child_process';
4
+ import path from 'node:path';
5
+ import fs from 'node:fs';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
6
10
 
7
11
  const binaryName = process.platform === 'win32' ? 'packc.exe' : 'packc';
8
12
  const binaryPath = path.join(__dirname, '..', binaryName);
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@altairalabs/packc",
3
- "version": "0.0.1",
3
+ "version": "1.1.0",
4
+ "type": "module",
4
5
  "description": "PromptKit Pack Compiler - Compile and validate prompt packs for LLM applications",
5
6
  "bin": {
6
7
  "packc": "./bin/packc.js"
package/postinstall.js CHANGED
@@ -1,12 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const https = require('node:https');
4
- const http = require('node:http');
5
- const fs = require('node:fs');
6
- const path = require('node:path');
7
- const { execSync } = require('node:child_process');
8
- const { pipeline } = require('node:stream');
9
- const { promisify } = require('node:util');
3
+ import https from 'node:https';
4
+ import http from 'node:http';
5
+ import fs from 'node:fs';
6
+ import path from 'node:path';
7
+ import { execSync } from 'node:child_process';
8
+ import { pipeline } from 'node:stream';
9
+ import { promisify } from 'node:util';
10
+ import { fileURLToPath } from 'node:url';
11
+ import { createRequire } from 'node:module';
12
+
13
+ const require = createRequire(import.meta.url);
14
+ const __filename = fileURLToPath(import.meta.url);
15
+ const __dirname = path.dirname(__filename);
10
16
 
11
17
  const streamPipeline = promisify(pipeline);
12
18
 
@@ -39,7 +45,7 @@ function getPlatformInfo() {
39
45
 
40
46
  function getDownloadUrl(platform, arch) {
41
47
  const archiveExt = platform === 'Windows' ? 'zip' : 'tar.gz';
42
- const archiveName = `PromptKit_v${VERSION}_${platform}_${arch}.${archiveExt}`;
48
+ const archiveName = `PromptKit_${VERSION}_${platform}_${arch}.${archiveExt}`;
43
49
  return `https://github.com/${GITHUB_REPO}/releases/download/v${VERSION}/${archiveName}`;
44
50
  }
45
51