vue-go-tsc 0.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/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # vue-go-tsc
2
+
3
+ > Blazingly fast Vue 3 type checker powered by [typescript-go](https://github.com/microsoft/typescript-go) — a Go-native alternative to `vue-tsc`.
4
+
5
+ > **Attribution** — This is a redistribution of [`NikhilVerma/vue-tsgo`](https://github.com/NikhilVerma/vue-tsgo)
6
+ > (formerly `nonfx/golar`). All the technical work belongs to the upstream author.
7
+ > This package only changes the npm name and release location so the aidalinfo
8
+ > org can consume it easily in CI. See the [repository README](https://github.com/aidalinfo/vue-tsgo#readme).
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ # Global CLI
14
+ npm install -g vue-go-tsc
15
+
16
+ # Or as a project dev dependency (recommended for CI)
17
+ pnpm add -D vue-go-tsc
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```bash
23
+ # Type-check a Vue project
24
+ vue-go-tsc -p tsconfig.json --noEmit
25
+
26
+ # Watch mode
27
+ vue-go-tsc -p tsconfig.json --noEmit --watch
28
+
29
+ # Build mode (for monorepos / composite projects)
30
+ vue-go-tsc -b --noEmit
31
+ ```
32
+
33
+ ### Nuxt
34
+
35
+ ```bash
36
+ # Generate .nuxt/tsconfig.json first, then type-check against it
37
+ nuxt prepare && vue-go-tsc -p .nuxt/tsconfig.json --noEmit
38
+ ```
39
+
40
+ See the full [CI integration guide](https://github.com/aidalinfo/vue-tsgo/blob/main/docs/integration.md).
41
+
42
+ ## Why vue-go-tsc?
43
+
44
+ - **10-50x faster** than vue-tsc (Node.js-based)
45
+ - **Lower memory usage** — native Go instead of Node.js
46
+ - **Drop-in replacement** for vue-tsc
47
+ - **Zero `.vue` file error delta** with vue-tsc on real-world projects
48
+
49
+ ## Documentation
50
+
51
+ Full documentation: https://github.com/aidalinfo/vue-tsgo#readme
52
+
53
+ ## Platform Support
54
+
55
+ - macOS (Intel & Apple Silicon)
56
+ - Linux (x64 & ARM64)
57
+ - Windows (x64)
58
+
59
+ ## License
60
+
61
+ MIT © [Nikhil Verma](https://github.com/NikhilVerma)
package/bin/vue-go-tsc ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawnSync } = require('child_process');
4
+ const { join } = require('path');
5
+
6
+ const BINARY_NAME = process.platform === 'win32' ? 'tsgo.exe' : 'tsgo';
7
+ const BIN_PATH = join(__dirname, BINARY_NAME);
8
+
9
+ // Forward all arguments to the binary
10
+ const result = spawnSync(BIN_PATH, process.argv.slice(2), {
11
+ stdio: 'inherit',
12
+ shell: false,
13
+ });
14
+
15
+ process.exit(result.status || 0);
package/install.js ADDED
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { existsSync, mkdirSync, chmodSync } = require('fs');
4
+ const { join } = require('path');
5
+ const https = require('https');
6
+ const { createWriteStream } = require('fs');
7
+
8
+ const PACKAGE_VERSION = require('./package.json').version;
9
+ const BINARY_NAME = process.platform === 'win32' ? 'tsgo.exe' : 'tsgo';
10
+ const BIN_DIR = join(__dirname, 'bin');
11
+ const BIN_PATH = join(BIN_DIR, BINARY_NAME);
12
+
13
+ // Platform mapping for GitHub releases
14
+ const PLATFORM_MAP = {
15
+ 'darwin-x64': 'tsgo-darwin-amd64',
16
+ 'darwin-arm64': 'tsgo-darwin-arm64',
17
+ 'linux-x64': 'tsgo-linux-amd64',
18
+ 'linux-arm64': 'tsgo-linux-arm64',
19
+ 'win32-x64': 'tsgo-windows-amd64.exe',
20
+ };
21
+
22
+ function getPlatformBinary() {
23
+ const platform = process.platform;
24
+ const arch = process.arch;
25
+ const key = `${platform}-${arch}`;
26
+
27
+ if (!PLATFORM_MAP[key]) {
28
+ throw new Error(
29
+ `Unsupported platform: ${platform}-${arch}\n` +
30
+ `Supported platforms: ${Object.keys(PLATFORM_MAP).join(', ')}`
31
+ );
32
+ }
33
+
34
+ return PLATFORM_MAP[key];
35
+ }
36
+
37
+ function download(url, dest) {
38
+ return new Promise((resolve, reject) => {
39
+ const file = createWriteStream(dest);
40
+ https.get(url, (response) => {
41
+ if (response.statusCode === 302 || response.statusCode === 301) {
42
+ // Follow redirect
43
+ download(response.headers.location, dest).then(resolve).catch(reject);
44
+ return;
45
+ }
46
+
47
+ if (response.statusCode !== 200) {
48
+ reject(new Error(`Download failed: ${response.statusCode} ${response.statusMessage}`));
49
+ return;
50
+ }
51
+
52
+ response.pipe(file);
53
+ file.on('finish', () => {
54
+ file.close();
55
+ resolve();
56
+ });
57
+ }).on('error', (err) => {
58
+ reject(err);
59
+ });
60
+ });
61
+ }
62
+
63
+ async function install() {
64
+ try {
65
+ // Check if binary already exists (useful for development)
66
+ if (existsSync(BIN_PATH)) {
67
+ console.log('✓ vue-go-tsc binary already exists');
68
+ return;
69
+ }
70
+
71
+ console.log('Installing vue-go-tsc...');
72
+
73
+ const platformBinary = getPlatformBinary();
74
+ const downloadUrl = `https://github.com/aidalinfo/vue-tsgo/releases/download/v${PACKAGE_VERSION}/${platformBinary}`;
75
+
76
+ console.log(`Downloading from: ${downloadUrl}`);
77
+
78
+ // Ensure bin directory exists
79
+ if (!existsSync(BIN_DIR)) {
80
+ mkdirSync(BIN_DIR, { recursive: true });
81
+ }
82
+
83
+ // Download binary
84
+ await download(downloadUrl, BIN_PATH);
85
+
86
+ // Make executable (Unix-like systems)
87
+ if (process.platform !== 'win32') {
88
+ chmodSync(BIN_PATH, 0o755);
89
+ }
90
+
91
+ console.log('✓ vue-go-tsc installed successfully!');
92
+ console.log(`\nRun 'vue-go-tsc --version' to verify installation`);
93
+ } catch (error) {
94
+ console.error('✗ Installation failed:', error.message);
95
+ console.error('\nManual installation:');
96
+ console.error(`1. Download binary from: https://github.com/aidalinfo/vue-tsgo/releases/tag/v${PACKAGE_VERSION}`);
97
+ console.error(`2. Place in: ${BIN_DIR}`);
98
+ console.error(`3. Rename to: ${BINARY_NAME}`);
99
+ process.exit(1);
100
+ }
101
+ }
102
+
103
+ install();
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "vue-go-tsc",
3
+ "version": "0.1.0",
4
+ "description": "Blazingly fast Vue 3 type checker powered by typescript-go — a Go-native alternative to vue-tsc",
5
+ "keywords": [
6
+ "vue",
7
+ "typescript",
8
+ "type-checker",
9
+ "vue3",
10
+ "sfc",
11
+ "volar",
12
+ "vue-tsc",
13
+ "tsgo",
14
+ "nuxt"
15
+ ],
16
+ "homepage": "https://github.com/aidalinfo/vue-tsgo#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/aidalinfo/vue-tsgo/issues"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/aidalinfo/vue-tsgo.git"
23
+ },
24
+ "license": "MIT",
25
+ "author": "Nikhil Verma <https://github.com/NikhilVerma>",
26
+ "publishConfig": {
27
+ "registry": "https://registry.npmjs.org/"
28
+ },
29
+ "bin": {
30
+ "vue-go-tsc": "./bin/vue-go-tsc"
31
+ },
32
+ "files": [
33
+ "bin/",
34
+ "install.js",
35
+ "README.md"
36
+ ],
37
+ "scripts": {
38
+ "postinstall": "node install.js"
39
+ },
40
+ "engines": {
41
+ "node": ">=18.0.0"
42
+ },
43
+ "os": [
44
+ "darwin",
45
+ "linux",
46
+ "win32"
47
+ ],
48
+ "cpu": [
49
+ "x64",
50
+ "arm64"
51
+ ]
52
+ }