@makerkit/cli 1.2.1 → 1.2.4
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 +13 -8
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The CLI is a set of commands that help you manage your Makerkit SaaS Starter Kits.
|
|
4
4
|
|
|
5
|
+
The CLI is currently in beta.
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
To install the CLI, you can use npm:
|
|
@@ -23,6 +25,9 @@ Simply replace the examples below with `npx @makerkit/cli@latest` instead of
|
|
|
23
25
|
|
|
24
26
|
Using `npx @makerkit/cli@latest` is recommended.
|
|
25
27
|
|
|
28
|
+
NB: commands that interact with the repository (plugins, i18n, blog) must be
|
|
29
|
+
launched from the root of the repository.
|
|
30
|
+
|
|
26
31
|
## Usage
|
|
27
32
|
|
|
28
33
|
Running the CLI without any arguments will display the help:
|
|
@@ -69,7 +74,7 @@ At the moment of writing, the CLI only uses the OpenAI API to generate:
|
|
|
69
74
|
To create a new Makerkit project, you can use the `new` command:
|
|
70
75
|
|
|
71
76
|
```
|
|
72
|
-
> makerkit new
|
|
77
|
+
> npx @makerkit/cli@latest new
|
|
73
78
|
```
|
|
74
79
|
|
|
75
80
|
The CLI will prompt you to select a starter kit to use and a name. Once
|
|
@@ -87,7 +92,7 @@ The CLI can help you manage plugins in your project. You can list the available
|
|
|
87
92
|
To list the available plugins, you can use the `plugins list` command:
|
|
88
93
|
|
|
89
94
|
```
|
|
90
|
-
> makerkit plugins list
|
|
95
|
+
> npx @makerkit/cli@latest plugins list
|
|
91
96
|
|
|
92
97
|
Available plugins:
|
|
93
98
|
- cookie-banner
|
|
@@ -98,7 +103,7 @@ Available plugins:
|
|
|
98
103
|
To install a plugin, you can use the `plugins install` command:
|
|
99
104
|
|
|
100
105
|
```
|
|
101
|
-
> makerkit plugins install
|
|
106
|
+
> npx @makerkit/cli@latest plugins install
|
|
102
107
|
```
|
|
103
108
|
|
|
104
109
|
This command will prompt you to select a plugin to install. Once selected, the plugin will be installed in your project.
|
|
@@ -108,7 +113,7 @@ This command will prompt you to select a plugin to install. Once selected, the p
|
|
|
108
113
|
To update a plugin, you can use the `plugins update` command:
|
|
109
114
|
|
|
110
115
|
```
|
|
111
|
-
> makerkit plugins update
|
|
116
|
+
> npx @makerkit/cli@latest plugins update
|
|
112
117
|
```
|
|
113
118
|
|
|
114
119
|
This command will prompt you to select a plugin to update. Once selected, the plugin will be updated in your project.
|
|
@@ -124,7 +129,7 @@ in sync between each other.
|
|
|
124
129
|
To translate your i18n files, you can use the `i18n translate` command:
|
|
125
130
|
|
|
126
131
|
```
|
|
127
|
-
> makerkit i18n translate en es
|
|
132
|
+
> npx @makerkit/cli@latest i18n translate en es
|
|
128
133
|
```
|
|
129
134
|
|
|
130
135
|
This command will translate all the keys in your `en/*.json` file to `es/*.
|
|
@@ -136,7 +141,7 @@ add a valid OpenAI API key in the `.env.local` file of your Makerkit repository.
|
|
|
136
141
|
To verify that your i18n files are in sync, you can use the `i18n verify` command:
|
|
137
142
|
|
|
138
143
|
```
|
|
139
|
-
> makerkit i18n verify <base-locale>
|
|
144
|
+
> npx @makerkit/cli@latest i18n verify <base-locale>
|
|
140
145
|
```
|
|
141
146
|
|
|
142
147
|
If you omit the `base-locale` argument, the command will use `en` as the base.
|
|
@@ -152,7 +157,7 @@ NB: this command requires you to setup an OpenAI key.
|
|
|
152
157
|
To generate a new blog post, you can use the `blog generate` command:
|
|
153
158
|
|
|
154
159
|
```
|
|
155
|
-
> makerkit blog generate
|
|
160
|
+
> npx @makerkit/cli@latest blog generate
|
|
156
161
|
```
|
|
157
162
|
|
|
158
163
|
You will be prompted to enter the following information:
|
|
@@ -173,7 +178,7 @@ The CLI can help you manage your licenses.
|
|
|
173
178
|
To activate your Makerkit license, you can use the `license activate` command:
|
|
174
179
|
|
|
175
180
|
```
|
|
176
|
-
> makerkit license activate
|
|
181
|
+
> npx @makerkit/cli@latest license activate
|
|
177
182
|
```
|
|
178
183
|
|
|
179
184
|
This command will prompt you to enter your license key and your Github username. Once entered, the command will activate your license.
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,12 @@ var PluginsModel = {
|
|
|
11
11
|
id: `cookie-banner`,
|
|
12
12
|
branch: `cookie-banner`,
|
|
13
13
|
description: `Add a cookie banner to your site.`
|
|
14
|
+
},
|
|
15
|
+
AiChatBot: {
|
|
16
|
+
name: `AI Chatbot`,
|
|
17
|
+
id: `chatbot`,
|
|
18
|
+
branch: `chatbot`,
|
|
19
|
+
description: `Add an AI Chatbot to your site.`
|
|
14
20
|
}
|
|
15
21
|
};
|
|
16
22
|
function getPluginById(id) {
|
|
@@ -39,7 +45,7 @@ var KitsModel = {
|
|
|
39
45
|
localePath: `public/locales`,
|
|
40
46
|
blogPath: `src/content/posts`,
|
|
41
47
|
repository: `git@github.com:makerkit/next-supabase-saas-kit`,
|
|
42
|
-
plugins: []
|
|
48
|
+
plugins: [PluginsModel.CookieBanner.id, PluginsModel.AiChatBot.id]
|
|
43
49
|
},
|
|
44
50
|
NextJsSupabaseLite: {
|
|
45
51
|
name: `Next.js Supabase Lite`,
|
|
@@ -122,13 +128,10 @@ async function detectKitVersion() {
|
|
|
122
128
|
if (deps.includes("next") && deps.includes("firebase")) {
|
|
123
129
|
return KitsModel.NextJsFirebase;
|
|
124
130
|
}
|
|
125
|
-
if (deps.includes("next") && deps.includes("supabase")) {
|
|
131
|
+
if (deps.includes("next") && deps.includes("@supabase/supabase-js")) {
|
|
126
132
|
return KitsModel.NextJsSupabase;
|
|
127
133
|
}
|
|
128
|
-
if (deps.includes("@remix-run/react") && deps.includes("
|
|
129
|
-
return KitsModel.NextJsSupabaseLite;
|
|
130
|
-
}
|
|
131
|
-
if (deps.includes("@remix-run/react") && deps.includes("supabase")) {
|
|
134
|
+
if (deps.includes("@remix-run/react") && deps.includes("@supabase/supabase-js")) {
|
|
132
135
|
return KitsModel.RemixSupabase;
|
|
133
136
|
}
|
|
134
137
|
throw new Error(
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/blog/generate/generate-blog.command.ts","../src/plugins-model.ts","../src/kits-model.ts","../src/utils/openai-client.ts","../src/utils/workspace.ts","../src/commands/blog/blog.command.ts","../src/commands/i18n/i18n-service.ts","../src/commands/i18n/translate/translate.command.ts","../src/commands/i18n/verify/verify.command.ts","../src/commands/i18n/i18n.command.ts","../src/commands/license/activate/activate-license.command.ts","../src/commands/license/license.command.ts","../src/commands/new/new.command.ts","../src/commands/plugins/plugins-service.ts","../src/commands/plugins/install/install-plugin.command.ts","../src/commands/plugins/list/list-plugins.command.ts","../src/commands/plugins/update/update-plugin.command.ts","../src/commands/plugins/plugins.command.ts","../src/index.ts"],"sourcesContent":["import { join } from 'path';\nimport { KitsModel } from '@/src/kits-model';\nimport getOpenAIClient from '@/src/utils/openai-client';\nimport { Workspace } from '@/src/utils/workspace';\nimport chalk from 'chalk';\nimport { Command } from 'commander';\nimport fs from 'fs-extra';\nimport ora from 'ora';\nimport prompts from 'prompts';\nimport { z } from 'zod';\n\nconst schema = z.object({\n title: z.string().min(1).max(70),\n category: z.string().min(1).max(70),\n wordCount: z.number().min(250).max(2500),\n prompt: z\n .string()\n .optional()\n .transform((value) => value || ''),\n});\n\nexport function generateBlogCommand(parentCommand: Command) {\n return parentCommand\n .command('generate')\n .description('Generate your blog posts with AI')\n .action(async () => {\n const { title, prompt, category, wordCount } = schema.parse(\n await getPrompts()\n );\n\n const content = await generateBlogPost({ title, prompt, wordCount });\n const mdx = await getMdxPostTemplate({ title, category, content });\n\n return writeMdxPostTemplate(mdx, title);\n });\n}\n\nexport function getPrompts() {\n return prompts([\n {\n type: 'text',\n name: 'title',\n message: `Enter your ${chalk.cyan('title')}.`,\n },\n {\n type: 'text',\n name: 'category',\n message: `Enter your ${chalk.cyan(\n 'category'\n )}. If it doesn't exist yet, you will need to add it manually to your blog.`,\n },\n {\n type: 'number',\n name: 'wordCount',\n message: `Enter your target ${chalk.cyan(\n 'word count'\n )} (from 250 words, up to 2500).`,\n },\n {\n type: 'text',\n name: 'prompt',\n message: `Would you like to add your own instructions to the AI? (optional)`,\n },\n ]);\n}\n\nasync function generateBlogPost(params: {\n title: string;\n prompt: string;\n wordCount: number;\n}) {\n const client = getOpenAIClient();\n const prompt = getPostPrompt(params);\n const spinner = ora(`Generating blog post...`).start();\n\n try {\n const response = await client.chat.completions.create({\n model: `gpt-3.5-turbo`,\n messages: [\n {\n role: 'user' as const,\n content: prompt,\n },\n ],\n max_tokens: params.wordCount,\n temperature: 0.7,\n });\n\n const content = response.choices[0].message.content ?? '';\n\n spinner.succeed(`Blog post generated successfully`);\n console.log(`Used ${response.usage?.total_tokens} tokens`);\n\n return content;\n } catch (e) {\n console.error(e);\n spinner.fail(`Failed to generate blog post`);\n process.exit(1);\n }\n}\n\nasync function getMdxPostTemplate(params: {\n title: string;\n category: string;\n content: string;\n}) {\n const kit = await Workspace.getKitMeta();\n const isFirebaseKit = kit.id === KitsModel.NextJsFirebase.id;\n\n // we use different properties for firebase and supabase kits\n const categoryProp = isFirebaseKit ? 'collection' : 'category';\n const descriptionProp = isFirebaseKit ? 'excerpt' : 'description';\n const imageProp = isFirebaseKit ? 'coverImage' : 'image';\n\n return `\n---\ntitle: \"${params.title}\"\n${categoryProp}: \"${params.category}\"\ndate: \"${new Date().toISOString()}\"\n${descriptionProp}: \"\"\nlive: false\n${imageProp}: \"\"\n---\n\n${params.content}\n`.trim();\n}\n\nasync function writeMdxPostTemplate(template: string, title: string) {\n const kit = await Workspace.getKitMeta();\n const spinner = ora(`Storing blog post...`).start();\n\n try {\n let blogPath = kit.blogPath;\n\n // when the kit does not have a blog path, we ask the user to provide one\n // this is the case for the Remix kits\n if (!blogPath) {\n blogPath = await prompts({\n type: 'text',\n name: 'blogPath',\n message: `This kit does not support blog posts yet. You can still generate a blog post, but you'll need to manually add it to your blog. Please enter your blog path (e.g. src/content/posts). The path needs to exist.`,\n }).then((response) => response.blogPath as string);\n }\n\n const slug = slugify(title);\n const path = join(process.cwd(), blogPath, `${slug}.mdx`);\n\n await fs.writeFile(path, template);\n\n spinner.succeed(`Blog post stored successfully`);\n } catch (e) {\n console.error(e);\n\n spinner.fail(`Failed to store blog post`);\n }\n}\n\nfunction getPostPrompt(params: {\n title: string;\n prompt: string;\n wordCount: number;\n}) {\n return `\n Generate a professional blog post with title \"${params.title}\".\n Rules:\n \n- The post must be below ${params.wordCount} words\n- Output text using valid Markdown\n- Write professional text while balancing simplicity and complexity in your language and sentence structures.\n- Be an extremely smart, interesting, funny, witty, and confident writer. Readers admire you! \n- Use several paragraphs and an accurate level 2 and 3 headings before each paragraph to maximize readability.\n- Do include level 4 headings (h4) to break complex paragraphs\n- Ensure that headings do not include decimals or numbers with periods. Ensure they're formatted using Markdown.\n- Repeat the main keywords and phrases often for SEO\n \n ${params.prompt ?? ''}\n`.trim();\n}\n\nfunction slugify(text: string) {\n return (text ?? '')\n .toString()\n .normalize('NFKD')\n .toLowerCase()\n .trim()\n .replace(/\\_/g, '-')\n .replace(/\\s+/g, '-')\n .replace(/\\-\\-+/g, '--')\n .replace(/\\_$/g, '');\n}\n","import invariant from 'tiny-invariant';\n\nexport const PluginsModel = {\n CookieBanner: {\n name: `Cookie Banner`,\n id: `cookie-banner`,\n branch: `cookie-banner`,\n description: `Add a cookie banner to your site.`,\n },\n};\n\nexport function getPluginById(id: string) {\n return Object.values(PluginsModel).find((plugin) => plugin.id === id);\n}\n\nexport function validatePlugin(pluginId: string) {\n const plugin = getPluginById(pluginId);\n\n invariant(plugin, `Plugin ${pluginId} not found`);\n\n return plugin;\n}\n","import { PluginsModel } from '@/src/plugins-model';\nimport invariant from 'tiny-invariant';\n\nexport const KitsModel = {\n NextJsFirebase: {\n name: `Next.js Firebase`,\n id: `next-firebase`,\n repository: `git@github.com:makerkit/next-firebase-saas-kit`,\n blogPath: `_posts`,\n localePath: `public/locales`,\n plugins: [PluginsModel.CookieBanner.id],\n },\n NextJsSupabase: {\n name: `Next.js Supabase`,\n id: `next-supabase`,\n localePath: `public/locales`,\n blogPath: `src/content/posts`,\n repository: `git@github.com:makerkit/next-supabase-saas-kit`,\n plugins: [],\n },\n NextJsSupabaseLite: {\n name: `Next.js Supabase Lite`,\n id: `next-supabase-lite`,\n localePath: `public/locales`,\n blogPath: `src/content/posts`,\n repository: `git@github.com:makerkit/next-supabase-saas-kit-lite`,\n plugins: [],\n },\n RemixFirebase: {\n name: `Remix Firebase`,\n id: `remix-firebase`,\n localePath: `public/locales`,\n blogPath: '',\n repository: `git@github.com:makerkit/remix-firebase-saas-kit`,\n plugins: [],\n },\n RemixSupabase: {\n name: `Remix Supabase`,\n id: `remix-supabase`,\n localePath: `public/locales`,\n blogPath: '',\n repository: `git@github.com:makerkit/remix-supabase-saas-kit`,\n plugins: [],\n },\n};\n\nexport function getKitById(id: string) {\n return Object.values(KitsModel).find((kit) => kit.id === id);\n}\n\nexport function validateKit(kitId: string) {\n const kit = getKitById(kitId);\n\n invariant(kit, `Kit ${kitId} not found`);\n\n return kit;\n}\n","import OpenAI from 'openai';\n\nfunction getOpenAIClient() {\n const apiKey = process.env.OPENAI_API_KEY;\n\n if (!apiKey) {\n throw new Error(\n 'OPENAI_API_KEY env variable is not set. Please set it in' +\n ' your .env.local file of your Makerkit workspace.'\n );\n }\n\n return new OpenAI({ apiKey });\n}\n\nexport default getOpenAIClient;\n","import { join } from 'path';\nimport { KitsModel } from '@/src/kits-model';\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\n\nexport class Workspace {\n static async getKitMeta() {\n const packageJson = await getPackageJson();\n const kit = await detectKitVersion();\n\n return {\n ...kit,\n version: packageJson.version,\n };\n }\n\n static async logWorkspaceInfo() {\n const meta = await Workspace.getKitMeta();\n\n console.log(\n `Makerkit version: ${chalk.cyan(meta.name)} - ${chalk.cyan(\n meta.version\n )}.\\n`\n );\n }\n}\n\nasync function detectKitVersion() {\n const packageJson = await getPackageJson();\n\n if (!packageJson) {\n throw new Error(\n 'No package.json found. Please run this command in a Makerkit workspace.'\n );\n }\n\n const deps = Object.keys(packageJson.dependencies ?? []);\n\n if (deps.includes('next') && deps.includes('firebase')) {\n return KitsModel.NextJsFirebase;\n }\n\n if (deps.includes('next') && deps.includes('supabase')) {\n return KitsModel.NextJsSupabase;\n }\n\n if (deps.includes('@remix-run/react') && deps.includes('firebase')) {\n return KitsModel.NextJsSupabaseLite;\n }\n\n if (deps.includes('@remix-run/react') && deps.includes('supabase')) {\n return KitsModel.RemixSupabase;\n }\n\n throw new Error(\n 'Could not detect Makerkit workspace. Please run this command in a Makerkit workspace.'\n );\n}\n\nasync function getPackageJson(): Promise<Record<string, unknown>> {\n return fs\n .readJSON(join(process.cwd(), 'package.json'))\n .catch(() => undefined);\n}\n","import { generateBlogCommand } from '@/src/commands/blog/generate/generate-blog.command';\nimport { Workspace } from '@/src/utils/workspace';\nimport { Command } from 'commander';\n\nexport const blogCommand = new Command()\n .name('blog')\n .description('Manage and generate your blog posts')\n .hook('preAction', () => {\n return Workspace.logWorkspaceInfo();\n });\n\n// set children commands\ngenerateBlogCommand(blogCommand);\n","import { join } from 'path';\nimport getOpenAIClient from '@/src/utils/openai-client';\nimport { Workspace } from '@/src/utils/workspace';\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport OpenAI from 'openai';\n\ntype NestedKey = Record<string, string | Record<string, string>>;\n\nexport class I18nService {\n /**\n * @name verify\n * @description Verifies if the locale files are in sync\n */\n static async verify(base = 'en') {\n const kit = await Workspace.getKitMeta();\n\n const allLocales = fs.readdirSync(kit.localePath).filter((locale) => {\n return locale !== base;\n });\n\n const baseLocaleFolderPath = `${kit.localePath}/${base}`;\n\n const localeFiles = fs.readdirSync(baseLocaleFolderPath).filter((file) => {\n return file.endsWith('.json');\n });\n\n for (const localeFile of localeFiles) {\n for (const locale of allLocales) {\n const baseLocaleFilePath = `${baseLocaleFolderPath}/${localeFile}`;\n const targetLocaleFilePath = `${kit.localePath}/${locale}/${localeFile}`;\n\n const baseLocaleFile = fs.readJSONSync(baseLocaleFilePath);\n const file = fs.readJSONSync(targetLocaleFilePath);\n\n const missingKeys = collectMissingKeys([baseLocaleFile, file]);\n\n if (!missingKeys.length) {\n console.log(\n chalk.green(`Locale ${locale}/${localeFile} is in sync!`)\n );\n\n continue;\n }\n\n console.log(\n chalk.yellow(\n `Locale ${locale}/${localeFile} is missing the following keys: ${missingKeys.join(\n ', '\n )}`\n )\n );\n }\n }\n }\n\n /**\n * @name translate\n * @description Translates the locale files from source to target\n * @param source\n * @param target\n */\n static async translate(source: string, target: string) {\n const kit = await Workspace.getKitMeta();\n const client = getOpenAIClient();\n\n const targetJsonPath = `${kit.localePath}/${target}`;\n const sourceLocalePath = `${kit.localePath}/${source}`;\n\n const sourceLocale = await fs.exists(sourceLocalePath);\n\n if (!sourceLocale) {\n throw new Error(`Source locale at ${sourceLocalePath} not found`);\n }\n\n const files = fs.readdirSync(sourceLocalePath).filter((file) => {\n return file.endsWith('.json');\n });\n\n console.log(`Found the following files: ${files.join(', ')}`);\n\n for (const file of files) {\n const data: Record<string, string | Record<string, string | NestedKey>> =\n {};\n\n const localeFile = fs.readJSONSync(join(sourceLocalePath, file));\n\n console.log(\n chalk.cyan(`Translating \"${file}\". This can take a while...`)\n );\n\n for (const key in localeFile) {\n data[key] = await translateKey(source, target, localeFile[key], client);\n }\n\n console.log(chalk.green(`File \"${file}\" successfully translated!`));\n console.log(chalk.cyan(`Writing file \"${file}\" to ${targetJsonPath}`));\n\n // check if targetJsonPath exists, if not, create it\n (await fs.exists(targetJsonPath)) || (await fs.mkdir(targetJsonPath));\n\n // write file to targetJsonPath\n await fs.writeJSON(join(targetJsonPath, file), data, {});\n\n console.log(chalk.green(`File \"${file}\" successfully written!`));\n }\n }\n}\n\nasync function translateKey(\n source: string,\n target: string,\n key: string | NestedKey,\n client: OpenAI\n) {\n if (typeof key === 'string') {\n return translateString(source, target, key, client);\n }\n\n const data: Record<string, string | NestedKey> = {};\n\n for (const k in key) {\n data[k] = (await translateKey(source, target, key[k], client)) as NestedKey;\n }\n\n return data;\n}\n\nasync function translateString(\n source: string,\n target: string,\n key: string,\n client: OpenAI\n) {\n // skip empty or short keys\n if (!key.trim() || key.length <= 1) {\n return '';\n }\n\n const response = await client.chat.completions.create({\n model: 'gpt-3.5-turbo',\n max_tokens: target.split(' ').length + 50,\n temperature: 0.3,\n messages: [\n {\n role: 'user',\n content: `Translate the text from locale ${source} to ${target}. Text: ${key}. Translation:`,\n },\n ],\n });\n\n return response.choices[0].message.content ?? '';\n}\n\ntype JSONObject = { [key: string]: any };\n\nfunction collectMissingKeys(objects: JSONObject[]): string[] {\n const allKeys: string[] = [];\n\n objects.forEach((obj) => {\n Object.keys(obj).forEach((key) => {\n if (!allKeys.includes(key)) {\n allKeys.push(key);\n }\n });\n });\n\n const missingKeys: string[] = [];\n\n objects.forEach((obj) => {\n allKeys.forEach((key) => {\n if (!Object.keys(obj).includes(key)) {\n missingKeys.push(key);\n }\n });\n });\n\n return missingKeys;\n}\n","import { I18nService } from '@/src/commands/i18n/i18n-service';\nimport chalk from 'chalk';\nimport { Command } from 'commander';\nimport prompts from 'prompts';\n\nexport function createTranslateI18nCommand(parentCommand: Command) {\n return parentCommand\n .command('translate')\n .argument('[source-locale]', 'Source Locale')\n .argument('[target-locale]', 'Target Locale')\n .description('Translate i18n files from source locale to target locale')\n .action(async (sourceLocale, targetLocale) => {\n const locales = await promptLocales(sourceLocale, targetLocale);\n\n await I18nService.translate(locales.sourceLocale, locales.targetLocale);\n });\n}\n\nasync function promptLocales(maybeSource?: string, maybeTarget?: string) {\n const hint = 'e.g. en, fr, es, etc.';\n\n const sourceLocale =\n maybeSource ||\n (\n await prompts([\n {\n type: 'text',\n name: 'locale',\n message: `Enter your ${chalk.cyan('Source Locale')}. ${hint}`,\n hint,\n },\n ])\n ).locale;\n\n const targetLocale =\n maybeTarget ||\n (\n await prompts([\n {\n type: 'text',\n name: 'locale',\n message: `Enter your ${chalk.cyan('Target Locale')}. ${hint}`,\n hint,\n },\n ])\n ).locale;\n\n return {\n sourceLocale,\n targetLocale,\n };\n}\n","import { I18nService } from '@/src/commands/i18n/i18n-service';\nimport { Command } from 'commander';\n\nexport function createVerifyI18nCommand(parentCommand: Command) {\n return parentCommand\n .command('verify')\n .argument('[base-locale]', 'Base Locale')\n .description(\n 'Verify i18n files have no missing keys compared to base locale'\n )\n .action(async (baseLocale = 'en') => {\n await I18nService.verify(baseLocale);\n });\n}\n","import { createTranslateI18nCommand } from '@/src/commands/i18n/translate/translate.command';\nimport { createVerifyI18nCommand } from '@/src/commands/i18n/verify/verify.command';\nimport { Workspace } from '@/src/utils/workspace';\nimport { Command } from 'commander';\n\nexport const i18nCommand = new Command()\n .name('i18n')\n .description('Manage and translate your i18n files')\n .hook('preAction', () => {\n return Workspace.logWorkspaceInfo();\n });\n\n// set children commands\ncreateTranslateI18nCommand(i18nCommand);\ncreateVerifyI18nCommand(i18nCommand);\n","import chalk from 'chalk';\nimport { Command } from 'commander';\nimport ora from 'ora';\nimport prompts from 'prompts';\nimport { z } from 'zod';\n\nconst schema = z.object({\n licenseKey: z.string().min(1).max(32),\n githubUsername: z.string().min(1).max(64),\n});\n\nexport function createActivateLicenseCommand(parentCommand: Command) {\n return parentCommand\n .command('activate')\n .description('Activate your license key for MakerKit')\n .action(async () => {\n const params = await prompts([\n {\n type: 'text',\n name: 'licenseKey',\n message: `Enter your ${chalk.cyan('License Key')}.`,\n validate: (value) => {\n if (value.length < 1) {\n return `Please enter a valid license key`;\n }\n\n return true;\n },\n },\n {\n type: 'text',\n name: 'githubUsername',\n message: `Enter your ${chalk.cyan('Github username')}.`,\n validate: (value) => {\n if (value.length < 1) {\n return `Please enter a valid username`;\n }\n\n return true;\n },\n },\n ]);\n\n const spinner = ora(`Activating license...`).start();\n\n const onError = () => {\n spinner.fail(`Failed to activate license`);\n process.exit(1);\n };\n\n try {\n const response = await activateLicense(schema.parse(params));\n\n if (!response.ok) {\n return onError();\n }\n\n spinner.succeed(`License activated successfully`);\n } catch (e) {\n onError();\n }\n });\n}\n\nasync function activateLicense(params: {\n licenseKey: string;\n githubUsername: string;\n}) {\n return fetch(`https://makerkit.dev/api/ls/license/activate`, {\n method: 'POST',\n body: JSON.stringify(params),\n });\n}\n","import { createActivateLicenseCommand } from '@/src/commands/license/activate/activate-license.command';\nimport { Command } from 'commander';\n\nexport const licenseCommand = new Command()\n .name('license')\n .description('Manage Licenses');\n\ncreateActivateLicenseCommand(licenseCommand);\n","import { join } from 'path';\nimport { KitsModel, validateKit } from '@/src/kits-model';\nimport chalk from 'chalk';\nimport { Command } from 'commander';\nimport { execa } from 'execa';\nimport ora from 'ora';\nimport prompts from 'prompts';\n\nexport const newCommand = new Command()\n .name('new')\n .description('Initialize a new Makerkit project')\n .action(async () => {\n const choices = Object.values(KitsModel).map((kit) => {\n return {\n title: kit.name,\n value: kit.id,\n };\n });\n\n const { kit, name: projectName } = await prompts([\n {\n type: 'select',\n name: 'kit',\n message: `Select the ${chalk.cyan(`SaaS Kit`)} you want to clone`,\n choices,\n },\n {\n type: 'text',\n name: 'name',\n message: `Enter your ${chalk.cyan('Project Name')}.`,\n },\n ]);\n\n const { repository, name: kitName } = validateKit(kit);\n\n const { confirm } = await prompts([\n {\n type: 'confirm',\n name: 'confirm',\n message: `Are you sure you want to clone ${chalk.cyan(\n kitName\n )} to ${chalk.cyan(projectName)}?`,\n },\n ]);\n\n if (!confirm) {\n console.log('Aborting...');\n process.exit(0);\n }\n\n // pull repository from github\n await pullFromGithub(repository, kitName, projectName);\n\n // install dependencies\n await installDependencies(projectName);\n });\n\nasync function pullFromGithub(\n repository: string,\n kit: string,\n projectName: string\n) {\n const spinner = ora(`Cloning ${kit}...`).start();\n\n try {\n await execa('git', ['clone', repository, projectName]);\n\n spinner.succeed(`Cloned ${kit} to ${projectName}...`);\n } catch (e) {\n console.error(e);\n spinner.fail(`Failed to clone ${kit}`);\n\n return Promise.reject(`Failed to clone ${kit}`);\n }\n}\n\nasync function installDependencies(projectName: string) {\n const cwd = join(process.cwd(), projectName);\n const spinner = ora(`Installing dependencies. Please wait...`).start();\n\n try {\n await execa('npm', ['install'], { cwd });\n\n spinner.succeed(`Dependencies successfully installed!`);\n\n console.log(\n `🎉 You can now get started. Open the project in your IDE and read the README.md file for more information.`\n );\n } catch (e) {\n console.error(e);\n spinner.fail(`Failed to install dependencies`);\n\n return Promise.reject(`Failed to install dependencies`);\n }\n}\n","import { validateKit } from '@/src/kits-model';\nimport { PluginsModel, validatePlugin } from '@/src/plugins-model';\nimport { Workspace } from '@/src/utils/workspace';\nimport chalk from 'chalk';\nimport { execaCommand } from 'execa';\nimport ora from 'ora';\nimport prompts from 'prompts';\n\nenum PluginAction {\n Add = 'add',\n Pull = 'pull',\n}\n\nexport class PluginsService {\n static async install(pluginId?: string) {\n const action = PluginAction.Add;\n const plugin = pluginId || (await getPluginFromPrompts(action));\n\n await initPluginCommand(plugin, action);\n }\n\n static async pull(pluginId?: string) {\n const action = PluginAction.Pull;\n const plugin = pluginId || (await getPluginFromPrompts(action));\n\n await initPluginCommand(plugin, action);\n }\n}\n\nasync function initPluginCommand(pluginId: string, action: PluginAction) {\n const { id: kitId } = await Workspace.getKitMeta();\n\n const plugin = validatePlugin(pluginId);\n const kit = validateKit(kitId);\n\n if (!(kit.plugins as string[]).includes(plugin.id)) {\n throw new Error(\n `Plugin ${plugin.name} is not compatible with kit ${kit.name}`\n );\n }\n\n const repository = buildPluginRepositoryName(kit.repository);\n const verb = action === PluginAction.Add ? 'Installing' : 'Updating';\n\n console.log(\n `${verb} ${chalk.cyan(plugin.name)} to kit ${chalk.cyan(\n kit.name\n )} using repo: ${repository} ...`\n );\n\n return executePluginCommand({\n action,\n repository,\n branch: plugin.branch,\n folder: `plugins/${plugin.branch}`,\n });\n}\n\nasync function getPluginFromPrompts(action: PluginAction) {\n const choices = Object.values(PluginsModel).map((plugin) => {\n return {\n title: plugin.name,\n value: plugin.id,\n };\n });\n\n const verb = action === PluginAction.Add ? 'install' : 'update';\n\n const { plugin } = await prompts([\n {\n type: 'select',\n name: 'plugin',\n message: `Which ${chalk.cyan('Plugin')} would you like to ${verb}?`,\n choices,\n },\n ]);\n\n return plugin;\n}\n\n// the plugin repository name is the kit repository name + `-plugins`\nfunction buildPluginRepositoryName(repository: string) {\n return repository + `-plugins.git`;\n}\n\nasync function executePluginCommand({\n action,\n repository,\n branch,\n folder,\n}: {\n action: PluginAction;\n repository: string;\n branch: string;\n folder: string;\n}) {\n const verb = action === PluginAction.Add ? 'Installing' : 'Updating';\n const spinner = ora(`${verb} plugin...`).start();\n const commandString = `git subtree ${action} --prefix ${folder} ${repository} ${branch} --squash`;\n\n try {\n await execaCommand(commandString);\n\n const verb = action === PluginAction.Add ? 'installed' : 'updated';\n spinner.succeed(`Plugin ${verb} at ${folder}`);\n } catch (e) {\n console.error(e);\n\n const verb = action === PluginAction.Add ? 'installation' : 'update';\n spinner.fail(`Plugin ${verb} failed`);\n }\n}\n","import { PluginsService } from '@/src/commands/plugins/plugins-service';\nimport { Command } from 'commander';\n\nexport function createInstallPluginCommand(parentCommand: Command) {\n return parentCommand\n .command('install')\n .argument('[plugin-id]', 'Plugin id')\n .description('Install plugin')\n .action(async (maybePluginId) => {\n await PluginsService.install(maybePluginId);\n });\n}\n","import { KitsModel } from '@/src/kits-model';\nimport { validatePlugin } from '@/src/plugins-model';\nimport chalk from 'chalk';\nimport { Command } from 'commander';\n\nexport function createListPluginsCommand(parentCommand: Command) {\n return parentCommand\n .command('list')\n .description('List available plugins.')\n .action(() => {\n const kits = Object.values(KitsModel);\n\n for (const kit of kits) {\n console.log(`${chalk.cyan(kit.name)}`);\n\n if (!kit.plugins.length) {\n console.log(chalk.yellow(`- No plugins available`) + '\\n');\n\n continue;\n }\n\n for (const plugin of kit.plugins) {\n const { name } = validatePlugin(plugin);\n console.log(`- ${chalk.green(name)}`);\n }\n\n console.log('');\n }\n });\n}\n","import { PluginsService } from '@/src/commands/plugins/plugins-service';\nimport { Command } from 'commander';\n\nexport function createUpdatePluginCommand(parentCommand: Command) {\n return parentCommand\n .command('update')\n .argument('[plugin-id]', 'Plugin id')\n .description('Update plugin to the latest version')\n .action(async (maybePluginId) => {\n await PluginsService.pull(maybePluginId);\n });\n}\n","import { createInstallPluginCommand } from '@/src/commands/plugins/install/install-plugin.command';\nimport { createListPluginsCommand } from '@/src/commands/plugins/list/list-plugins.command';\nimport { createUpdatePluginCommand } from '@/src/commands/plugins/update/update-plugin.command';\nimport { Workspace } from '@/src/utils/workspace';\nimport { Command } from 'commander';\n\nexport const pluginsCommand = new Command()\n .name('plugins')\n .description('List and install plugins.')\n .hook('preAction', () => {\n return Workspace.logWorkspaceInfo();\n });\n\n// set children commands\ncreateListPluginsCommand(pluginsCommand);\ncreateInstallPluginCommand(pluginsCommand);\ncreateUpdatePluginCommand(pluginsCommand);\n","#!/usr/bin/env node\nimport { blogCommand } from '@/src/commands/blog/blog.command';\nimport { i18nCommand } from '@/src/commands/i18n/i18n.command';\nimport { licenseCommand } from '@/src/commands/license/license.command';\nimport { newCommand } from '@/src/commands/new/new.command';\nimport { pluginsCommand } from '@/src/commands/plugins/plugins.command';\nimport { Command } from 'commander';\nimport { config } from 'dotenv';\n\nconfig({\n path: '.env.local',\n});\n\nprocess.on('SIGINT', () => process.exit(0));\nprocess.on('SIGTERM', () => process.exit(0));\n\nasync function main() {\n const program = new Command()\n .name('makerkit')\n .description(\n 'Your SaaS Kit companion. Add plugins, manage migrations, and more.'\n )\n .version('-v, --version', 'display the version number');\n\n program\n .addCommand(newCommand)\n .addCommand(pluginsCommand)\n .addCommand(i18nCommand)\n .addCommand(licenseCommand)\n .addCommand(blogCommand);\n\n program.parse();\n}\n\nvoid main();\n"],"mappings":";;;AAAA,SAAS,QAAAA,aAAY;;;ACArB,OAAO,eAAe;AAEf,IAAM,eAAe;AAAA,EAC1B,cAAc;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B,SAAO,UAAU,iBAAiB;AACpC,CAAC;AAGH,yBAAyB,cAAc;AACvC,2BAA2B,cAAc;AACzC,0BAA0B,cAAc;;;ACVxC,SAAS,WAAAC,gBAAe;AACxB,SAAS,cAAc;AAEvB,OAAO;AAAA,EACL,MAAM;AACR,CAAC;AAED,QAAQ,GAAG,UAAU,MAAM,QAAQ,KAAK,CAAC,CAAC;AAC1C,QAAQ,GAAG,WAAW,MAAM,QAAQ,KAAK,CAAC,CAAC;AAE3C,eAAe,OAAO;AACpB,QAAM,UAAU,IAAIA,SAAQ,EACzB,KAAK,UAAU,EACf;AAAA,IACC;AAAA,EACF,EACC,QAAQ,iBAAiB,4BAA4B;AAExD,UACG,WAAW,UAAU,EACrB,WAAW,cAAc,EACzB,WAAW,WAAW,EACtB,WAAW,cAAc,EACzB,WAAW,WAAW;AAEzB,UAAQ,MAAM;AAChB;AAEA,KAAK,KAAK;","names":["join","invariant","chalk","fs","join","join","chalk","fs","join","chalk","prompts","Command","chalk","ora","prompts","z","schema","Command","join","chalk","Command","ora","prompts","kit","join","chalk","ora","prompts","chalk","plugin","prompts","ora","verb","chalk","Command","Command"]}
|
|
1
|
+
{"version":3,"sources":["../src/commands/blog/generate/generate-blog.command.ts","../src/plugins-model.ts","../src/kits-model.ts","../src/utils/openai-client.ts","../src/utils/workspace.ts","../src/commands/blog/blog.command.ts","../src/commands/i18n/i18n-service.ts","../src/commands/i18n/translate/translate.command.ts","../src/commands/i18n/verify/verify.command.ts","../src/commands/i18n/i18n.command.ts","../src/commands/license/activate/activate-license.command.ts","../src/commands/license/license.command.ts","../src/commands/new/new.command.ts","../src/commands/plugins/plugins-service.ts","../src/commands/plugins/install/install-plugin.command.ts","../src/commands/plugins/list/list-plugins.command.ts","../src/commands/plugins/update/update-plugin.command.ts","../src/commands/plugins/plugins.command.ts","../src/index.ts"],"sourcesContent":["import { join } from 'path';\nimport { KitsModel } from '@/src/kits-model';\nimport getOpenAIClient from '@/src/utils/openai-client';\nimport { Workspace } from '@/src/utils/workspace';\nimport chalk from 'chalk';\nimport { Command } from 'commander';\nimport fs from 'fs-extra';\nimport ora from 'ora';\nimport prompts from 'prompts';\nimport { z } from 'zod';\n\nconst schema = z.object({\n title: z.string().min(1).max(70),\n category: z.string().min(1).max(70),\n wordCount: z.number().min(250).max(2500),\n prompt: z\n .string()\n .optional()\n .transform((value) => value || ''),\n});\n\nexport function generateBlogCommand(parentCommand: Command) {\n return parentCommand\n .command('generate')\n .description('Generate your blog posts with AI')\n .action(async () => {\n const { title, prompt, category, wordCount } = schema.parse(\n await getPrompts()\n );\n\n const content = await generateBlogPost({ title, prompt, wordCount });\n const mdx = await getMdxPostTemplate({ title, category, content });\n\n return writeMdxPostTemplate(mdx, title);\n });\n}\n\nexport function getPrompts() {\n return prompts([\n {\n type: 'text',\n name: 'title',\n message: `Enter your ${chalk.cyan('title')}.`,\n },\n {\n type: 'text',\n name: 'category',\n message: `Enter your ${chalk.cyan(\n 'category'\n )}. If it doesn't exist yet, you will need to add it manually to your blog.`,\n },\n {\n type: 'number',\n name: 'wordCount',\n message: `Enter your target ${chalk.cyan(\n 'word count'\n )} (from 250 words, up to 2500).`,\n },\n {\n type: 'text',\n name: 'prompt',\n message: `Would you like to add your own instructions to the AI? (optional)`,\n },\n ]);\n}\n\nasync function generateBlogPost(params: {\n title: string;\n prompt: string;\n wordCount: number;\n}) {\n const client = getOpenAIClient();\n const prompt = getPostPrompt(params);\n const spinner = ora(`Generating blog post...`).start();\n\n try {\n const response = await client.chat.completions.create({\n model: `gpt-3.5-turbo`,\n messages: [\n {\n role: 'user' as const,\n content: prompt,\n },\n ],\n max_tokens: params.wordCount,\n temperature: 0.7,\n });\n\n const content = response.choices[0].message.content ?? '';\n\n spinner.succeed(`Blog post generated successfully`);\n console.log(`Used ${response.usage?.total_tokens} tokens`);\n\n return content;\n } catch (e) {\n console.error(e);\n spinner.fail(`Failed to generate blog post`);\n process.exit(1);\n }\n}\n\nasync function getMdxPostTemplate(params: {\n title: string;\n category: string;\n content: string;\n}) {\n const kit = await Workspace.getKitMeta();\n const isFirebaseKit = kit.id === KitsModel.NextJsFirebase.id;\n\n // we use different properties for firebase and supabase kits\n const categoryProp = isFirebaseKit ? 'collection' : 'category';\n const descriptionProp = isFirebaseKit ? 'excerpt' : 'description';\n const imageProp = isFirebaseKit ? 'coverImage' : 'image';\n\n return `\n---\ntitle: \"${params.title}\"\n${categoryProp}: \"${params.category}\"\ndate: \"${new Date().toISOString()}\"\n${descriptionProp}: \"\"\nlive: false\n${imageProp}: \"\"\n---\n\n${params.content}\n`.trim();\n}\n\nasync function writeMdxPostTemplate(template: string, title: string) {\n const kit = await Workspace.getKitMeta();\n const spinner = ora(`Storing blog post...`).start();\n\n try {\n let blogPath = kit.blogPath;\n\n // when the kit does not have a blog path, we ask the user to provide one\n // this is the case for the Remix kits\n if (!blogPath) {\n blogPath = await prompts({\n type: 'text',\n name: 'blogPath',\n message: `This kit does not support blog posts yet. You can still generate a blog post, but you'll need to manually add it to your blog. Please enter your blog path (e.g. src/content/posts). The path needs to exist.`,\n }).then((response) => response.blogPath as string);\n }\n\n const slug = slugify(title);\n const path = join(process.cwd(), blogPath, `${slug}.mdx`);\n\n await fs.writeFile(path, template);\n\n spinner.succeed(`Blog post stored successfully`);\n } catch (e) {\n console.error(e);\n\n spinner.fail(`Failed to store blog post`);\n }\n}\n\nfunction getPostPrompt(params: {\n title: string;\n prompt: string;\n wordCount: number;\n}) {\n return `\n Generate a professional blog post with title \"${params.title}\".\n Rules:\n \n- The post must be below ${params.wordCount} words\n- Output text using valid Markdown\n- Write professional text while balancing simplicity and complexity in your language and sentence structures.\n- Be an extremely smart, interesting, funny, witty, and confident writer. Readers admire you! \n- Use several paragraphs and an accurate level 2 and 3 headings before each paragraph to maximize readability.\n- Do include level 4 headings (h4) to break complex paragraphs\n- Ensure that headings do not include decimals or numbers with periods. Ensure they're formatted using Markdown.\n- Repeat the main keywords and phrases often for SEO\n \n ${params.prompt ?? ''}\n`.trim();\n}\n\nfunction slugify(text: string) {\n return (text ?? '')\n .toString()\n .normalize('NFKD')\n .toLowerCase()\n .trim()\n .replace(/\\_/g, '-')\n .replace(/\\s+/g, '-')\n .replace(/\\-\\-+/g, '--')\n .replace(/\\_$/g, '');\n}\n","import invariant from 'tiny-invariant';\n\nexport const PluginsModel = {\n CookieBanner: {\n name: `Cookie Banner`,\n id: `cookie-banner`,\n branch: `cookie-banner`,\n description: `Add a cookie banner to your site.`,\n },\n AiChatBot: {\n name: `AI Chatbot`,\n id: `chatbot`,\n branch: `chatbot`,\n description: `Add an AI Chatbot to your site.`,\n },\n};\n\nexport function getPluginById(id: string) {\n return Object.values(PluginsModel).find((plugin) => plugin.id === id);\n}\n\nexport function validatePlugin(pluginId: string) {\n const plugin = getPluginById(pluginId);\n\n invariant(plugin, `Plugin ${pluginId} not found`);\n\n return plugin;\n}\n","import { PluginsModel } from '@/src/plugins-model';\nimport invariant from 'tiny-invariant';\n\nexport const KitsModel = {\n NextJsFirebase: {\n name: `Next.js Firebase`,\n id: `next-firebase`,\n repository: `git@github.com:makerkit/next-firebase-saas-kit`,\n blogPath: `_posts`,\n localePath: `public/locales`,\n plugins: [PluginsModel.CookieBanner.id],\n },\n NextJsSupabase: {\n name: `Next.js Supabase`,\n id: `next-supabase`,\n localePath: `public/locales`,\n blogPath: `src/content/posts`,\n repository: `git@github.com:makerkit/next-supabase-saas-kit`,\n plugins: [PluginsModel.CookieBanner.id, PluginsModel.AiChatBot.id],\n },\n NextJsSupabaseLite: {\n name: `Next.js Supabase Lite`,\n id: `next-supabase-lite`,\n localePath: `public/locales`,\n blogPath: `src/content/posts`,\n repository: `git@github.com:makerkit/next-supabase-saas-kit-lite`,\n plugins: [],\n },\n RemixFirebase: {\n name: `Remix Firebase`,\n id: `remix-firebase`,\n localePath: `public/locales`,\n blogPath: '',\n repository: `git@github.com:makerkit/remix-firebase-saas-kit`,\n plugins: [],\n },\n RemixSupabase: {\n name: `Remix Supabase`,\n id: `remix-supabase`,\n localePath: `public/locales`,\n blogPath: '',\n repository: `git@github.com:makerkit/remix-supabase-saas-kit`,\n plugins: [],\n },\n};\n\nexport function getKitById(id: string) {\n return Object.values(KitsModel).find((kit) => kit.id === id);\n}\n\nexport function validateKit(kitId: string) {\n const kit = getKitById(kitId);\n\n invariant(kit, `Kit ${kitId} not found`);\n\n return kit;\n}\n","import OpenAI from 'openai';\n\nfunction getOpenAIClient() {\n const apiKey = process.env.OPENAI_API_KEY;\n\n if (!apiKey) {\n throw new Error(\n 'OPENAI_API_KEY env variable is not set. Please set it in' +\n ' your .env.local file of your Makerkit workspace.'\n );\n }\n\n return new OpenAI({ apiKey });\n}\n\nexport default getOpenAIClient;\n","import { join } from 'path';\nimport { KitsModel } from '@/src/kits-model';\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\n\nexport class Workspace {\n static async getKitMeta() {\n const packageJson = await getPackageJson();\n const kit = await detectKitVersion();\n\n return {\n ...kit,\n version: packageJson.version,\n };\n }\n\n static async logWorkspaceInfo() {\n const meta = await Workspace.getKitMeta();\n\n console.log(\n `Makerkit version: ${chalk.cyan(meta.name)} - ${chalk.cyan(\n meta.version\n )}.\\n`\n );\n }\n}\n\nasync function detectKitVersion() {\n const packageJson = await getPackageJson();\n\n if (!packageJson) {\n throw new Error(\n 'No package.json found. Please run this command in a Makerkit workspace.'\n );\n }\n\n const deps = Object.keys(packageJson.dependencies ?? []);\n\n if (deps.includes('next') && deps.includes('firebase')) {\n return KitsModel.NextJsFirebase;\n }\n\n if (deps.includes('next') && deps.includes('@supabase/supabase-js')) {\n return KitsModel.NextJsSupabase;\n }\n\n if (\n deps.includes('@remix-run/react') &&\n deps.includes('@supabase/supabase-js')\n ) {\n return KitsModel.RemixSupabase;\n }\n\n throw new Error(\n 'Could not detect Makerkit workspace. Please run this command in a Makerkit workspace.'\n );\n}\n\nasync function getPackageJson(): Promise<Record<string, unknown>> {\n return fs\n .readJSON(join(process.cwd(), 'package.json'))\n .catch(() => undefined);\n}\n","import { generateBlogCommand } from '@/src/commands/blog/generate/generate-blog.command';\nimport { Workspace } from '@/src/utils/workspace';\nimport { Command } from 'commander';\n\nexport const blogCommand = new Command()\n .name('blog')\n .description('Manage and generate your blog posts')\n .hook('preAction', () => {\n return Workspace.logWorkspaceInfo();\n });\n\n// set children commands\ngenerateBlogCommand(blogCommand);\n","import { join } from 'path';\nimport getOpenAIClient from '@/src/utils/openai-client';\nimport { Workspace } from '@/src/utils/workspace';\nimport chalk from 'chalk';\nimport fs from 'fs-extra';\nimport OpenAI from 'openai';\n\ntype NestedKey = Record<string, string | Record<string, string>>;\n\nexport class I18nService {\n /**\n * @name verify\n * @description Verifies if the locale files are in sync\n */\n static async verify(base = 'en') {\n const kit = await Workspace.getKitMeta();\n\n const allLocales = fs.readdirSync(kit.localePath).filter((locale) => {\n return locale !== base;\n });\n\n const baseLocaleFolderPath = `${kit.localePath}/${base}`;\n\n const localeFiles = fs.readdirSync(baseLocaleFolderPath).filter((file) => {\n return file.endsWith('.json');\n });\n\n for (const localeFile of localeFiles) {\n for (const locale of allLocales) {\n const baseLocaleFilePath = `${baseLocaleFolderPath}/${localeFile}`;\n const targetLocaleFilePath = `${kit.localePath}/${locale}/${localeFile}`;\n\n const baseLocaleFile = fs.readJSONSync(baseLocaleFilePath);\n const file = fs.readJSONSync(targetLocaleFilePath);\n\n const missingKeys = collectMissingKeys([baseLocaleFile, file]);\n\n if (!missingKeys.length) {\n console.log(\n chalk.green(`Locale ${locale}/${localeFile} is in sync!`)\n );\n\n continue;\n }\n\n console.log(\n chalk.yellow(\n `Locale ${locale}/${localeFile} is missing the following keys: ${missingKeys.join(\n ', '\n )}`\n )\n );\n }\n }\n }\n\n /**\n * @name translate\n * @description Translates the locale files from source to target\n * @param source\n * @param target\n */\n static async translate(source: string, target: string) {\n const kit = await Workspace.getKitMeta();\n const client = getOpenAIClient();\n\n const targetJsonPath = `${kit.localePath}/${target}`;\n const sourceLocalePath = `${kit.localePath}/${source}`;\n\n const sourceLocale = await fs.exists(sourceLocalePath);\n\n if (!sourceLocale) {\n throw new Error(`Source locale at ${sourceLocalePath} not found`);\n }\n\n const files = fs.readdirSync(sourceLocalePath).filter((file) => {\n return file.endsWith('.json');\n });\n\n console.log(`Found the following files: ${files.join(', ')}`);\n\n for (const file of files) {\n const data: Record<string, string | Record<string, string | NestedKey>> =\n {};\n\n const localeFile = fs.readJSONSync(join(sourceLocalePath, file));\n\n console.log(\n chalk.cyan(`Translating \"${file}\". This can take a while...`)\n );\n\n for (const key in localeFile) {\n data[key] = await translateKey(source, target, localeFile[key], client);\n }\n\n console.log(chalk.green(`File \"${file}\" successfully translated!`));\n console.log(chalk.cyan(`Writing file \"${file}\" to ${targetJsonPath}`));\n\n // check if targetJsonPath exists, if not, create it\n (await fs.exists(targetJsonPath)) || (await fs.mkdir(targetJsonPath));\n\n // write file to targetJsonPath\n await fs.writeJSON(join(targetJsonPath, file), data, {});\n\n console.log(chalk.green(`File \"${file}\" successfully written!`));\n }\n }\n}\n\nasync function translateKey(\n source: string,\n target: string,\n key: string | NestedKey,\n client: OpenAI\n) {\n if (typeof key === 'string') {\n return translateString(source, target, key, client);\n }\n\n const data: Record<string, string | NestedKey> = {};\n\n for (const k in key) {\n data[k] = (await translateKey(source, target, key[k], client)) as NestedKey;\n }\n\n return data;\n}\n\nasync function translateString(\n source: string,\n target: string,\n key: string,\n client: OpenAI\n) {\n // skip empty or short keys\n if (!key.trim() || key.length <= 1) {\n return '';\n }\n\n const response = await client.chat.completions.create({\n model: 'gpt-3.5-turbo',\n max_tokens: target.split(' ').length + 50,\n temperature: 0.3,\n messages: [\n {\n role: 'user',\n content: `Translate the text from locale ${source} to ${target}. Text: ${key}. Translation:`,\n },\n ],\n });\n\n return response.choices[0].message.content ?? '';\n}\n\ntype JSONObject = { [key: string]: any };\n\nfunction collectMissingKeys(objects: JSONObject[]): string[] {\n const allKeys: string[] = [];\n\n objects.forEach((obj) => {\n Object.keys(obj).forEach((key) => {\n if (!allKeys.includes(key)) {\n allKeys.push(key);\n }\n });\n });\n\n const missingKeys: string[] = [];\n\n objects.forEach((obj) => {\n allKeys.forEach((key) => {\n if (!Object.keys(obj).includes(key)) {\n missingKeys.push(key);\n }\n });\n });\n\n return missingKeys;\n}\n","import { I18nService } from '@/src/commands/i18n/i18n-service';\nimport chalk from 'chalk';\nimport { Command } from 'commander';\nimport prompts from 'prompts';\n\nexport function createTranslateI18nCommand(parentCommand: Command) {\n return parentCommand\n .command('translate')\n .argument('[source-locale]', 'Source Locale')\n .argument('[target-locale]', 'Target Locale')\n .description('Translate i18n files from source locale to target locale')\n .action(async (sourceLocale, targetLocale) => {\n const locales = await promptLocales(sourceLocale, targetLocale);\n\n await I18nService.translate(locales.sourceLocale, locales.targetLocale);\n });\n}\n\nasync function promptLocales(maybeSource?: string, maybeTarget?: string) {\n const hint = 'e.g. en, fr, es, etc.';\n\n const sourceLocale =\n maybeSource ||\n (\n await prompts([\n {\n type: 'text',\n name: 'locale',\n message: `Enter your ${chalk.cyan('Source Locale')}. ${hint}`,\n hint,\n },\n ])\n ).locale;\n\n const targetLocale =\n maybeTarget ||\n (\n await prompts([\n {\n type: 'text',\n name: 'locale',\n message: `Enter your ${chalk.cyan('Target Locale')}. ${hint}`,\n hint,\n },\n ])\n ).locale;\n\n return {\n sourceLocale,\n targetLocale,\n };\n}\n","import { I18nService } from '@/src/commands/i18n/i18n-service';\nimport { Command } from 'commander';\n\nexport function createVerifyI18nCommand(parentCommand: Command) {\n return parentCommand\n .command('verify')\n .argument('[base-locale]', 'Base Locale')\n .description(\n 'Verify i18n files have no missing keys compared to base locale'\n )\n .action(async (baseLocale = 'en') => {\n await I18nService.verify(baseLocale);\n });\n}\n","import { createTranslateI18nCommand } from '@/src/commands/i18n/translate/translate.command';\nimport { createVerifyI18nCommand } from '@/src/commands/i18n/verify/verify.command';\nimport { Workspace } from '@/src/utils/workspace';\nimport { Command } from 'commander';\n\nexport const i18nCommand = new Command()\n .name('i18n')\n .description('Manage and translate your i18n files')\n .hook('preAction', () => {\n return Workspace.logWorkspaceInfo();\n });\n\n// set children commands\ncreateTranslateI18nCommand(i18nCommand);\ncreateVerifyI18nCommand(i18nCommand);\n","import chalk from 'chalk';\nimport { Command } from 'commander';\nimport ora from 'ora';\nimport prompts from 'prompts';\nimport { z } from 'zod';\n\nconst schema = z.object({\n licenseKey: z.string().min(1).max(32),\n githubUsername: z.string().min(1).max(64),\n});\n\nexport function createActivateLicenseCommand(parentCommand: Command) {\n return parentCommand\n .command('activate')\n .description('Activate your license key for MakerKit')\n .action(async () => {\n const params = await prompts([\n {\n type: 'text',\n name: 'licenseKey',\n message: `Enter your ${chalk.cyan('License Key')}.`,\n validate: (value) => {\n if (value.length < 1) {\n return `Please enter a valid license key`;\n }\n\n return true;\n },\n },\n {\n type: 'text',\n name: 'githubUsername',\n message: `Enter your ${chalk.cyan('Github username')}.`,\n validate: (value) => {\n if (value.length < 1) {\n return `Please enter a valid username`;\n }\n\n return true;\n },\n },\n ]);\n\n const spinner = ora(`Activating license...`).start();\n\n const onError = () => {\n spinner.fail(`Failed to activate license`);\n process.exit(1);\n };\n\n try {\n const response = await activateLicense(schema.parse(params));\n\n if (!response.ok) {\n return onError();\n }\n\n spinner.succeed(`License activated successfully`);\n } catch (e) {\n onError();\n }\n });\n}\n\nasync function activateLicense(params: {\n licenseKey: string;\n githubUsername: string;\n}) {\n return fetch(`https://makerkit.dev/api/ls/license/activate`, {\n method: 'POST',\n body: JSON.stringify(params),\n });\n}\n","import { createActivateLicenseCommand } from '@/src/commands/license/activate/activate-license.command';\nimport { Command } from 'commander';\n\nexport const licenseCommand = new Command()\n .name('license')\n .description('Manage Licenses');\n\ncreateActivateLicenseCommand(licenseCommand);\n","import { join } from 'path';\nimport { KitsModel, validateKit } from '@/src/kits-model';\nimport chalk from 'chalk';\nimport { Command } from 'commander';\nimport { execa } from 'execa';\nimport ora from 'ora';\nimport prompts from 'prompts';\n\nexport const newCommand = new Command()\n .name('new')\n .description('Initialize a new Makerkit project')\n .action(async () => {\n const choices = Object.values(KitsModel).map((kit) => {\n return {\n title: kit.name,\n value: kit.id,\n };\n });\n\n const { kit, name: projectName } = await prompts([\n {\n type: 'select',\n name: 'kit',\n message: `Select the ${chalk.cyan(`SaaS Kit`)} you want to clone`,\n choices,\n },\n {\n type: 'text',\n name: 'name',\n message: `Enter your ${chalk.cyan('Project Name')}.`,\n },\n ]);\n\n const { repository, name: kitName } = validateKit(kit);\n\n const { confirm } = await prompts([\n {\n type: 'confirm',\n name: 'confirm',\n message: `Are you sure you want to clone ${chalk.cyan(\n kitName\n )} to ${chalk.cyan(projectName)}?`,\n },\n ]);\n\n if (!confirm) {\n console.log('Aborting...');\n process.exit(0);\n }\n\n // pull repository from github\n await pullFromGithub(repository, kitName, projectName);\n\n // install dependencies\n await installDependencies(projectName);\n });\n\nasync function pullFromGithub(\n repository: string,\n kit: string,\n projectName: string\n) {\n const spinner = ora(`Cloning ${kit}...`).start();\n\n try {\n await execa('git', ['clone', repository, projectName]);\n\n spinner.succeed(`Cloned ${kit} to ${projectName}...`);\n } catch (e) {\n console.error(e);\n spinner.fail(`Failed to clone ${kit}`);\n\n return Promise.reject(`Failed to clone ${kit}`);\n }\n}\n\nasync function installDependencies(projectName: string) {\n const cwd = join(process.cwd(), projectName);\n const spinner = ora(`Installing dependencies. Please wait...`).start();\n\n try {\n await execa('npm', ['install'], { cwd });\n\n spinner.succeed(`Dependencies successfully installed!`);\n\n console.log(\n `🎉 You can now get started. Open the project in your IDE and read the README.md file for more information.`\n );\n } catch (e) {\n console.error(e);\n spinner.fail(`Failed to install dependencies`);\n\n return Promise.reject(`Failed to install dependencies`);\n }\n}\n","import { validateKit } from '@/src/kits-model';\nimport { PluginsModel, validatePlugin } from '@/src/plugins-model';\nimport { Workspace } from '@/src/utils/workspace';\nimport chalk from 'chalk';\nimport { execaCommand } from 'execa';\nimport ora from 'ora';\nimport prompts from 'prompts';\n\nenum PluginAction {\n Add = 'add',\n Pull = 'pull',\n}\n\nexport class PluginsService {\n static async install(pluginId?: string) {\n const action = PluginAction.Add;\n const plugin = pluginId || (await getPluginFromPrompts(action));\n\n await initPluginCommand(plugin, action);\n }\n\n static async pull(pluginId?: string) {\n const action = PluginAction.Pull;\n const plugin = pluginId || (await getPluginFromPrompts(action));\n\n await initPluginCommand(plugin, action);\n }\n}\n\nasync function initPluginCommand(pluginId: string, action: PluginAction) {\n const { id: kitId } = await Workspace.getKitMeta();\n\n const plugin = validatePlugin(pluginId);\n const kit = validateKit(kitId);\n\n if (!(kit.plugins as string[]).includes(plugin.id)) {\n throw new Error(\n `Plugin ${plugin.name} is not compatible with kit ${kit.name}`\n );\n }\n\n const repository = buildPluginRepositoryName(kit.repository);\n const verb = action === PluginAction.Add ? 'Installing' : 'Updating';\n\n console.log(\n `${verb} ${chalk.cyan(plugin.name)} to kit ${chalk.cyan(\n kit.name\n )} using repo: ${repository} ...`\n );\n\n return executePluginCommand({\n action,\n repository,\n branch: plugin.branch,\n folder: `plugins/${plugin.branch}`,\n });\n}\n\nasync function getPluginFromPrompts(action: PluginAction) {\n const choices = Object.values(PluginsModel).map((plugin) => {\n return {\n title: plugin.name,\n value: plugin.id,\n };\n });\n\n const verb = action === PluginAction.Add ? 'install' : 'update';\n\n const { plugin } = await prompts([\n {\n type: 'select',\n name: 'plugin',\n message: `Which ${chalk.cyan('Plugin')} would you like to ${verb}?`,\n choices,\n },\n ]);\n\n return plugin;\n}\n\n// the plugin repository name is the kit repository name + `-plugins`\nfunction buildPluginRepositoryName(repository: string) {\n return repository + `-plugins.git`;\n}\n\nasync function executePluginCommand({\n action,\n repository,\n branch,\n folder,\n}: {\n action: PluginAction;\n repository: string;\n branch: string;\n folder: string;\n}) {\n const verb = action === PluginAction.Add ? 'Installing' : 'Updating';\n const spinner = ora(`${verb} plugin...`).start();\n const commandString = `git subtree ${action} --prefix ${folder} ${repository} ${branch} --squash`;\n\n try {\n await execaCommand(commandString);\n\n const verb = action === PluginAction.Add ? 'installed' : 'updated';\n spinner.succeed(`Plugin ${verb} at ${folder}`);\n } catch (e) {\n console.error(e);\n\n const verb = action === PluginAction.Add ? 'installation' : 'update';\n spinner.fail(`Plugin ${verb} failed`);\n }\n}\n","import { PluginsService } from '@/src/commands/plugins/plugins-service';\nimport { Command } from 'commander';\n\nexport function createInstallPluginCommand(parentCommand: Command) {\n return parentCommand\n .command('install')\n .argument('[plugin-id]', 'Plugin id')\n .description('Install plugin')\n .action(async (maybePluginId) => {\n await PluginsService.install(maybePluginId);\n });\n}\n","import { KitsModel } from '@/src/kits-model';\nimport { validatePlugin } from '@/src/plugins-model';\nimport chalk from 'chalk';\nimport { Command } from 'commander';\n\nexport function createListPluginsCommand(parentCommand: Command) {\n return parentCommand\n .command('list')\n .description('List available plugins.')\n .action(() => {\n const kits = Object.values(KitsModel);\n\n for (const kit of kits) {\n console.log(`${chalk.cyan(kit.name)}`);\n\n if (!kit.plugins.length) {\n console.log(chalk.yellow(`- No plugins available`) + '\\n');\n\n continue;\n }\n\n for (const plugin of kit.plugins) {\n const { name } = validatePlugin(plugin);\n console.log(`- ${chalk.green(name)}`);\n }\n\n console.log('');\n }\n });\n}\n","import { PluginsService } from '@/src/commands/plugins/plugins-service';\nimport { Command } from 'commander';\n\nexport function createUpdatePluginCommand(parentCommand: Command) {\n return parentCommand\n .command('update')\n .argument('[plugin-id]', 'Plugin id')\n .description('Update plugin to the latest version')\n .action(async (maybePluginId) => {\n await PluginsService.pull(maybePluginId);\n });\n}\n","import { createInstallPluginCommand } from '@/src/commands/plugins/install/install-plugin.command';\nimport { createListPluginsCommand } from '@/src/commands/plugins/list/list-plugins.command';\nimport { createUpdatePluginCommand } from '@/src/commands/plugins/update/update-plugin.command';\nimport { Workspace } from '@/src/utils/workspace';\nimport { Command } from 'commander';\n\nexport const pluginsCommand = new Command()\n .name('plugins')\n .description('List and install plugins.')\n .hook('preAction', () => {\n return Workspace.logWorkspaceInfo();\n });\n\n// set children commands\ncreateListPluginsCommand(pluginsCommand);\ncreateInstallPluginCommand(pluginsCommand);\ncreateUpdatePluginCommand(pluginsCommand);\n","#!/usr/bin/env node\nimport { blogCommand } from '@/src/commands/blog/blog.command';\nimport { i18nCommand } from '@/src/commands/i18n/i18n.command';\nimport { licenseCommand } from '@/src/commands/license/license.command';\nimport { newCommand } from '@/src/commands/new/new.command';\nimport { pluginsCommand } from '@/src/commands/plugins/plugins.command';\nimport { Command } from 'commander';\nimport { config } from 'dotenv';\n\nconfig({\n path: '.env.local',\n});\n\nprocess.on('SIGINT', () => process.exit(0));\nprocess.on('SIGTERM', () => process.exit(0));\n\nasync function main() {\n const program = new Command()\n .name('makerkit')\n .description(\n 'Your SaaS Kit companion. Add plugins, manage migrations, and more.'\n )\n .version('-v, --version', 'display the version number');\n\n program\n .addCommand(newCommand)\n .addCommand(pluginsCommand)\n .addCommand(i18nCommand)\n .addCommand(licenseCommand)\n .addCommand(blogCommand);\n\n program.parse();\n}\n\nvoid main();\n"],"mappings":";;;AAAA,SAAS,QAAAA,aAAY;;;ACArB,OAAO,eAAe;AAEf,IAAM,eAAe;AAAA,EAC1B,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,aAAa;AAAA,EACf;AAAA,EACA,WAAW;AAAA,IACT,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,aAAa;AAAA,EACf;AACF;AAEO,SAAS,cAAc,IAAY;AACxC,SAAO,OAAO,OAAO,YAAY,EAAE,KAAK,CAAC,WAAW,OAAO,OAAO,EAAE;AACtE;AAEO,SAAS,eAAe,UAAkB;AAC/C,QAAM,SAAS,cAAc,QAAQ;AAErC,YAAU,QAAQ,UAAU,QAAQ,YAAY;AAEhD,SAAO;AACT;;;AC1BA,OAAOC,gBAAe;AAEf,IAAM,YAAY;AAAA,EACvB,gBAAgB;AAAA,IACd,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY;AAAA,IACZ,SAAS,CAAC,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,MAAM;AAChB;AAEA,KAAK,KAAK;","names":["join","invariant","chalk","fs","join","join","chalk","fs","join","chalk","prompts","Command","chalk","ora","prompts","z","schema","Command","join","chalk","Command","ora","prompts","kit","join","chalk","ora","prompts","chalk","plugin","prompts","ora","verb","chalk","Command","Command"]}
|