create-nextly-app 0.0.1 → 0.0.2-alpha.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.
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Project type / template selection.
3
+ * "blog" is the first content template added for alpha.
4
+ */
5
+ type ProjectType = "blank" | "blog";
6
+ /**
7
+ * Schema approach selection for content templates.
8
+ * - code-first: Full schema definitions in nextly.config.ts (like Payload CMS)
9
+ * - visual: Empty config, schemas created via Admin Panel UI (like Strapi/WordPress)
10
+ * - both: Core schemas in code, additional schemas creatable via Admin Panel
11
+ */
12
+ type ProjectApproach = "code-first" | "visual";
13
+ /**
14
+ * Supported database types
15
+ */
16
+ type DatabaseType = "postgresql" | "mysql" | "sqlite";
17
+ /**
18
+ * Options for createNextly function
19
+ */
20
+ interface CreateNextlyOptions {
21
+ /** Working directory (defaults to process.cwd()) */
22
+ cwd?: string;
23
+ /** Skip interactive prompts and use defaults */
24
+ defaults?: boolean;
25
+ /** Pre-selected project type / template name */
26
+ projectType?: ProjectType;
27
+ /** Pre-selected database type */
28
+ database?: DatabaseType;
29
+ /** Skip dependency installation (useful for local testing before packages are published) */
30
+ skipInstall?: boolean;
31
+ /** Use yalc for local package installation (for testing before npm publish) */
32
+ useYalc?: boolean;
33
+ /**
34
+ * Project name derived from the CLI's positional `[directory]` argument.
35
+ * Must be a bare directory name (no slashes). Callers pass the basename
36
+ * of the user-provided argument.
37
+ */
38
+ projectNameFromArg?: string;
39
+ /**
40
+ * When true, the CLI was invoked with "." meaning "install in current directory".
41
+ * Different from projectNameFromArg which creates a subdirectory.
42
+ */
43
+ installInCwd?: boolean;
44
+ /** Schema approach for content templates (code-first, visual) */
45
+ approach?: ProjectApproach;
46
+ /** Path to local templates directory (for development, bypasses GitHub download) */
47
+ localTemplatePath?: string;
48
+ /** Git branch for template download from GitHub (defaults to "main") */
49
+ branch?: string;
50
+ }
51
+
52
+ /**
53
+ * Main entry point for scaffolding Nextly in a Next.js project.
54
+ *
55
+ * Two flows:
56
+ * 1. Empty directory -> scaffold Next.js + install Nextly
57
+ * 2. Existing Next.js project -> install Nextly into it
58
+ *
59
+ * Interactive prompt order:
60
+ * 1. Project name (or detect existing project)
61
+ * 2. Template selection (blank, blog, etc.)
62
+ * 3. Schema approach (code-first, visual) — only for content templates
63
+ * 4. Demo content (yes/no) - only for content templates
64
+ * 5. Database selection (sqlite, postgresql, mysql)
65
+ * 6. Database connection string (only for postgresql/mysql)
66
+ */
67
+ declare function createNextly(options?: CreateNextlyOptions): Promise<void>;
68
+
69
+ export { type CreateNextlyOptions, createNextly };
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Project type / template selection.
3
+ * "blog" is the first content template added for alpha.
4
+ */
5
+ type ProjectType = "blank" | "blog";
6
+ /**
7
+ * Schema approach selection for content templates.
8
+ * - code-first: Full schema definitions in nextly.config.ts (like Payload CMS)
9
+ * - visual: Empty config, schemas created via Admin Panel UI (like Strapi/WordPress)
10
+ * - both: Core schemas in code, additional schemas creatable via Admin Panel
11
+ */
12
+ type ProjectApproach = "code-first" | "visual";
13
+ /**
14
+ * Supported database types
15
+ */
16
+ type DatabaseType = "postgresql" | "mysql" | "sqlite";
17
+ /**
18
+ * Options for createNextly function
19
+ */
20
+ interface CreateNextlyOptions {
21
+ /** Working directory (defaults to process.cwd()) */
22
+ cwd?: string;
23
+ /** Skip interactive prompts and use defaults */
24
+ defaults?: boolean;
25
+ /** Pre-selected project type / template name */
26
+ projectType?: ProjectType;
27
+ /** Pre-selected database type */
28
+ database?: DatabaseType;
29
+ /** Skip dependency installation (useful for local testing before packages are published) */
30
+ skipInstall?: boolean;
31
+ /** Use yalc for local package installation (for testing before npm publish) */
32
+ useYalc?: boolean;
33
+ /**
34
+ * Project name derived from the CLI's positional `[directory]` argument.
35
+ * Must be a bare directory name (no slashes). Callers pass the basename
36
+ * of the user-provided argument.
37
+ */
38
+ projectNameFromArg?: string;
39
+ /**
40
+ * When true, the CLI was invoked with "." meaning "install in current directory".
41
+ * Different from projectNameFromArg which creates a subdirectory.
42
+ */
43
+ installInCwd?: boolean;
44
+ /** Schema approach for content templates (code-first, visual) */
45
+ approach?: ProjectApproach;
46
+ /** Path to local templates directory (for development, bypasses GitHub download) */
47
+ localTemplatePath?: string;
48
+ /** Git branch for template download from GitHub (defaults to "main") */
49
+ branch?: string;
50
+ }
51
+
52
+ /**
53
+ * Main entry point for scaffolding Nextly in a Next.js project.
54
+ *
55
+ * Two flows:
56
+ * 1. Empty directory -> scaffold Next.js + install Nextly
57
+ * 2. Existing Next.js project -> install Nextly into it
58
+ *
59
+ * Interactive prompt order:
60
+ * 1. Project name (or detect existing project)
61
+ * 2. Template selection (blank, blog, etc.)
62
+ * 3. Schema approach (code-first, visual) — only for content templates
63
+ * 4. Demo content (yes/no) - only for content templates
64
+ * 5. Database selection (sqlite, postgresql, mysql)
65
+ * 6. Database connection string (only for postgresql/mysql)
66
+ */
67
+ declare function createNextly(options?: CreateNextlyOptions): Promise<void>;
68
+
69
+ export { type CreateNextlyOptions, createNextly };
package/dist/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ import { createRequire } from 'module';
2
+ export { createNextly } from './chunk-AYJ2RKVJ.mjs';
3
+
4
+ createRequire(import.meta.url);
5
+ //# sourceMappingURL=index.mjs.map
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
package/package.json CHANGED
@@ -1,13 +1,86 @@
1
1
  {
2
2
  "name": "create-nextly-app",
3
- "version": "0.0.1",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
3
+ "version": "0.0.2-alpha.1",
4
+ "description": "CLI to scaffold Nextly in your Next.js project",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "dist/index.mjs",
8
+ "module": "dist/index.mjs",
9
+ "types": "dist/index.d.ts",
10
+ "bin": {
11
+ "create-nextly-app": "./bin/create-nextly-app.js"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.cjs"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "bin",
23
+ "templates"
24
+ ],
25
+ "dependencies": {
26
+ "@clack/prompts": "^1.1.0",
27
+ "commander": "^14.0.2",
28
+ "execa": "^9.6.0",
29
+ "fs-extra": "^11.3.0",
30
+ "ora": "^9.0.0",
31
+ "picocolors": "^1.1.1",
32
+ "tar": "^7.4.0"
33
+ },
34
+ "devDependencies": {
35
+ "@types/fs-extra": "^11.0.4",
36
+ "@types/tar": "^6.1.13",
37
+ "@types/node": "^20.19.17",
38
+ "@vitest/coverage-v8": "^4.0.8",
39
+ "@vitest/ui": "^4.0.8",
40
+ "eslint": "^9.34.0",
41
+ "tsup": "^8.5.0",
42
+ "typescript": "^5.9.3",
43
+ "vite-tsconfig-paths": "^5.1.4",
44
+ "vitest": "^4.0.8",
45
+ "@nextlyhq/eslint-config": "0.0.2-alpha.0",
46
+ "@nextlyhq/telemetry": "0.0.2-alpha.0",
47
+ "@nextlyhq/tsconfig": "0.0.2-alpha.0"
48
+ },
49
+ "engines": {
50
+ "node": ">=20.0.0"
8
51
  },
9
- "keywords": [],
10
- "author": "mobeenabdullah",
11
- "license": "ISC",
12
- "type": "commonjs"
13
- }
52
+ "keywords": [
53
+ "nextly",
54
+ "cms",
55
+ "nextjs",
56
+ "cli",
57
+ "scaffold",
58
+ "create-nextly-app",
59
+ "create-app"
60
+ ],
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "git+https://github.com/nextlyhq/nextly.git",
64
+ "directory": "packages/create-nextly-app"
65
+ },
66
+ "publishConfig": {
67
+ "access": "public",
68
+ "registry": "https://registry.npmjs.org/",
69
+ "provenance": true
70
+ },
71
+ "homepage": "https://nextlyhq.com",
72
+ "bugs": {
73
+ "url": "https://github.com/nextlyhq/nextly/issues"
74
+ },
75
+ "author": "Nextly <contact@nextlyhq.com> (https://nextlyhq.com)",
76
+ "scripts": {
77
+ "build": "tsup",
78
+ "dev": "tsup --watch",
79
+ "check-types": "tsc --noEmit",
80
+ "lint": "eslint . --max-warnings 0",
81
+ "lint:fix": "eslint . --fix",
82
+ "test": "vitest run --passWithNoTests",
83
+ "test:watch": "vitest",
84
+ "clean": "rimraf dist"
85
+ }
86
+ }