silgi 0.36.15 → 0.36.17

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.
@@ -1118,12 +1118,19 @@ async function prepareScanFile(silgi) {
1118
1118
  ];
1119
1119
  const generateExport = (name, items, defaultEmpty = "{}") => {
1120
1120
  const hasItems = items.length > 0;
1121
- return [
1122
- `export const ${name} = ${hasItems ? "deepMergeObjects([" : defaultEmpty}`,
1123
- ...items.map((item) => ` ${item},`),
1124
- hasItems ? "])" : defaultEmpty === "{}" ? "}" : "",
1125
- ""
1126
- ];
1121
+ if (hasItems) {
1122
+ return [
1123
+ `export const ${name} = deepMergeObjects([`,
1124
+ ...items.map((item) => ` ${item},`),
1125
+ "])",
1126
+ ""
1127
+ ];
1128
+ } else {
1129
+ return [
1130
+ `export const ${name} = ${defaultEmpty}`,
1131
+ ""
1132
+ ];
1133
+ }
1127
1134
  };
1128
1135
  const importData = [
1129
1136
  "",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.36.15";
4
+ const version = "0.36.17";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -225,7 +225,7 @@ declare function defineSilgiModule<TOptions extends ModuleOptionsCustom>(): {
225
225
  };
226
226
 
227
227
  declare function prettyPath(p: string, highlight?: boolean): string;
228
- declare function resolveSilgiPath(path: string, silgiOptions: SilgiCLI["options"], base?: string): string;
228
+ declare function resolveSilgiPath(path: string, silgiCLIOptions: SilgiCLI['options'], base?: string): string;
229
229
 
230
230
  declare function defineSilgiPreset<P extends SilgiPreset, M extends SilgiPresetMeta>(preset: P, meta?: M): P & {
231
231
  _meta: SilgiPresetMeta;
@@ -224,20 +224,20 @@ function prettyPath(p, highlight = true) {
224
224
  p = relative(process.cwd(), p);
225
225
  return highlight ? colors.cyan(p) : p;
226
226
  }
227
- function resolveSilgiPath(path, silgiOptions, base) {
227
+ function resolveSilgiPath(path, silgiCLIOptions, base) {
228
228
  if (typeof path !== "string") {
229
- throw new TypeError("Invalid path: " + path);
229
+ throw new TypeError(`Invalid path: ${path}`);
230
230
  }
231
- path = _compilePathTemplate(path)(silgiOptions);
232
- for (const base2 in silgiOptions.alias) {
231
+ path = _compilePathTemplate(path)(silgiCLIOptions);
232
+ for (const base2 in silgiCLIOptions.alias) {
233
233
  if (path.startsWith(base2)) {
234
- path = silgiOptions.alias[base2] + path.slice(base2.length);
234
+ path = silgiCLIOptions.alias[base2] + path.slice(base2.length);
235
235
  }
236
236
  }
237
- return resolve(base || silgiOptions.srcDir, path);
237
+ return resolve(base || silgiCLIOptions.srcDir, path);
238
238
  }
239
239
  function _compilePathTemplate(contents) {
240
- return (params) => contents.replace(/{{ ?([\w.]+) ?}}/g, (_, match) => {
240
+ return (params) => contents.replace(/\{\{ ?([\w.]+) ?\}\}/g, (_, match) => {
241
241
  const val = getProperty(params, match);
242
242
  if (!val) {
243
243
  consola.warn(
@@ -1,8 +1,8 @@
1
1
  import { addNPMPackage, defineSilgiPreset } from "silgi/kit";
2
2
  const next = defineSilgiPreset(
3
3
  {
4
- serverDir: "{{ rootDir }}/src/server",
5
- srcDir: "{{ rootDir }}/src",
4
+ serverDir: "src/server",
5
+ srcDir: "src",
6
6
  envOptions: {
7
7
  prefix: "NEXT_",
8
8
  altPrefix: "SILGI_"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.36.15",
4
+ "version": "0.36.17",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {