Skip to content

Commit

Permalink
config.ts生成のテンプレートにhistory用の型参照追加
Browse files Browse the repository at this point in the history
  • Loading branch information
elleonard committed Mar 5, 2024
1 parent 354ce6f commit 6447e6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions scripts/generateTemplate/generateConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export async function generateConfig(destDir: string) {
license: /excludes/.test(destDir) ? 'No License' : 'MIT',
year: new Date().getFullYear(),
pathToConfigBuilder: pathToConfigBuilder(configPath),
pathToConfigSchema: pathToCOnfigSchema(configPath),
pathToCreateParameter: pathToCreateParameter(configPath),
},
{},
Expand Down Expand Up @@ -78,6 +79,12 @@ function pathToConfigBuilder(destDir: string) {
return path.relative(destDir, configBuilderPath).replaceAll('\\', '/');
}

const configSchemaPath = path.resolve(__dirname, '..', '..', 'modules', 'config', 'configSchema.js');

function pathToCOnfigSchema(destDir: string) {
return path.relative(destDir, configSchemaPath).replaceAll('\\', '/');
}

const createParameterPath = path.resolve(__dirname, '..', '..', 'modules', 'config', 'createParameter.js');

function pathToCreateParameter(destDir: string) {
Expand Down
3 changes: 2 additions & 1 deletion src/templates/configTs.ejs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ConfigDefinitionBuilder } from '<%- pathToConfigBuilder %>';
import { PluginHistorySchema } from '<%- pathToConfigSchema %>';
import {} from '<%- pathToCreateParameter %>';
import { dedent } from '@qnighy/dedent';

const histories = [
const histories: PluginHistorySchema[] = [
{
date: "<%- year %>/",
version: "1.0.0",
Expand Down

0 comments on commit 6447e6a

Please sign in to comment.