@bleedingdev/modern-js-create 3.2.0-ultramodern.101 → 3.2.0-ultramodern.103
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/dist/index.js +317 -3
- package/dist/types/locale/index.d.ts +117 -2
- package/package.json +3 -3
- package/template/README.md +6 -0
- package/template/config/favicon.svg +5 -0
- package/template/config/public/assets/ultramodern-logo.svg +6 -0
- package/template/config/public/locales/cs/translation.json +5 -0
- package/template/config/public/locales/en/translation.json +5 -0
- package/template/modern.config.ts.handlebars +6 -0
- package/template/scripts/validate-ultramodern.mjs.handlebars +93 -0
- package/template/src/routes/[lang]/page.tsx.handlebars +39 -41
- package/template/src/routes/index.css.handlebars +192 -55
- package/template/tests/ultramodern.contract.test.ts.handlebars +57 -0
- package/template/tsconfig.json +1 -1
|
@@ -25,6 +25,63 @@ describe('generated UltraModern contract', () => {
|
|
|
25
25
|
{{/unless}}
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
test('keeps UltraModern starter web correctness defaults', () => {
|
|
29
|
+
const routePage = readText('src/routes/[lang]/page.tsx');
|
|
30
|
+
const routeCss = readText('src/routes/index.css');
|
|
31
|
+
const modernConfig = readText('modern.config.ts');
|
|
32
|
+
const enLocale = readJson<{
|
|
33
|
+
home?: {
|
|
34
|
+
meta?: {
|
|
35
|
+
description?: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
};
|
|
38
|
+
skipLink?: string;
|
|
39
|
+
};
|
|
40
|
+
}>('config/public/locales/en/translation.json');
|
|
41
|
+
|
|
42
|
+
expect(fs.existsSync(path.join(root, 'config/favicon.svg'))).toBe(true);
|
|
43
|
+
expect(
|
|
44
|
+
fs.existsSync(
|
|
45
|
+
path.join(root, 'config/public/assets/ultramodern-logo.svg'),
|
|
46
|
+
),
|
|
47
|
+
).toBe(true);
|
|
48
|
+
expect(routePage).not.toContain('lf3-static.bytednsdoc.com');
|
|
49
|
+
expect(routePage).toContain('<Helmet');
|
|
50
|
+
expect(routePage).toContain('htmlAttributes={{');
|
|
51
|
+
expect(routePage).toContain('dir: languageDirections[currentLanguage]');
|
|
52
|
+
expect(routePage).toContain('lang: currentLanguage');
|
|
53
|
+
expect(routePage).toContain('<title>{pageTitle}</title>');
|
|
54
|
+
expect(routePage).toContain(
|
|
55
|
+
'<meta name="description" content={pageDescription} />',
|
|
56
|
+
);
|
|
57
|
+
expect(routePage).toContain(
|
|
58
|
+
'<main id="starter-main" className="starter-main">',
|
|
59
|
+
);
|
|
60
|
+
expect(routePage).toContain('<h1 id="starter-heading" className="title">');
|
|
61
|
+
expect(routePage).toContain('src="/assets/ultramodern-logo.svg"');
|
|
62
|
+
expect(routePage).toContain('height={96}');
|
|
63
|
+
expect(routePage).toContain('width={96}');
|
|
64
|
+
expect(routePage).toContain(
|
|
65
|
+
'<span aria-hidden="true" className="arrow-right" />',
|
|
66
|
+
);
|
|
67
|
+
expect(routePage).not.toContain('<div className="title">');
|
|
68
|
+
expect(modernConfig).toContain(
|
|
69
|
+
'width=device-width, initial-scale=1.0, viewport-fit=cover',
|
|
70
|
+
);
|
|
71
|
+
expect(modernConfig).not.toContain('user-scalable=no');
|
|
72
|
+
expect(modernConfig).not.toContain('maximum-scale');
|
|
73
|
+
expect(routeCss).toContain('min-block-size: 100dvh');
|
|
74
|
+
expect(routeCss).toContain(
|
|
75
|
+
'grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr))',
|
|
76
|
+
);
|
|
77
|
+
expect(routeCss).toContain(':focus-visible');
|
|
78
|
+
expect(routeCss).toContain('@media (prefers-reduced-motion: reduce)');
|
|
79
|
+
expect(routeCss).not.toContain('width: 1100px');
|
|
80
|
+
expect(enLocale.home?.meta?.title).toBe('UltraModern.js Starter');
|
|
81
|
+
expect(enLocale.home?.meta?.description).toBeTruthy();
|
|
82
|
+
expect(enLocale.home?.skipLink).toBeTruthy();
|
|
83
|
+
});
|
|
84
|
+
|
|
28
85
|
test('retains package-source metadata for generated Modern.js packages', () => {
|
|
29
86
|
const packageJson = readJson<{
|
|
30
87
|
dependencies?: Record<string, string>;
|