pokit 0.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -0
  3. package/bin/pok.ts +45 -0
  4. package/package.json +39 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Daniel Grant
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # pokit
2
+
3
+ Global CLI launcher for pok. Install once, run anywhere.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bun add -g pokit
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Once installed globally, run `pok` from any project with `@pokit/core` installed:
14
+
15
+ ```bash
16
+ cd my-project
17
+ pok # Show interactive command menu
18
+ pok dev # Run specific command
19
+ pok --help # Show help
20
+ ```
21
+
22
+ ## How It Works
23
+
24
+ The global `pok` command acts as a thin launcher that:
25
+
26
+ 1. Imports `@pokit/core` from the current project
27
+ 2. Calls `runCli()` to handle command routing
28
+ 3. Shows helpful error messages if requirements aren't met
29
+
30
+ This approach ensures you always use the project's version of core, avoiding version mismatches.
31
+
32
+ ## Requirements
33
+
34
+ - Bun >= 1.0.0
35
+ - `@pokit/core` installed in your project
36
+
37
+ ## Documentation
38
+
39
+ See the [full documentation](https://github.com/openpok/pok).
package/bin/pok.ts ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * pokit - Global CLI launcher for pok
4
+ *
5
+ * This is a thin wrapper that:
6
+ * 1. Tries to import @pokit/core from the current project
7
+ * 2. Calls runCli() to handle the actual CLI logic
8
+ * 3. Shows helpful error messages if requirements are not met
9
+ *
10
+ * Install globally with: bun add -g pokit
11
+ * Then run `pok` from any project with @pokit/core installed.
12
+ */
13
+
14
+ async function main() {
15
+ try {
16
+ const { runCli } = await import('@pokit/core');
17
+ await runCli(process.argv.slice(2));
18
+ } catch (error) {
19
+ // Check if it's a module resolution error
20
+ if (
21
+ error instanceof Error &&
22
+ (error.message.includes('Cannot find') ||
23
+ error.message.includes('could not resolve') ||
24
+ error.message.includes('Module not found'))
25
+ ) {
26
+ console.error(
27
+ 'Error: @pokit/core is not installed in this project.\n\n' +
28
+ 'Requirements:\n' +
29
+ ' - Bun runtime: https://bun.sh\n' +
30
+ ' - @pokit/core installed in your project\n\n' +
31
+ 'Install with:\n' +
32
+ ' bun add @pokit/core\n'
33
+ );
34
+ process.exit(1);
35
+ }
36
+
37
+ // Re-throw other errors
38
+ throw error;
39
+ }
40
+ }
41
+
42
+ main().catch((err) => {
43
+ console.error(err);
44
+ process.exit(1);
45
+ });
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "pokit",
3
+ "version": "0.0.1",
4
+ "description": "Global CLI launcher for pok - install once, run anywhere",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/notation-dev/openpok.git",
10
+ "directory": "packages/cmd"
11
+ },
12
+ "homepage": "https://github.com/notation-dev/openpok#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/notation-dev/openpok/issues"
15
+ },
16
+ "bin": {
17
+ "pok": "./bin/pok.ts"
18
+ },
19
+ "files": [
20
+ "bin"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "devDependencies": {
26
+ "@types/bun": "latest",
27
+ "@pokit/prompter-clack": "0.0.1",
28
+ "@pokit/reporter-clack": "0.0.1",
29
+ "@pokit/core": "0.0.1"
30
+ },
31
+ "engines": {
32
+ "bun": ">=1.0.0"
33
+ },
34
+ "keywords": [
35
+ "cli",
36
+ "pok",
37
+ "pokit"
38
+ ]
39
+ }