create-kuckit-app 0.1.0 → 0.1.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.
package/dist/bin.js CHANGED
@@ -21,10 +21,10 @@ function isTokenExpired(config) {
21
21
  return new Date(config.tokenExpiresAt) < /* @__PURE__ */ new Date();
22
22
  }
23
23
  /**
24
- * Checks if the user is authenticated with a valid token.
25
- * Exits the process with an error message if not authenticated.
24
+ * Checks if the user is authenticated and has the required permission.
25
+ * Exits the process with an error message if not authenticated or permission is missing.
26
26
  */
27
- function requireAuth() {
27
+ function requirePermission(permission) {
28
28
  const config = loadConfig();
29
29
  if (!config?.cliToken) {
30
30
  console.error("\nError: Not logged in. Run 'kuckit auth login' first.\n");
@@ -34,12 +34,18 @@ function requireAuth() {
34
34
  console.error("\nError: Session expired. Run 'kuckit auth login' to refresh.\n");
35
35
  process.exit(1);
36
36
  }
37
+ if (!config.permissions?.includes(permission)) {
38
+ console.error(`\nError: Permission denied. Required: '${permission}'`);
39
+ console.error(`Your permissions: ${config.permissions?.join(", ") || "(none)"}`);
40
+ console.error("Contact your administrator or re-login to refresh.\n");
41
+ process.exit(1);
42
+ }
37
43
  }
38
44
 
39
45
  //#endregion
40
46
  //#region src/bin.ts
41
47
  program.name("create-kuckit-app").description("Create a new Kuckit application").version("0.1.0").argument("<project-name>", "Name of the project to create").option("--skip-install", "Skip running package manager install", false).option("--template <template>", "Template to use", "base").action(async (projectName, options) => {
42
- requireAuth();
48
+ requirePermission("scaffold");
43
49
  await createProject(projectName, options);
44
50
  });
45
51
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kuckit-app",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Create a new Kuckit application",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -7,8 +7,6 @@
7
7
  "dev": "bun run --hot src/server.ts"
8
8
  },
9
9
  "dependencies": {
10
- "@kuckit/sdk": "^0.1.0",
11
- "@kuckit/users-module": "^0.1.0",
12
10
  "express": "^5.1.0",
13
11
  "cors": "^2.8.5",
14
12
  "dotenv": "^17.2.2",
@@ -1,8 +1,6 @@
1
1
  import 'dotenv/config'
2
2
  import express from 'express'
3
3
  import cors from 'cors'
4
- import { createKuckitContainer, loadKuckitModules } from '@kuckit/sdk'
5
- import { getModuleSpecs } from './config/modules.js'
6
4
 
7
5
  const app = express()
8
6
  const port = process.env.PORT ?? 3000
@@ -10,30 +8,14 @@ const port = process.env.PORT ?? 3000
10
8
  app.use(cors())
11
9
  app.use(express.json())
12
10
 
13
- async function bootstrap() {
14
- // Create DI container
15
- const container = createKuckitContainer({
16
- env: process.env.NODE_ENV ?? 'development',
17
- })
11
+ // Health check
12
+ app.get('/health', (_req, res) => {
13
+ res.json({ status: 'ok' })
14
+ })
18
15
 
19
- // Load modules
20
- await loadKuckitModules({
21
- container,
22
- env: process.env.NODE_ENV ?? 'development',
23
- modules: getModuleSpecs(),
24
- onComplete: () => {
25
- console.log('All modules loaded')
26
- },
27
- })
16
+ // TODO: Kuckit SDK integration will be added in future version
17
+ // See: https://kuckit.dev/docs/getting-started
28
18
 
29
- // Health check
30
- app.get('/health', (_req, res) => {
31
- res.json({ status: 'ok' })
32
- })
33
-
34
- app.listen(port, () => {
35
- console.log(`Server running at http://localhost:${port}`)
36
- })
37
- }
38
-
39
- bootstrap().catch(console.error)
19
+ app.listen(port, () => {
20
+ console.log(`Server running at http://localhost:${port}`)
21
+ })
@@ -7,7 +7,6 @@
7
7
  "check-types": "tsc --noEmit"
8
8
  },
9
9
  "dependencies": {
10
- "@kuckit/sdk-react": "^0.1.0",
11
10
  "@tanstack/react-query": "^5.85.5",
12
11
  "react": "^19.1.0",
13
12
  "react-dom": "^19.1.0"
@@ -1,14 +0,0 @@
1
- import type { ModuleSpec } from '@kuckit/sdk'
2
- import { kuckitModule as usersModule } from '@kuckit/users-module'
3
-
4
- export const getModuleSpecs = (): ModuleSpec[] => {
5
- const modules: ModuleSpec[] = [
6
- { module: usersModule },
7
-
8
- // KUCKIT_MODULES_START
9
- // Modules installed via 'kuckit add' will be added here
10
- // KUCKIT_MODULES_END
11
- ]
12
-
13
- return modules
14
- }