Skip to content

feat: specify add-on options in command args #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/addons/_tests/paraglide/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { test, variants, prepareServer } = setupTest({ paraglide });

const kitOnly = variants.filter((v) => v.includes('kit'));
test.concurrent.for(kitOnly)('core - %s', async (variant, { page, ...ctx }) => {
const cwd = await ctx.run(variant, { paraglide: { demo: true, availableLanguageTags: 'en' } });
const cwd = await ctx.run(variant, { paraglide: { demo: true, languageTags: 'en' } });

const { close } = await prepareServer({ cwd, page });
// kill server process when we're done
Expand Down
8 changes: 4 additions & 4 deletions packages/addons/paraglide/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const DEFAULT_INLANG_PROJECT = {
};

const options = defineAddonOptions({
availableLanguageTags: {
languageTags: {
question: `Which languages would you like to support? ${colors.gray('(e.g. en,de-ch)')}`,
type: 'string',
default: 'en, es',
Expand Down Expand Up @@ -78,7 +78,7 @@ export default defineAddon({
for (const key in DEFAULT_INLANG_PROJECT) {
data[key] = DEFAULT_INLANG_PROJECT[key as keyof typeof DEFAULT_INLANG_PROJECT];
}
const { validLanguageTags } = parseLanguageTagInput(options.availableLanguageTags);
const { validLanguageTags } = parseLanguageTagInput(options.languageTags);
const baseLocale = validLanguageTags[0];

data.baseLocale = baseLocale;
Expand Down Expand Up @@ -205,7 +205,7 @@ export default defineAddon({

// add links to other localized pages, the first one is the default
// language, thus it does not require any localized route
const { validLanguageTags } = parseLanguageTagInput(options.availableLanguageTags);
const { validLanguageTags } = parseLanguageTagInput(options.languageTags);
const links = validLanguageTags
.map(
(x) =>
Expand All @@ -222,7 +222,7 @@ export default defineAddon({
});
}

const { validLanguageTags } = parseLanguageTagInput(options.availableLanguageTags);
const { validLanguageTags } = parseLanguageTagInput(options.languageTags);
for (const languageTag of validLanguageTags) {
sv.file(`messages/${languageTag}.json`, (content) => {
const { data, generateCode } = parseJson(content);
Expand Down
Loading