@akanjs/devkit 0.0.150 → 0.0.151

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.
@@ -307,11 +307,12 @@ class Executor {
307
307
  dict = {},
308
308
  overwrite = true
309
309
  }) {
310
- const templatePath = `${__dirname}/src/templates${template ? `/${template}` : ""}`.replace(".ts", ".js");
311
- if (import_fs.default.statSync(templatePath).isFile()) {
312
- const filename = import_path.default.basename(templatePath);
310
+ const templatePath = `${__dirname}/src/templates${template ? `/${template}` : ""}`;
311
+ const prefixTemplatePath = templatePath.endsWith(".tsx") ? templatePath : templatePath.replace(".ts", ".js");
312
+ if (import_fs.default.statSync(prefixTemplatePath).isFile()) {
313
+ const filename = import_path.default.basename(prefixTemplatePath);
313
314
  const fileContent = await this.#applyTemplateFile(
314
- { templatePath, targetPath: import_path.default.join(basePath, filename), scanResult, overwrite },
315
+ { templatePath: prefixTemplatePath, targetPath: import_path.default.join(basePath, filename), scanResult, overwrite },
315
316
  dict
316
317
  );
317
318
  return fileContent ? [fileContent] : [];
@@ -272,11 +272,12 @@ class Executor {
272
272
  dict = {},
273
273
  overwrite = true
274
274
  }) {
275
- const templatePath = `${__dirname}/src/templates${template ? `/${template}` : ""}`.replace(".ts", ".js");
276
- if (fs.statSync(templatePath).isFile()) {
277
- const filename = path.basename(templatePath);
275
+ const templatePath = `${__dirname}/src/templates${template ? `/${template}` : ""}`;
276
+ const prefixTemplatePath = templatePath.endsWith(".tsx") ? templatePath : templatePath.replace(".ts", ".js");
277
+ if (fs.statSync(prefixTemplatePath).isFile()) {
278
+ const filename = path.basename(prefixTemplatePath);
278
279
  const fileContent = await this.#applyTemplateFile(
279
- { templatePath, targetPath: path.join(basePath, filename), scanResult, overwrite },
280
+ { templatePath: prefixTemplatePath, targetPath: path.join(basePath, filename), scanResult, overwrite },
280
281
  dict
281
282
  );
282
283
  return fileContent ? [fileContent] : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "0.0.150",
3
+ "version": "0.0.151",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -102,7 +102,7 @@ export declare class WorkspaceExecutor extends Executor {
102
102
  getBaseDevEnv(): {
103
103
  repoName: string;
104
104
  serveDomain: string;
105
- env: "testing" | "local" | "debug" | "develop" | "main";
105
+ env: "debug" | "testing" | "local" | "develop" | "main";
106
106
  name?: string | undefined;
107
107
  };
108
108
  scan(): Promise<WorkspaceScanResult>;
@@ -215,7 +215,7 @@ export declare class AppExecutor extends SysExecutor {
215
215
  emoji: string;
216
216
  constructor({ workspace, name }: AppExecutorOptions);
217
217
  static from(executor: SysExecutor | WorkspaceExecutor, name: string): AppExecutor;
218
- getEnv(): "testing" | "local" | "debug" | "develop" | "main";
218
+ getEnv(): "debug" | "testing" | "local" | "develop" | "main";
219
219
  getConfig(command?: string): Promise<AppConfigResult>;
220
220
  syncAssets(libDeps: string[]): Promise<void>;
221
221
  }