@kiln-js/cli 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.
Files changed (2) hide show
  1. package/dist/index.js +24 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -739,8 +739,13 @@ import path7 from "path";
739
739
  import inquirer from "inquirer";
740
740
 
741
741
  // src/templates.ts
742
+ var SCOPE = "@klin-js";
743
+ var CLI_PACKAGE = "kiln";
744
+ var KILN_VERSION = "0.1.0";
745
+ var VITE_VERSION = "5.4.21";
746
+ var pkg = (name) => `${SCOPE}/${name}`;
747
+ var kilnDep = (linked) => linked ? "*" : `^${KILN_VERSION}`;
742
748
  var SUFFIX = { universal: "", server: ".server", client: ".client" };
743
- var dep = (version, linked) => linked ? "*" : `^${version}`;
744
749
  function homePage(name, mode) {
745
750
  const stateful = mode !== "server";
746
751
  return `${stateful ? `import { useState } from "react";
@@ -768,7 +773,7 @@ var ABOUT = (name) => `export default function About() {
768
773
  }
769
774
  `;
770
775
  var LAYOUT = (withBlog) => `import type { ReactNode } from "react";
771
- import { Link } from "@kiln/client";
776
+ import { Link } from "${pkg("client")}";
772
777
 
773
778
  export default function Layout({ children }: { children: ReactNode }) {
774
779
  return (
@@ -784,7 +789,7 @@ export default function Layout({ children }: { children: ReactNode }) {
784
789
  );
785
790
  }
786
791
  `;
787
- var BLOG_INDEX = `import { Link } from "@kiln/client";
792
+ var BLOG_INDEX = `import { Link } from "${pkg("client")}";
788
793
 
789
794
  export default function BlogIndex() {
790
795
  return (
@@ -825,7 +830,7 @@ var PRICING = `export default function Pricing() {
825
830
  );
826
831
  }
827
832
  `;
828
- var HEALTH = `import type { ApiContext } from "@kiln/server";
833
+ var HEALTH = `import type { ApiContext } from "${pkg("server")}";
829
834
 
830
835
  export function GET(_ctx: ApiContext) {
831
836
  return Response.json({ ok: true, time: new Date().toISOString() });
@@ -854,21 +859,21 @@ var TSCONFIG = `{
854
859
  function projectFiles(o) {
855
860
  const files = {};
856
861
  const withBlog = o.template === "blog";
857
- const pkg = {
862
+ const pkgJson = {
858
863
  name: o.name,
859
864
  private: true,
860
865
  type: "module",
861
866
  scripts: {
862
- dev: "kiln dev",
863
- build: "kiln build",
864
- start: "kiln start",
865
- routes: "kiln routes",
866
- generate: "kiln generate"
867
+ dev: `${CLI_PACKAGE} dev`,
868
+ build: `${CLI_PACKAGE} build`,
869
+ start: `${CLI_PACKAGE} start`,
870
+ routes: `${CLI_PACKAGE} routes`,
871
+ generate: `${CLI_PACKAGE} generate`
867
872
  },
868
873
  dependencies: {
869
- "@kiln/client": dep("0.1.0", o.linked),
870
- "@kiln/core": dep("0.1.0", o.linked),
871
- "@kiln/server": dep("0.1.0", o.linked),
874
+ [pkg("client")]: kilnDep(o.linked),
875
+ [pkg("core")]: kilnDep(o.linked),
876
+ [pkg("server")]: kilnDep(o.linked),
872
877
  react: "^18.3.1",
873
878
  "react-dom": "^18.3.1"
874
879
  },
@@ -876,18 +881,19 @@ function projectFiles(o) {
876
881
  "@types/bun": "latest",
877
882
  "@types/react": "^18.3.0",
878
883
  "@types/react-dom": "^18.3.0",
879
- kiln: dep("0.1.0", o.linked),
884
+ [CLI_PACKAGE]: kilnDep(o.linked),
880
885
  typescript: "^5.6.0",
881
- vite: "^5.4.0"
886
+ vite: VITE_VERSION
882
887
  }
883
888
  };
884
- files["package.json"] = JSON.stringify(pkg, null, 2) + `
889
+ files["package.json"] = JSON.stringify(pkgJson, null, 2) + `
885
890
  `;
886
891
  files["tsconfig.json"] = TSCONFIG;
887
892
  files[".gitignore"] = `node_modules
888
893
  dist
889
894
  .kiln
890
895
  .env.local
896
+ .vercel
891
897
  `;
892
898
  files["app/index.css"] = CSS;
893
899
  files["app/pages/_layout.tsx"] = LAYOUT(withBlog);
@@ -908,12 +914,12 @@ KILN_PUBLIC_SITE_NAME=${o.name}
908
914
  `;
909
915
  }
910
916
  if (o.customEntries) {
911
- files["app/client.tsx"] = `import { createClient } from "@kiln/client";
917
+ files["app/client.tsx"] = `import { createClient } from "${pkg("client")}";
912
918
  import "./index.css";
913
919
 
914
920
  createClient().then((client) => client.start());
915
921
  `;
916
- files["app/server.ts"] = `import { createAppHandler, type KilnAssets } from "@kiln/server";
922
+ files["app/server.ts"] = `import { createAppHandler, type KilnAssets } from "${pkg("server")}";
917
923
 
918
924
  export function createHandler(assets: KilnAssets) {
919
925
  return createAppHandler({ assets });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiln-js/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "kiln": "./dist/index.js"