@sealcode/sealgen 0.14.6 → 0.14.8

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.
@@ -33,6 +33,8 @@ const load_assets_plugin = {
33
33
  args.path
34
34
  )}";
35
35
 
36
+ const path = "${args.path}";
37
+
36
38
  import fs from "fs";
37
39
  let buffer_promise = null;
38
40
 
@@ -52,7 +54,7 @@ export const getBase64 = async function(){
52
54
  return buffer.toString("base64");
53
55
  }
54
56
 
55
- export default { getContent, url, getBase64, getBuffer };
57
+ export default { getContent, url, getBase64, getBuffer, path };
56
58
  `;
57
59
  return {
58
60
  contents
@@ -53,7 +53,7 @@ async function generateRoutes() {
53
53
  );
54
54
  const routes_content = `// DO NOT EDIT! This file is generated automaticaly with npm run generate-routes
55
55
 
56
- import Router from "@koa/router";
56
+ import type Router from "@koa/router";
57
57
  import { mount } from "@sealcode/sealgen";
58
58
  import * as URLs from "./urls.js"
59
59
 
@@ -1,5 +1,6 @@
1
1
  function collectionTemplate(collection_name) {
2
- return `import { Collection, FieldTypes, Policies } from "sealious";
2
+ return `import type { App, Policy } from "sealious";
3
+ import { Collection, FieldTypes, Policies } from "sealious";
3
4
 
4
5
  export default class ${collection_name} extends Collection {
5
6
  fields = {
@@ -1,12 +1,12 @@
1
1
  import { toKebabCase, toPascalCase } from "js-convert-case";
2
2
  function jddComponentTemplate(component_name) {
3
- return `import { FlatTemplatable, TempstreamJSX } from "tempstream";
4
- import {
5
- Component,
6
- ComponentArguments,
3
+ return `import type { FlatTemplatable } from "tempstream";
4
+ import { TempstreamJSX } from "tempstream";
5
+ import type {
7
6
  ExtractStructuredComponentArgumentsValues,
8
7
  JDDContext,
9
8
  } from "@sealcode/jdd";
9
+ import { Component, ComponentArguments } from "@sealcode/jdd";
10
10
 
11
11
  const component_arguments = {
12
12
  title: new ComponentArguments.ShortText(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealcode/sealgen",
3
- "version": "0.14.6",
3
+ "version": "0.14.8",
4
4
  "description": "Module to automate adding routes and collections to a sealious application",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -38,6 +38,8 @@ export const load_assets_plugin = {
38
38
  args.path
39
39
  )}";
40
40
 
41
+ const path = "${args.path}";
42
+
41
43
  import fs from "fs";
42
44
  let buffer_promise = null;
43
45
 
@@ -57,7 +59,7 @@ export const getBase64 = async function(){
57
59
  return buffer.toString("base64");
58
60
  }
59
61
 
60
- export default { getContent, url, getBase64, getBuffer };
62
+ export default { getContent, url, getBase64, getBuffer, path };
61
63
  `;
62
64
  return {
63
65
  contents,
@@ -72,7 +72,7 @@ export async function generateRoutes(): Promise<void> {
72
72
 
73
73
  const routes_content = `// DO NOT EDIT! This file is generated automaticaly with npm run generate-routes
74
74
 
75
- import Router from "@koa/router";
75
+ import type Router from "@koa/router";
76
76
  import { mount } from "@sealcode/sealgen";
77
77
  import * as URLs from "./urls.js"
78
78
 
@@ -1,5 +1,6 @@
1
1
  export function collectionTemplate(collection_name: string) {
2
- return `import { Collection, FieldTypes, Policies } from "sealious";
2
+ return `import type { App, Policy } from "sealious";
3
+ import { Collection, FieldTypes, Policies } from "sealious";
3
4
 
4
5
  export default class ${collection_name} extends Collection {
5
6
  fields = {
@@ -1,13 +1,13 @@
1
1
  import { toKebabCase, toPascalCase } from "js-convert-case";
2
2
 
3
3
  export function jddComponentTemplate(component_name: string) {
4
- return `import { FlatTemplatable, TempstreamJSX } from "tempstream";
5
- import {
6
- Component,
7
- ComponentArguments,
4
+ return `import type { FlatTemplatable } from "tempstream";
5
+ import { TempstreamJSX } from "tempstream";
6
+ import type {
8
7
  ExtractStructuredComponentArgumentsValues,
9
8
  JDDContext,
10
9
  } from "@sealcode/jdd";
10
+ import { Component, ComponentArguments } from "@sealcode/jdd";
11
11
 
12
12
  const component_arguments = {
13
13
  title: new ComponentArguments.ShortText(),
package/tsconfig.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "node16",
3
+ "module": "es2022",
4
4
  "moduleResolution": "node16",
5
5
  "noImplicitAny": true,
6
6
  "noImplicitThis": true,