@akanjs/cli 1.0.1 → 1.0.3

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/cjs/index.js CHANGED
@@ -4623,11 +4623,14 @@ var ApplicationRunner = class {
4623
4623
  logLevel: "warning"
4624
4624
  });
4625
4625
  const rootPackageJson = app.workspace.getPackageJson();
4626
+ const baseNextConfig = akanConfig.frontend.nextConfig;
4627
+ const nextConfig = typeof baseNextConfig === "function" ? await baseNextConfig("build") : baseNextConfig;
4626
4628
  const dependencies = extractDependencies(buildResult.outputFiles, rootPackageJson, [
4627
4629
  "next",
4628
4630
  "react",
4629
4631
  "react-dom",
4630
- "typescript"
4632
+ "typescript",
4633
+ ...nextConfig.serverExternalPackages ?? []
4631
4634
  ]);
4632
4635
  buildResult.outputFiles.forEach((file) => app.dist.writeFile(file.path, file.text));
4633
4636
  const appPackageJson = {
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "extends": "../../tsconfig.json",
3
3
  "compilerOptions": {
4
- "jsx": "preserve",
5
- "declaration": true,
6
- "declarationDir": "dist"
4
+ "jsx": "preserve"
7
5
  },
8
6
  "references": [
9
7
  {
@@ -27,16 +27,16 @@ function getContent(scanInfo, dict) {
27
27
  filename: `${dict.Model}.Template.tsx`,
28
28
  content: `
29
29
  "use client";
30
+ import { Field, Layout } from "@akanjs/ui";
30
31
  import { cnst, st, usePage } from "@${dict.sysName}/client";
31
- import { Layout, Field } from "@akanjs/ui";
32
32
 
33
- interface ${dict.Model}EditProps {
33
+ interface GeneralProps {
34
34
  className?: string;
35
35
  }
36
36
 
37
- export const General = ({ className }: ${dict.Model}EditProps) => {
38
- const ${dict.model}Form = st.use.${dict.model}Form();
37
+ export const General = ({ className }: GeneralProps) => {
39
38
  const { l } = usePage();
39
+ const ${dict.model}Form = st.use.${dict.model}Form();
40
40
  return (
41
41
  <Layout.Template className={className}>
42
42
  <Field.Text
@@ -34,8 +34,9 @@ import { ClientInit, ClientView } from "@akanjs/signal";
34
34
  interface CardProps {
35
35
  className?: string;
36
36
  init: ClientInit<"${dict.model}", cnst.Light${dict.Model}>;
37
+ sliceName?: string;
37
38
  }
38
- export const Card = ({ className, init }: CardProps) => {
39
+ export const Card = ({ className, init, sliceName }: CardProps) => {
39
40
  return (
40
41
  <Load.Units
41
42
  className={className}
@@ -39,7 +39,7 @@ export class ${dict.Model}Model extends into(${dict.Model}, ${dict.Model}Filter,
39
39
 
40
40
  export class ${dict.Model}Middleware extends beyond(${dict.Model}Model, ${dict.Model}) {
41
41
  onSchema(schema: SchemaOf<${dict.Model}Model, ${dict.Model}>) {
42
- // schema.index({ status: 1 })
42
+ // schema.index({ field: 1 })
43
43
  }
44
44
  }
45
45
  `;
@@ -26,9 +26,8 @@ function getContent(scanInfo, dict) {
26
26
  return `
27
27
  import { serve } from "@akanjs/service";
28
28
 
29
- import * as cnst from "../cnst";
30
29
  import * as db from "../db";
31
30
 
32
- export class ${dict.Model}Service extends serve(db.${dict.model}, () => ({})) {}
31
+ export class ${dict.Model}Service extends serve(db.${dict.model}, ({ use, service }) => ({})) {}
33
32
  `;
34
33
  }
@@ -30,7 +30,7 @@ import { endpoint, internal, slice } from "@akanjs/signal";
30
30
  import * as cnst from "../cnst";
31
31
  import * as srv from "../srv";
32
32
 
33
- export class ${dict.Model}Internal extends internal(srv.${dict.model}, () => ({})) {}
33
+ export class ${dict.Model}Internal extends internal(srv.${dict.model}, ({ interval }) => ({})) {}
34
34
 
35
35
  export class ${dict.Model}Slice extends slice(srv.${dict.model}, { guards: { root: Public, get: Public, cru: Public } }, (init) => ({
36
36
  inPublic: init()
@@ -39,6 +39,6 @@ export class ${dict.Model}Slice extends slice(srv.${dict.model}, { guards: { roo
39
39
  }),
40
40
  })) {}
41
41
 
42
- export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, () => ({})) {}
42
+ export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, ({ query, mutation }) => ({})) {}
43
43
  `;
44
44
  }
@@ -26,7 +26,8 @@ function getContent(scanInfo, dict) {
26
26
  return `
27
27
  import { store } from "@akanjs/store";
28
28
 
29
- import { sig } from "../useClient";
29
+ import * as cnst from "../cnst";
30
+ import { fetch, sig } from "../useClient";
30
31
 
31
32
  export class ${dict.Model}Store extends store(sig.${dict.model}, {
32
33
  // state
package/esm/index.js CHANGED
@@ -4604,11 +4604,14 @@ var ApplicationRunner = class {
4604
4604
  logLevel: "warning"
4605
4605
  });
4606
4606
  const rootPackageJson = app.workspace.getPackageJson();
4607
+ const baseNextConfig = akanConfig.frontend.nextConfig;
4608
+ const nextConfig = typeof baseNextConfig === "function" ? await baseNextConfig("build") : baseNextConfig;
4607
4609
  const dependencies = extractDependencies(buildResult.outputFiles, rootPackageJson, [
4608
4610
  "next",
4609
4611
  "react",
4610
4612
  "react-dom",
4611
- "typescript"
4613
+ "typescript",
4614
+ ...nextConfig.serverExternalPackages ?? []
4612
4615
  ]);
4613
4616
  buildResult.outputFiles.forEach((file) => app.dist.writeFile(file.path, file.text));
4614
4617
  const appPackageJson = {
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "extends": "../../tsconfig.json",
3
3
  "compilerOptions": {
4
- "jsx": "preserve",
5
- "declaration": true,
6
- "declarationDir": "dist"
4
+ "jsx": "preserve"
7
5
  },
8
6
  "references": [
9
7
  {
@@ -4,16 +4,16 @@ function getContent(scanInfo, dict) {
4
4
  filename: `${dict.Model}.Template.tsx`,
5
5
  content: `
6
6
  "use client";
7
+ import { Field, Layout } from "@akanjs/ui";
7
8
  import { cnst, st, usePage } from "@${dict.sysName}/client";
8
- import { Layout, Field } from "@akanjs/ui";
9
9
 
10
- interface ${dict.Model}EditProps {
10
+ interface GeneralProps {
11
11
  className?: string;
12
12
  }
13
13
 
14
- export const General = ({ className }: ${dict.Model}EditProps) => {
15
- const ${dict.model}Form = st.use.${dict.model}Form();
14
+ export const General = ({ className }: GeneralProps) => {
16
15
  const { l } = usePage();
16
+ const ${dict.model}Form = st.use.${dict.model}Form();
17
17
  return (
18
18
  <Layout.Template className={className}>
19
19
  <Field.Text
@@ -11,8 +11,9 @@ import { ClientInit, ClientView } from "@akanjs/signal";
11
11
  interface CardProps {
12
12
  className?: string;
13
13
  init: ClientInit<"${dict.model}", cnst.Light${dict.Model}>;
14
+ sliceName?: string;
14
15
  }
15
- export const Card = ({ className, init }: CardProps) => {
16
+ export const Card = ({ className, init, sliceName }: CardProps) => {
16
17
  return (
17
18
  <Load.Units
18
19
  className={className}
@@ -16,7 +16,7 @@ export class ${dict.Model}Model extends into(${dict.Model}, ${dict.Model}Filter,
16
16
 
17
17
  export class ${dict.Model}Middleware extends beyond(${dict.Model}Model, ${dict.Model}) {
18
18
  onSchema(schema: SchemaOf<${dict.Model}Model, ${dict.Model}>) {
19
- // schema.index({ status: 1 })
19
+ // schema.index({ field: 1 })
20
20
  }
21
21
  }
22
22
  `;
@@ -3,10 +3,9 @@ function getContent(scanInfo, dict) {
3
3
  return `
4
4
  import { serve } from "@akanjs/service";
5
5
 
6
- import * as cnst from "../cnst";
7
6
  import * as db from "../db";
8
7
 
9
- export class ${dict.Model}Service extends serve(db.${dict.model}, () => ({})) {}
8
+ export class ${dict.Model}Service extends serve(db.${dict.model}, ({ use, service }) => ({})) {}
10
9
  `;
11
10
  }
12
11
  export {
@@ -7,7 +7,7 @@ import { endpoint, internal, slice } from "@akanjs/signal";
7
7
  import * as cnst from "../cnst";
8
8
  import * as srv from "../srv";
9
9
 
10
- export class ${dict.Model}Internal extends internal(srv.${dict.model}, () => ({})) {}
10
+ export class ${dict.Model}Internal extends internal(srv.${dict.model}, ({ interval }) => ({})) {}
11
11
 
12
12
  export class ${dict.Model}Slice extends slice(srv.${dict.model}, { guards: { root: Public, get: Public, cru: Public } }, (init) => ({
13
13
  inPublic: init()
@@ -16,7 +16,7 @@ export class ${dict.Model}Slice extends slice(srv.${dict.model}, { guards: { roo
16
16
  }),
17
17
  })) {}
18
18
 
19
- export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, () => ({})) {}
19
+ export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, ({ query, mutation }) => ({})) {}
20
20
  `;
21
21
  }
22
22
  export {
@@ -3,7 +3,8 @@ function getContent(scanInfo, dict) {
3
3
  return `
4
4
  import { store } from "@akanjs/store";
5
5
 
6
- import { sig } from "../useClient";
6
+ import * as cnst from "../cnst";
7
+ import { fetch, sig } from "../useClient";
7
8
 
8
9
  export class ${dict.Model}Store extends store(sig.${dict.model}, {
9
10
  // state
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "sourceType": "module",
4
4
  "name": "@akanjs/cli",
5
- "version": "1.0.1",
5
+ "version": "1.0.3",
6
6
  "bin": {
7
7
  "akan": "esm/index.js"
8
8
  },