create-sense-app 1.0.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 @@
1
+ # create-sense-app
package/bin/cli.ts ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env bun
2
+
3
+ import { cp, mkdir, readFile, writeFile } from "node:fs/promises";
4
+ import { join, resolve } from "node:path";
5
+ import { spawn } from "bun";
6
+
7
+ const projectName = process.argv[2] || "sense-app";
8
+ const currentDir = process.cwd();
9
+ const projectDir = join(currentDir, projectName);
10
+
11
+ console.log(`\n ⚙︎ Creating a new Sense app in ${projectName}...\n`);
12
+
13
+ await mkdir(projectDir, { recursive: true });
14
+
15
+
16
+ const repo = "github:ommgh/app-sense";
17
+
18
+
19
+ const degit = spawn(["npx", "degit", repo, projectName], {
20
+ stdio: ["ignore", "inherit", "inherit"],
21
+ });
22
+
23
+ await degit.exited;
24
+
25
+ if (degit.exitCode !== 0) {
26
+ console.error("Failed to download template.");
27
+ process.exit(1);
28
+ }
29
+
30
+
31
+ const pkgPath = join(projectDir, "package.json");
32
+ const pkgStr = await readFile(pkgPath, "utf-8");
33
+ const pkg = JSON.parse(pkgStr);
34
+
35
+ pkg.name = projectName;
36
+ pkg.dependencies["@ommishra/sense"] = "latest";
37
+
38
+ await writeFile(pkgPath, JSON.stringify(pkg, null, 2));
39
+
40
+ console.log(`\nDone! Run:\n cd ${projectName}\n bun install\n bun dev\n`);
package/bun.lock ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "lockfileVersion": 1,
3
+ "workspaces": {
4
+ "": {
5
+ "name": "create-sense-app",
6
+ "devDependencies": {
7
+ "@types/bun": "latest",
8
+ },
9
+ "peerDependencies": {
10
+ "typescript": "^5",
11
+ },
12
+ },
13
+ },
14
+ "packages": {
15
+ "@types/bun": ["@types/bun@1.3.4", "", { "dependencies": { "bun-types": "1.3.4" } }, "sha512-EEPTKXHP+zKGPkhRLv+HI0UEX8/o+65hqARxLy8Ov5rIxMBPNTjeZww00CIihrIQGEQBYg+0roO5qOnS/7boGA=="],
16
+
17
+ "@types/node": ["@types/node@25.0.3", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA=="],
18
+
19
+ "bun-types": ["bun-types@1.3.4", "", { "dependencies": { "@types/node": "*" } }, "sha512-5ua817+BZPZOlNaRgGBpZJOSAQ9RQ17pkwPD0yR7CfJg+r8DgIILByFifDTa+IPDDxzf5VNhtNlcKqFzDgJvlQ=="],
20
+
21
+ "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
22
+
23
+ "undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
24
+ }
25
+ }
package/dist/cli.js ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env bun
2
+ // @bun
3
+
4
+ // bin/cli.ts
5
+ import { mkdir, readFile, writeFile } from "fs/promises";
6
+ import { join } from "path";
7
+ var {spawn } = globalThis.Bun;
8
+ var projectName = process.argv[2] || "sense-app";
9
+ var currentDir = process.cwd();
10
+ var projectDir = join(currentDir, projectName);
11
+ console.log(`
12
+ \u2699\uFE0E Creating a new Sense app in ${projectName}...
13
+ `);
14
+ await mkdir(projectDir, { recursive: true });
15
+ var repo = "github:ommgh/app-sense";
16
+ var degit = spawn(["npx", "degit", repo, projectName], {
17
+ stdio: ["ignore", "inherit", "inherit"]
18
+ });
19
+ await degit.exited;
20
+ if (degit.exitCode !== 0) {
21
+ console.error("Failed to download template.");
22
+ process.exit(1);
23
+ }
24
+ var pkgPath = join(projectDir, "package.json");
25
+ var pkgStr = await readFile(pkgPath, "utf-8");
26
+ var pkg = JSON.parse(pkgStr);
27
+ pkg.name = projectName;
28
+ pkg.dependencies["@ommishra/sense"] = "latest";
29
+ await writeFile(pkgPath, JSON.stringify(pkg, null, 2));
30
+ console.log(`
31
+ Done! Run:
32
+ cd ${projectName}
33
+ bun install
34
+ bun dev
35
+ `);
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "create-sense-app",
3
+ "version": "1.0.0",
4
+ "bin": "./dist/cli.js",
5
+ "scripts": {
6
+ "build": "bun build ./bin/cli.ts --outfile ./dist/cli.js --target node"
7
+ },
8
+ "module": "index.ts",
9
+ "type": "module",
10
+ "devDependencies": {
11
+ "@types/bun": "latest"
12
+ },
13
+ "peerDependencies": {
14
+ "typescript": "^5"
15
+ },
16
+ "publishConfig": {
17
+ "access": "public"
18
+ }
19
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Environment setup & latest features
4
+ "lib": ["ESNext"],
5
+ "target": "ESNext",
6
+ "module": "Preserve",
7
+ "moduleDetection": "force",
8
+ "jsx": "react-jsx",
9
+ "allowJs": true,
10
+
11
+ // Bundler mode
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "noEmit": true,
16
+
17
+ // Best practices
18
+ "strict": true,
19
+ "skipLibCheck": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "noUncheckedIndexedAccess": true,
22
+ "noImplicitOverride": true,
23
+
24
+ // Some stricter flags (disabled by default)
25
+ "noUnusedLocals": false,
26
+ "noUnusedParameters": false,
27
+ "noPropertyAccessFromIndexSignature": false
28
+ }
29
+ }