@jjlmoya/utils-language 1.1.0
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.
- package/.github/workflows/npm-publish.yml +40 -0
- package/.gitignore +6 -0
- package/.stylelintrc.json +98 -0
- package/astro.config.mjs +19 -0
- package/eslint.config.js +201 -0
- package/package.json +79 -0
- package/prompts/create_tool.md +98 -0
- package/prompts/i18n/de.md +16 -0
- package/prompts/i18n/en.md +16 -0
- package/prompts/i18n/es.md +16 -0
- package/prompts/i18n/fr.md +16 -0
- package/prompts/i18n/id.md +16 -0
- package/prompts/i18n/it.md +16 -0
- package/prompts/i18n/ja.md +16 -0
- package/prompts/i18n/ko.md +16 -0
- package/prompts/i18n/nl.md +16 -0
- package/prompts/i18n/pl.md +16 -0
- package/prompts/i18n/pt.md +16 -0
- package/prompts/i18n/ru.md +16 -0
- package/prompts/i18n/sv.md +16 -0
- package/prompts/i18n/tr.md +16 -0
- package/prompts/i18n/zh.md +16 -0
- package/prompts/seo.md +58 -0
- package/prompts/translations/french.md +33 -0
- package/scripts/postinstall.mjs +27 -0
- package/src/category/LanguageCategorySEO.astro +9 -0
- package/src/category/i18n/de.ts +15 -0
- package/src/category/i18n/en.ts +23 -0
- package/src/category/i18n/es.ts +15 -0
- package/src/category/i18n/fr.ts +15 -0
- package/src/category/i18n/id.ts +15 -0
- package/src/category/i18n/it.ts +15 -0
- package/src/category/i18n/ja.ts +15 -0
- package/src/category/i18n/ko.ts +15 -0
- package/src/category/i18n/nl.ts +15 -0
- package/src/category/i18n/pl.ts +15 -0
- package/src/category/i18n/pt.ts +15 -0
- package/src/category/i18n/ru.ts +15 -0
- package/src/category/i18n/shared.ts +11 -0
- package/src/category/i18n/sv.ts +15 -0
- package/src/category/i18n/tr.ts +15 -0
- package/src/category/i18n/zh.ts +15 -0
- package/src/category/index.ts +24 -0
- package/src/components/PreviewNavSidebar.astro +116 -0
- package/src/components/PreviewToolbar.astro +143 -0
- package/src/data.ts +10 -0
- package/src/entries.ts +3 -0
- package/src/env.d.ts +5 -0
- package/src/index.ts +23 -0
- package/src/layouts/PreviewLayout.astro +118 -0
- package/src/pages/[locale]/[slug].astro +163 -0
- package/src/pages/[locale].astro +251 -0
- package/src/pages/index.astro +3 -0
- package/src/tests/bibliography_wellformed_export.test.ts +46 -0
- package/src/tests/diacritics_density.test.ts +118 -0
- package/src/tests/faq_count.test.ts +18 -0
- package/src/tests/i18n_coverage.test.ts +34 -0
- package/src/tests/inverted_punctuation.test.ts +84 -0
- package/src/tests/locale_completeness.test.ts +23 -0
- package/src/tests/mocks/astro_mock.js +2 -0
- package/src/tests/no_em_dash.test.ts +47 -0
- package/src/tests/no_en_dash.test.ts +70 -0
- package/src/tests/no_h1_in_components.test.ts +48 -0
- package/src/tests/pagespeed_best_practices.test.ts +198 -0
- package/src/tests/schemas_fulfillment.test.ts +23 -0
- package/src/tests/script_density.test.ts +94 -0
- package/src/tests/seo_length.test.ts +23 -0
- package/src/tests/seo_parity.test.ts +60 -0
- package/src/tests/seo_translation_completeness.test.ts +69 -0
- package/src/tests/seo_wellformed_export.test.ts +65 -0
- package/src/tests/shared-test-helpers.ts +56 -0
- package/src/tests/slug_language_code_format.test.ts +23 -0
- package/src/tests/slug_uniqueness.test.ts +81 -0
- package/src/tests/spanish_leakage.test.ts +175 -0
- package/src/tests/title_quality.test.ts +55 -0
- package/src/tests/tool_exports.test.ts +34 -0
- package/src/tests/tool_validation.test.ts +16 -0
- package/src/tests/translation_copy.test.ts +122 -0
- package/src/tool/language-learning-study-plan-planner/bibliography.astro +6 -0
- package/src/tool/language-learning-study-plan-planner/bibliography.ts +6 -0
- package/src/tool/language-learning-study-plan-planner/component.astro +274 -0
- package/src/tool/language-learning-study-plan-planner/entry.ts +34 -0
- package/src/tool/language-learning-study-plan-planner/i18n/de.ts +22 -0
- package/src/tool/language-learning-study-plan-planner/i18n/en.ts +103 -0
- package/src/tool/language-learning-study-plan-planner/i18n/es.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/fr.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/id.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/it.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/ja.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/ko.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/nl.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/pl.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/pt.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/ru.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/shared.ts +70 -0
- package/src/tool/language-learning-study-plan-planner/i18n/sv.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/tr.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/i18n/zh.ts +21 -0
- package/src/tool/language-learning-study-plan-planner/index.ts +4 -0
- package/src/tool/language-learning-study-plan-planner/language-learning-study-plan-planner.css +403 -0
- package/src/tool/language-learning-study-plan-planner/logic.test.ts +59 -0
- package/src/tool/language-learning-study-plan-planner/logic.ts +157 -0
- package/src/tool/language-learning-study-plan-planner/seo.astro +9 -0
- package/src/tool/language-learning-study-plan-planner/types.ts +42 -0
- package/src/tool/language-learning-study-plan-planner/ui.ts +46 -0
- package/src/tools.ts +6 -0
- package/src/types.ts +68 -0
- package/tsconfig.json +15 -0
- package/vitest.config.ts +20 -0
package/src/tools.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ToolDefinition } from './types';
|
|
2
|
+
import { LANGUAGE_LEARNING_STUDY_PLAN_PLANNER_TOOL } from './tool/language-learning-study-plan-planner';
|
|
3
|
+
|
|
4
|
+
export const ALL_TOOLS: ToolDefinition[] = [LANGUAGE_LEARNING_STUDY_PLAN_PLANNER_TOOL];
|
|
5
|
+
|
|
6
|
+
export { ALL_ENTRIES } from './entries';
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { SEOSection } from '@jjlmoya/utils-shared';
|
|
2
|
+
|
|
3
|
+
export type { SEOSection };
|
|
4
|
+
|
|
5
|
+
export type KnownLocale =
|
|
6
|
+
| 'ar' | 'da' | 'de' | 'en' | 'es' | 'fi'
|
|
7
|
+
| 'fr' | 'id' | 'it' | 'ja' | 'ko' | 'nb' | 'nl'
|
|
8
|
+
| 'pl' | 'pt' | 'ru' | 'sv' | 'tr' | 'zh';
|
|
9
|
+
|
|
10
|
+
export interface FAQItem {
|
|
11
|
+
question: string;
|
|
12
|
+
answer: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface BibliographyEntry {
|
|
16
|
+
name: string;
|
|
17
|
+
url: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface HowToStep {
|
|
21
|
+
name: string;
|
|
22
|
+
text: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ToolLocaleContent<TUI extends Record<string, string> = Record<string, string>> extends Record<string, unknown> {
|
|
26
|
+
slug: string;
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
ui: TUI;
|
|
30
|
+
seo: SEOSection[];
|
|
31
|
+
faq: FAQItem[];
|
|
32
|
+
bibliography: BibliographyEntry[];
|
|
33
|
+
howTo: HowToStep[];
|
|
34
|
+
schemas: Record<string, unknown>[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface CategoryLocaleContent {
|
|
38
|
+
slug: string;
|
|
39
|
+
title: string;
|
|
40
|
+
description: string;
|
|
41
|
+
seo: SEOSection[];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type LocaleLoader<T> = () => Promise<T>;
|
|
45
|
+
|
|
46
|
+
export type LocaleMap<T> = Partial<Record<KnownLocale, LocaleLoader<T>>>;
|
|
47
|
+
|
|
48
|
+
export interface LanguageToolEntry<TUI extends Record<string, string> = Record<string, string>> {
|
|
49
|
+
id: string;
|
|
50
|
+
icons: {
|
|
51
|
+
bg: string;
|
|
52
|
+
fg: string;
|
|
53
|
+
};
|
|
54
|
+
i18n: LocaleMap<ToolLocaleContent<TUI>>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface LanguageCategoryEntry {
|
|
58
|
+
icon: string;
|
|
59
|
+
tools: LanguageToolEntry[];
|
|
60
|
+
i18n: LocaleMap<CategoryLocaleContent>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ToolDefinition {
|
|
64
|
+
entry: LanguageToolEntry;
|
|
65
|
+
Component: unknown;
|
|
66
|
+
SEOComponent: unknown;
|
|
67
|
+
BibliographyComponent: unknown;
|
|
68
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "astro/tsconfigs/strictest",
|
|
3
|
+
"include": ["src/**/*", ".astro/types.d.ts"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"baseUrl": ".",
|
|
6
|
+
"strictNullChecks": true,
|
|
7
|
+
"noImplicitAny": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"types": ["astro/client", "astro/jsx-runtime"],
|
|
10
|
+
"jsx": "preserve",
|
|
11
|
+
"jsxImportSource": "astro"
|
|
12
|
+
},
|
|
13
|
+
"exclude": ["node_modules", "dist"]
|
|
14
|
+
}
|
|
15
|
+
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
test: {
|
|
6
|
+
environment: 'node',
|
|
7
|
+
},
|
|
8
|
+
resolve: {
|
|
9
|
+
alias: [
|
|
10
|
+
{
|
|
11
|
+
find: /^(.*)\.astro$/,
|
|
12
|
+
replacement: path.resolve(__dirname, './src/tests/mocks/astro_mock.js')
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
ssr: {
|
|
17
|
+
external: ['astro']
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|