silgi 0.36.9 → 0.36.11

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.
@@ -2,7 +2,7 @@ import { consola } from 'consola';
2
2
  import { createHooks, createDebugger } from 'hookable';
3
3
  import { resolve, join, relative, extname, basename, dirname, isAbsolute } from 'pathe';
4
4
  import { useSilgiCLI, replaceRuntimeValues, silgiCLICtx, autoImportTypes } from 'silgi';
5
- import { isPresents, addTemplate, addCoreFile, genEnsureSafeVar, relativeWithDot, hash, removeExtension, resolveAlias, directoryToURL, addImports, baseHeaderBannerComment, writeFile, normalizeTemplate, useLogger, resolveSilgiPath, hasSilgiModule, toArray, isDirectory } from 'silgi/kit';
5
+ import { isPresents, addTemplate, addCoreFile, genEnsureSafeVar, writeFile, relativeWithDot, hash, removeExtension, resolveAlias, directoryToURL, addImports, baseHeaderBannerComment, normalizeTemplate, useLogger, resolveSilgiPath, hasSilgiModule, toArray, isDirectory } from 'silgi/kit';
6
6
  import { runtimeDir } from 'silgi/runtime/meta';
7
7
  import { scanExports, createUnimport, toExports } from 'unimport';
8
8
  import * as p from '@clack/prompts';
@@ -267,7 +267,7 @@ async function nextJS(silgi, skip = false) {
267
267
  }
268
268
  }
269
269
  for (const prefix of routerPrefixs) {
270
- const file = `src/app${prefix}/[...all]/route.ts`;
270
+ const file = resolve(silgi.options.srcDir, "app", prefix, "[...all]", "route.ts");
271
271
  const fileExists = existsSync(file);
272
272
  if (!fileExists) {
273
273
  const serverDirName = `@/${silgi.options.silgi.serverDir.split("/src/")[1]}/core`;
@@ -278,12 +278,7 @@ import { buildSilgi } from '${serverDirName}'
278
278
  const silgi = await buildSilgi()
279
279
 
280
280
  export const { GET, POST, PUT, DELETE, PATCH } = toNextJsHandler()`;
281
- addTemplate({
282
- filename: file,
283
- where: ".silgi",
284
- write: true,
285
- getContents: () => template2
286
- });
281
+ await writeFile(file, template2, true);
287
282
  }
288
283
  }
289
284
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.36.9";
4
+ const version = "0.36.11";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -260,7 +260,7 @@ async function writeFile(file, contents, log = false) {
260
260
  typeof contents === "string" ? "utf8" : void 0
261
261
  );
262
262
  if (log) {
263
- consola$1.info("Generated", prettyPath(file));
263
+ silgi.logger.info("Generated", prettyPath(file));
264
264
  }
265
265
  }
266
266
  async function isDirectory$1(path) {
@@ -1,11 +1,11 @@
1
1
  import { addNPMPackage, defineSilgiPreset } from "silgi/kit";
2
2
  const next = defineSilgiPreset(
3
3
  {
4
- // output: {
5
- // dir: '{{ rootDir }}/.output',
6
- // publicDir: '{{ output.dir }}/public',
7
- // },
8
4
  serverDir: "{{ rootDir }}/src/server",
5
+ srcDir: "{{ rootDir }}/src",
6
+ build: {
7
+ dir: "{{ rootDir }}/.next"
8
+ },
9
9
  envOptions: {
10
10
  prefix: "NEXT_",
11
11
  altPrefix: "SILGI_"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.36.9",
4
+ "version": "0.36.11",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {