create-pluto 0.1.0 → 0.3.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 CHANGED
@@ -18,4 +18,5 @@ Supported template shortcuts currently include:
18
18
 
19
19
  ```bash
20
20
  supabase-shop
21
+ supabase-blog
21
22
  ```
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import e from"node:fs";import t from"node:path";import{cancel as n,confirm as r,isCancel as i,log as a,select as o,spinner as s,text as c}from"@clack/prompts";import{downloadTemplate as l}from"giget";async function u(){let e,t;for(;!e;)e=await c({message:`Type/Paste your Supabase URL:`}),(!e||typeof e!=`string`)&&a.error(`Supabase URL is required.`);for(;!t;)t=await c({message:`Type/Paste your Supabase Key:`}),(!t||typeof t!=`string`)&&a.error(`Supabase Key is required.`);return{supabaseUrl:e,supabaseKey:t}}function d(e,t){let n={};return n.SUPABASE_PROJECT_ID=e?e.toString().split(`//`)[1]?.split(`.`)[0]??``:``,n.SUPABASE_URL=e?.toString()??``,n.SUPABASE_KEY=t?.toString()??``,{envVars:n}}const f=process.cwd(),p={blue:e=>`\x1B[34m${e}\x1B[0m`,green:e=>`\x1B[32m${e}\x1B[0m`},m={databases:[{value:`supabase`,label:`Supabase`,hint:`Hosted Postgres Database`}],templates:[{value:`shop`,label:`Shop (e-commerce)`,hint:`A full-featured online store template`}]};function h(e){let t={};for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`-t`||r===`--template`){t.templateShortcut=e[n+1],n+=1;continue}if(r?.startsWith(`--template=`)){t.templateShortcut=r.split(`=`)[1];continue}!r?.startsWith(`-`)&&!t.projectDir&&(t.projectDir=r)}return t}function g(e){let[t,n]=e.split(`-`,2),r=m.databases.some(e=>e.value===t),i=m.templates.some(e=>e.value===n);if(!r||!i){let t=m.databases.flatMap(e=>m.templates.map(t=>`${e.value}-${t.value}`));a.error(`Unknown template \"${e}\". Available options: ${t.join(`, `)}`),process.exit(1)}return{databaseProvider:t,templateChoice:n}}const _=h(process.argv.slice(2)),v=_.templateShortcut?g(_.templateShortcut):void 0,y=_.projectDir?_.projectDir:await c({message:`Where do you want to create your Pluto project?`,placeholder:`./my-pluto-project`,defaultValue:`my-pluto-project`});i(y)&&(n(`Operation cancelled.`),process.exit(0));const b=t.resolve(f,y);e.existsSync(b)||e.mkdirSync(b,{recursive:!0});const x=await c({message:`Website title:`,placeholder:`My Awesome Website`,defaultValue:`My Awesome Website`});i(x)&&(n(`Operation cancelled.`),process.exit(0));const S=v?v.databaseProvider:await o({message:`Pick a database provider.`,options:m.databases});i(S)&&(n(`Operation cancelled.`),process.exit(0));let C,w;if(S===`supabase`){a.warn(`You must have a Supabase project set up. If you do not have one, please create it at:\n${p.blue(`https://database.new/`)}.`);let{supabaseUrl:e,supabaseKey:t}=await u();(!e||!t)&&(a.error(`Supabase setup failed.`),process.exit(1)),C=e,w=t}const T=s();e.existsSync(`${f}/nuxt.config.ts`)&&(await r({message:`Nuxt project detected. Do you want to add Pluto environment variables?`})||process.exit(0));const E=v?v.templateChoice:await o({message:`Select a template to use. You can add more layers as needed.`,options:m.templates});i(E)&&(n(`Operation cancelled.`),process.exit(0)),e.readdirSync(b).length>0&&(await r({message:`The folder ${p.green(y)} is not empty. Do you want to continue and potentially overwrite existing files?`})||(n(`Operation cancelled.`),process.exit(0))),T.start(`Downloading Pluto template...`);const{source:D}=await l(`gh:plutocms/pluto-${S}-${E}-template`,{dir:b,force:!0});a.info(`Template downloaded from ${p.green(D)}`);const O=t.resolve(b,`.env`),k={PLUTO_WEBSITE_TITLE:x?.toString()??``};if(S===`supabase`){let{envVars:e}=d(C,w);Object.assign(k,e)}try{let t=``;e.existsSync(O)?(t=e.readFileSync(O,`utf-8`),Object.entries(k).forEach(([e,n])=>{let r=RegExp(`^${e}=.*$`,`m`);r.test(t)?t=t.replace(r,`${e}="${n}"`):t+=`\n${e}="${n}"`})):(t=`# Pluto Configurations
2
- `,Object.entries(k).forEach(([e,n])=>{t+=`${e}="${n}"\n`})),e.writeFileSync(O,`${t.trim()}\n`)}catch(e){a.error(`Failed to write to .env file: ${e}`),process.exit(1)}T.stop(`All done!`),a.success(`Setup complete! 🎉`),a.info(`Nuxt project created in: ${p.green(y)}`);export{};
1
+ import e from"node:fs";import t from"node:path";import{cancel as n,confirm as r,isCancel as i,log as a,select as o,spinner as s,text as c}from"@clack/prompts";import{downloadTemplate as l}from"giget";const u=/^postgres(?:ql)?:\/\//i;function d(e){return URL.canParse(e)}function f(e){return u.test(e)}async function p(){let e,t,r;for(;!e;){let t=await c({message:`Type/Paste your Supabase URL:`});if(i(t)&&(n(`Operation cancelled.`),process.exit(0)),!t||!d(t)){a.error(`Enter a valid Supabase URL, like https://xxxxx.supabase.co.`);continue}e=t}for(;!t;){let e=await c({message:`Type/Paste your Supabase Key:`});if(i(e)&&(n(`Operation cancelled.`),process.exit(0)),!e){a.error(`Supabase Key is required.`);continue}t=e}for(a.info(`Now find your database connection string: open your Supabase project, go to Project Settings > Database > Connection string, and copy the URI (the pooler connection works too).`);!r;){let e=await c({message:`Type/Paste your Supabase database connection string:`});if(i(e)&&(n(`Operation cancelled.`),process.exit(0)),!e||!f(e)){a.error(`Enter a valid Postgres connection string, starting with postgres:// or postgresql://.`);continue}r=e}return{supabaseUrl:e,supabaseKey:t,databaseUrl:r}}function m(e,t,n){let r={};return r.SUPABASE_URL=e?.toString()??``,r.SUPABASE_KEY=t?.toString()??``,r.DATABASE_URL=n?.toString()??``,{envVars:r}}const h=process.cwd(),g={blue:e=>`\x1B[34m${e}\x1B[0m`,green:e=>`\x1B[32m${e}\x1B[0m`},_={databases:[{value:`supabase`,label:`Supabase`,hint:`Hosted Postgres Database`}],templates:[{value:`shop`,label:`Shop (e-commerce)`,hint:`A full-featured online store template`},{value:`blog`,label:`Blog`,hint:`A simple blog template with a rich text editor`}]};function v(e){let t={};for(let n=0;n<e.length;n+=1){let r=e[n];if(r===`-t`||r===`--template`){t.templateShortcut=e[n+1],n+=1;continue}if(r?.startsWith(`--template=`)){t.templateShortcut=r.split(`=`)[1];continue}!r?.startsWith(`-`)&&!t.projectDir&&(t.projectDir=r)}return t}function y(e){let[t,n]=e.split(`-`,2),r=_.databases.some(e=>e.value===t),i=_.templates.some(e=>e.value===n);if(!r||!i){let t=_.databases.flatMap(e=>_.templates.map(t=>`${e.value}-${t.value}`));a.error(`Unknown template \"${e}\". Available options: ${t.join(`, `)}`),process.exit(1)}return{databaseProvider:t,templateChoice:n}}const b=v(process.argv.slice(2)),x=b.templateShortcut?y(b.templateShortcut):void 0,S=b.projectDir?b.projectDir:await c({message:`Where do you want to create your Pluto project?`,placeholder:`./my-pluto-project`,defaultValue:`my-pluto-project`});i(S)&&(n(`Operation cancelled.`),process.exit(0));const C=t.resolve(h,S);e.existsSync(C)||e.mkdirSync(C,{recursive:!0});const w=await c({message:`Website title:`,placeholder:`My Awesome Website`,defaultValue:`My Awesome Website`});i(w)&&(n(`Operation cancelled.`),process.exit(0));const T=x?x.databaseProvider:await o({message:`Pick a database provider.`,options:_.databases});i(T)&&(n(`Operation cancelled.`),process.exit(0));let E,D,O;if(T===`supabase`){a.warn(`You must have a Supabase project set up. If you do not have one, please create it at:\n${g.blue(`https://database.new/`)}.`);let{supabaseUrl:e,supabaseKey:t,databaseUrl:n}=await p();(!e||!t||!n)&&(a.error(`Supabase setup failed.`),process.exit(1)),E=e,D=t,O=n}const k=s();e.existsSync(`${h}/nuxt.config.ts`)&&(await r({message:`Nuxt project detected. Do you want to add Pluto environment variables?`})||process.exit(0));const A=x?x.templateChoice:await o({message:`Select a template to use. You can add more layers as needed.`,options:_.templates});i(A)&&(n(`Operation cancelled.`),process.exit(0)),e.readdirSync(C).length>0&&(await r({message:`The folder ${g.green(S)} is not empty. Do you want to continue and potentially overwrite existing files?`})||(n(`Operation cancelled.`),process.exit(0))),k.start(`Downloading Pluto template...`);const{source:j}=await l(`gh:plutocms/pluto-${T}-${A}-template`,{dir:C,force:!0});a.info(`Template downloaded from ${g.green(j)}`);const M=t.resolve(C,`.env`),N={WEBSITE_NAME:w?.toString()??``};if(T===`supabase`){let{envVars:e}=m(E,D,O);Object.assign(N,e)}try{let t=``;e.existsSync(M)?(t=e.readFileSync(M,`utf-8`),Object.entries(N).forEach(([e,n])=>{let r=RegExp(`^${e}=.*$`,`m`);r.test(t)?t=t.replace(r,`${e}="${n}"`):t+=`\n${e}="${n}"`})):(t=`# Pluto Configurations
2
+ `,Object.entries(N).forEach(([e,n])=>{t+=`${e}="${n}"\n`})),e.writeFileSync(M,`${t.trim()}\n`)}catch(e){a.error(`Failed to write to .env file: ${e}`),process.exit(1)}k.stop(`All done!`),a.success(`Setup complete! 🎉`),a.info(`Nuxt project created in: ${g.green(S)}`);export{};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-pluto",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.3.0",
5
5
  "description": "CLI Wizard for creating a Pluto App",
6
6
  "author": "https://github.com/ojvribeiro",
7
7
  "license": "MIT",
@@ -23,11 +23,15 @@
23
23
  "headless",
24
24
  "cms"
25
25
  ],
26
- "main": "./src/index.ts",
27
- "module": "./bin/cli.mjs",
26
+ "main": "./dist/index.mjs",
27
+ "module": "./dist/index.mjs",
28
28
  "bin": {
29
29
  "create-pluto": "bin/cli.mjs"
30
30
  },
31
+ "files": [
32
+ "bin",
33
+ "dist"
34
+ ],
31
35
  "scripts": {
32
36
  "setup": "node src/index.ts",
33
37
  "build": "tsdown",
@@ -46,5 +50,8 @@
46
50
  "prettier": "^3.8.1",
47
51
  "tsdown": "^0.20.1",
48
52
  "typescript": "^5.9.3"
53
+ },
54
+ "publishConfig": {
55
+ "access": "public"
49
56
  }
50
57
  }
package/.editorconfig DELETED
@@ -1,12 +0,0 @@
1
- # EditorConfig is awesome: https://EditorConfig.org
2
-
3
- # top-most EditorConfig file
4
- root = true
5
-
6
- [*]
7
- indent_style = space
8
- indent_size = 2
9
- end_of_line = lf
10
- charset = utf-8
11
- trim_trailing_whitespace = true
12
- insert_final_newline = true
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
@@ -1,10 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: bun
4
- directory: /
5
- schedule:
6
- interval: weekly
7
- - package-ecosystem: github-actions
8
- directory: /
9
- schedule:
10
- interval: weekly
@@ -1,28 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- pull_request:
5
- push:
6
- branches: [main]
7
-
8
- permissions:
9
- contents: read
10
-
11
- jobs:
12
- ci:
13
- name: Build
14
- runs-on: ubuntu-latest
15
- steps:
16
- - name: Checkout
17
- uses: actions/checkout@v4
18
-
19
- - name: Setup Bun
20
- uses: oven-sh/setup-bun@v2
21
- with:
22
- bun-version: latest
23
-
24
- - name: Install dependencies
25
- run: bun install --frozen-lockfile
26
-
27
- - name: Build
28
- run: bun run build
@@ -1,59 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- branches: [main]
6
-
7
- concurrency:
8
- group: release
9
- cancel-in-progress: false
10
-
11
- jobs:
12
- release-please:
13
- name: Release Please
14
- runs-on: ubuntu-latest
15
- permissions:
16
- contents: write
17
- pull-requests: write
18
- outputs:
19
- release_created: ${{ steps.release.outputs.release_created }}
20
- steps:
21
- - name: Run release-please
22
- id: release
23
- uses: googleapis/release-please-action@v4
24
- with:
25
- token: ${{ secrets.RELEASE_PLEASE_TOKEN || github.token }}
26
-
27
- publish:
28
- name: Publish to npm
29
- needs: release-please
30
- if: ${{ needs.release-please.outputs.release_created }}
31
- runs-on: ubuntu-latest
32
- permissions:
33
- id-token: write # npm provenance via OIDC trusted publishing
34
- contents: read
35
- steps:
36
- - name: Checkout
37
- uses: actions/checkout@v4
38
-
39
- - name: Setup Bun
40
- uses: oven-sh/setup-bun@v2
41
- with:
42
- bun-version: latest
43
-
44
- - name: Setup Node.js
45
- uses: actions/setup-node@v4
46
- with:
47
- node-version: 24
48
- registry-url: https://registry.npmjs.org/
49
-
50
- - name: Install dependencies
51
- run: bun install --frozen-lockfile
52
-
53
- - name: Build
54
- run: bun run build
55
-
56
- - name: Publish to npm
57
- # No token needed — OIDC trusted publishing handles auth automatically.
58
- # Provenance is also generated automatically; no --provenance flag required.
59
- run: npm publish --access public
package/.prettierrc DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "tabWidth": 2,
3
- "useTabs": false,
4
- "singleQuote": true,
5
- "semi": false,
6
- "trailingComma": "es5",
7
- "arrowParens": "always",
8
- "endOfLine": "lf"
9
- }
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.1.0"
3
- }
@@ -1,8 +0,0 @@
1
- {
2
- "recommendations": [
3
- "EditorConfig.EditorConfig",
4
- "esbenp.prettier-vscode",
5
- "dbaeumer.vscode-eslint",
6
- "streetsidesoftware.code-spell-checker"
7
- ]
8
- }
@@ -1 +0,0 @@
1
- {}
package/CHANGELOG.md DELETED
@@ -1,31 +0,0 @@
1
- # Changelog
2
-
3
- ## [0.1.0](https://github.com/plutocms/create-pluto/compare/v0.0.1-alpha.4...v0.1.0) (2026-08-22)
4
-
5
-
6
- ### Features
7
-
8
- * add .npmignore to exclude src/ directory from npm package ([7112e6b](https://github.com/plutocms/create-pluto/commit/7112e6b7cc8eb94ee8058590c23344ca0509fe62))
9
- * add color utility for blue and green text output ([8166894](https://github.com/plutocms/create-pluto/commit/8166894b996cb53d60128f658bce34137f6aa885))
10
- * enhance CLI argument parsing and template selection logic ([a8cc048](https://github.com/plutocms/create-pluto/commit/a8cc048eea561ced68f04cdeb481bdcc766e762e))
11
- * enhance project setup process with template download and .env configuration ([4e08695](https://github.com/plutocms/create-pluto/commit/4e08695536ab26b2190483a57d34f0bdfe35ed16))
12
- * initial implementation for CLI ([b1fd74e](https://github.com/plutocms/create-pluto/commit/b1fd74e27419011eefccad629a9eb0e5593e7e9f))
13
- * refactor Supabase setup and add template selection ([0423a4e](https://github.com/plutocms/create-pluto/commit/0423a4e8364af88db926f51bc7097c64dfc239f1))
14
- * simplify CLI entry point and update dependencies ([8ea6cf6](https://github.com/plutocms/create-pluto/commit/8ea6cf664361a884dfbac97fd8dd6fe8af4f1973))
15
- * update CLI entry point to use compiled JavaScript and add project setup functionality ([21716c8](https://github.com/plutocms/create-pluto/commit/21716c83b9992f86f6e2afc23fadd6cfa25ff8df))
16
- * update package.json for scoped package name and enhance metadata ([0e78326](https://github.com/plutocms/create-pluto/commit/0e783264b6da6a3b7d922c9d5c9bdd3ade97a73f))
17
- * update template source to use supabase shop template ([6a812b2](https://github.com/plutocms/create-pluto/commit/6a812b2583cd14242849a009716a3a5cd2c5049c))
18
- * updated compiled code ([7f69135](https://github.com/plutocms/create-pluto/commit/7f69135aab989655191d661034078e498476e0b1))
19
-
20
-
21
- ### Bug Fixes
22
-
23
- * ensure minification is enabled in tsdown configuration ([33949e4](https://github.com/plutocms/create-pluto/commit/33949e4a0bf356836c38aeda8d514e5d14480964))
24
- * force template download in setup script ([78a1ebd](https://github.com/plutocms/create-pluto/commit/78a1ebdc8f2ccc392cf4e8fd11bdc11f23fd42c6))
25
- * unscope package ([43f820e](https://github.com/plutocms/create-pluto/commit/43f820e1885fc00780ab92f3cc82ed01030680e7))
26
- * update version to 0.0.1-alpha.2 in package.json ([657d4bf](https://github.com/plutocms/create-pluto/commit/657d4bf796238c53be3e349ad962fbc64f28a9f9))
27
-
28
-
29
- ### Miscellaneous Chores
30
-
31
- * **ci:** fix repo URLs and add release-please pipeline ([279a01e](https://github.com/plutocms/create-pluto/commit/279a01ed8a79687ebbf0b4e60098ba4e567cfb31))