@screegen/cli 0.0.1 → 0.0.3
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 +4 -4
- package/package.json +3 -5
- package/templates/.gitignore.template +39 -0
- package/templates/package.json.template +4 -2
- package/templates/screegen.config.ts.template +10 -29
- package/templates/src/App.tsx.template +3 -67
- package/templates/src/screens/ExampleScreen.module.scss.template +29 -0
- package/templates/src/screens/ExampleScreen.tsx.template +16 -0
- package/templates/src/translations.ts.template +0 -8
- package/templates/src/screens/FeaturesScreen.module.scss.template +0 -57
- package/templates/src/screens/FeaturesScreen.tsx.template +0 -36
package/dist/index.js
CHANGED
|
@@ -79,14 +79,14 @@ Creating screegen project: ${projectName}
|
|
|
79
79
|
"src/translations.ts"
|
|
80
80
|
);
|
|
81
81
|
await copyTemplate(
|
|
82
|
-
"src/screens/
|
|
82
|
+
"src/screens/ExampleScreen.tsx.template",
|
|
83
83
|
targetDir,
|
|
84
|
-
"src/screens/
|
|
84
|
+
"src/screens/ExampleScreen.tsx"
|
|
85
85
|
);
|
|
86
86
|
await copyTemplate(
|
|
87
|
-
"src/screens/
|
|
87
|
+
"src/screens/ExampleScreen.module.scss.template",
|
|
88
88
|
targetDir,
|
|
89
|
-
"src/screens/
|
|
89
|
+
"src/screens/ExampleScreen.module.scss"
|
|
90
90
|
);
|
|
91
91
|
console.log(chalk.green("Project created successfully!\n"));
|
|
92
92
|
console.log(chalk.gray("Next steps:\n"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@screegen/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"screegen": "bin/screegen.js"
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
"dev": "tsup --watch",
|
|
18
18
|
"build": "tsup",
|
|
19
19
|
"lint": "eslint src",
|
|
20
|
-
"test": "vitest run --coverage"
|
|
21
|
-
"generate-templates": "tsx scripts/generate-templates.ts",
|
|
22
|
-
"publish": "npm publish --access=public"
|
|
20
|
+
"test": "vitest run --coverage"
|
|
23
21
|
},
|
|
24
22
|
"dependencies": {
|
|
25
23
|
"chalk": "^5.3.0",
|
|
@@ -49,4 +47,4 @@
|
|
|
49
47
|
"typescript-eslint": "^8.52.0",
|
|
50
48
|
"vitest": "^4.0.16"
|
|
51
49
|
}
|
|
52
|
-
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build outputs
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
|
|
8
|
+
# Test coverage
|
|
9
|
+
coverage/
|
|
10
|
+
|
|
11
|
+
# Screenshots output
|
|
12
|
+
screenshots/
|
|
13
|
+
.screegen-temp/
|
|
14
|
+
|
|
15
|
+
# Misc
|
|
16
|
+
.DS_Store
|
|
17
|
+
*.local
|
|
18
|
+
|
|
19
|
+
# Logs
|
|
20
|
+
npm-debug.log*
|
|
21
|
+
yarn-debug.log*
|
|
22
|
+
yarn-error.log*
|
|
23
|
+
|
|
24
|
+
# Yarn
|
|
25
|
+
.pnp.*
|
|
26
|
+
.yarn/*
|
|
27
|
+
!.yarn/patches
|
|
28
|
+
!.yarn/plugins
|
|
29
|
+
!.yarn/releases
|
|
30
|
+
!.yarn/sdks
|
|
31
|
+
!.yarn/versions
|
|
32
|
+
|
|
33
|
+
# TypeScript
|
|
34
|
+
*.tsbuildinfo
|
|
35
|
+
|
|
36
|
+
# IDE
|
|
37
|
+
.idea/
|
|
38
|
+
*.swp
|
|
39
|
+
*.swo
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{projectName}}",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
+
"packageManager": "yarn@4.6.0",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"dev": "vite",
|
|
8
9
|
"build": "tsc && vite build",
|
|
@@ -10,7 +11,8 @@
|
|
|
10
11
|
"generate": "screegen generate"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
|
-
"@screegen/components": "^
|
|
14
|
+
"@screegen/components": "^0.0.3",
|
|
15
|
+
"@screegen/cli": "^0.0.3",
|
|
14
16
|
"react": "^18.3.1",
|
|
15
17
|
"react-dom": "^18.3.1",
|
|
16
18
|
"react-router-dom": "^6.28.2"
|
|
@@ -1,41 +1,22 @@
|
|
|
1
|
-
import { ProjectConfig
|
|
2
|
-
import {
|
|
3
|
-
import { t } from "./src/translations";
|
|
1
|
+
import { ProjectConfig } from '@screegen/components';
|
|
2
|
+
import { ExampleScreen } from './src/screens/ExampleScreen';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// Wrapper component that provides translations
|
|
8
|
-
function FeaturesScreenWrapper({ language, deviceKey }: ScreenComponentProps) {
|
|
9
|
-
return (
|
|
10
|
-
<FeaturesScreen
|
|
11
|
-
language={language}
|
|
12
|
-
deviceKey={deviceKey}
|
|
13
|
-
title={t(language, "title")}
|
|
14
|
-
subtitle={t(language, "subtitle")}
|
|
15
|
-
features={[
|
|
16
|
-
{ title: t(language, "feature1"), description: t(language, "feature1Desc") },
|
|
17
|
-
{ title: t(language, "feature2"), description: t(language, "feature2Desc") },
|
|
18
|
-
]}
|
|
19
|
-
/>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const config: ProjectConfig<AppLanguageCode> = {
|
|
24
|
-
languages: ["en-US", "de-DE"],
|
|
4
|
+
const config: ProjectConfig = {
|
|
5
|
+
languages: ['en-US', 'de-DE'],
|
|
25
6
|
devices: [
|
|
26
7
|
{
|
|
27
|
-
key:
|
|
28
|
-
fastlaneKeys: [
|
|
8
|
+
key: 'iphone',
|
|
9
|
+
fastlaneKeys: ['APP_IPHONE_67'],
|
|
29
10
|
width: 1290,
|
|
30
11
|
height: 2796,
|
|
31
|
-
screens: [{ key:
|
|
12
|
+
screens: [{ key: 'example', component: ExampleScreen }],
|
|
32
13
|
},
|
|
33
14
|
{
|
|
34
|
-
key:
|
|
35
|
-
fastlaneKeys: [
|
|
15
|
+
key: 'ipad',
|
|
16
|
+
fastlaneKeys: ['APP_IPAD_PRO_129'],
|
|
36
17
|
width: 2048,
|
|
37
18
|
height: 2732,
|
|
38
|
-
screens: [{ key:
|
|
19
|
+
screens: [{ key: 'example', component: ExampleScreen }],
|
|
39
20
|
},
|
|
40
21
|
],
|
|
41
22
|
};
|
|
@@ -1,72 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
Screen,
|
|
4
|
-
OverviewGrid,
|
|
5
|
-
ScreengenConfig,
|
|
6
|
-
useColorScheme,
|
|
7
|
-
useUrlState,
|
|
8
|
-
ColorScheme,
|
|
9
|
-
} from '@screegen/components';
|
|
10
|
-
import config, { AppLanguageCode } from '../screegen.config';
|
|
11
|
-
|
|
12
|
-
function ScreenPage() {
|
|
13
|
-
const { deviceKey, screenKey, language } = useParams<{
|
|
14
|
-
deviceKey: string;
|
|
15
|
-
screenKey: string;
|
|
16
|
-
language: string;
|
|
17
|
-
}>();
|
|
18
|
-
|
|
19
|
-
if (!deviceKey || !screenKey || !language) {
|
|
20
|
-
return <div>Invalid screen parameters</div>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Screen
|
|
25
|
-
config={config}
|
|
26
|
-
deviceKey={deviceKey}
|
|
27
|
-
screenKey={screenKey}
|
|
28
|
-
language={language as AppLanguageCode}
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function OverviewPage() {
|
|
34
|
-
const [language, setLanguage] = useUrlState<AppLanguageCode>(
|
|
35
|
-
'language',
|
|
36
|
-
config.languages[0]
|
|
37
|
-
);
|
|
38
|
-
const [scale, setScale] = useUrlState<string>('scale', '0.25');
|
|
39
|
-
const [colorSchemeParam, setColorScheme] = useUrlState<ColorScheme | ''>(
|
|
40
|
-
'colorScheme',
|
|
41
|
-
''
|
|
42
|
-
);
|
|
43
|
-
const systemColorScheme = useColorScheme();
|
|
44
|
-
const colorScheme = colorSchemeParam || systemColorScheme;
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<OverviewGrid
|
|
48
|
-
config={config}
|
|
49
|
-
language={language}
|
|
50
|
-
scale={parseFloat(scale)}
|
|
51
|
-
colorScheme={colorScheme}
|
|
52
|
-
onLanguageChange={setLanguage}
|
|
53
|
-
onScaleChange={(s) => setScale(String(s))}
|
|
54
|
-
onColorSchemeChange={setColorScheme}
|
|
55
|
-
/>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
1
|
+
import { Screegen } from '@screegen/components';
|
|
2
|
+
import config from '../screegen.config';
|
|
58
3
|
|
|
59
4
|
function App() {
|
|
60
|
-
return
|
|
61
|
-
<Routes>
|
|
62
|
-
<Route path="/" element={<OverviewPage />} />
|
|
63
|
-
<Route path="/config" element={<ScreengenConfig config={config} />} />
|
|
64
|
-
<Route
|
|
65
|
-
path="/screens/:deviceKey/:screenKey/:language"
|
|
66
|
-
element={<ScreenPage />}
|
|
67
|
-
/>
|
|
68
|
-
</Routes>
|
|
69
|
-
);
|
|
5
|
+
return <Screegen config={config} />;
|
|
70
6
|
}
|
|
71
7
|
|
|
72
8
|
export default App;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
min-height: 100%;
|
|
7
|
+
padding: 60px 40px;
|
|
8
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
9
|
+
color: white;
|
|
10
|
+
font-family: 'Lexend', system-ui, sans-serif;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.header {
|
|
14
|
+
text-align: center;
|
|
15
|
+
margin-bottom: 60px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.title {
|
|
19
|
+
font-size: 120px;
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
margin: 0 0 16px 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.subtitle {
|
|
25
|
+
font-size: 60px;
|
|
26
|
+
font-weight: 300;
|
|
27
|
+
opacity: 0.9;
|
|
28
|
+
margin: 0;
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ScreenComponentProps } from '@screegen/components';
|
|
2
|
+
import styles from './ExampleScreen.module.scss';
|
|
3
|
+
import { t } from '../translations';
|
|
4
|
+
|
|
5
|
+
export function ExampleScreen({ language }: ScreenComponentProps) {
|
|
6
|
+
const title = t(language, 'title');
|
|
7
|
+
const subtitle = t(language, 'subtitle');
|
|
8
|
+
return (
|
|
9
|
+
<div className={styles.container}>
|
|
10
|
+
<div className={styles.header}>
|
|
11
|
+
<h1 className={styles.title}>{title}</h1>
|
|
12
|
+
<p className={styles.subtitle}>{subtitle}</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -7,18 +7,10 @@ export const translations: Record<string, Record<string, string>> = {
|
|
|
7
7
|
"en-US": {
|
|
8
8
|
title: "Your App Name",
|
|
9
9
|
subtitle: "The best app for your needs",
|
|
10
|
-
feature1: "Amazing Feature",
|
|
11
|
-
feature1Desc: "Description of this amazing feature",
|
|
12
|
-
feature2: "Another Feature",
|
|
13
|
-
feature2Desc: "Description of another great feature",
|
|
14
10
|
},
|
|
15
11
|
"de-DE": {
|
|
16
12
|
title: "Deine App",
|
|
17
13
|
subtitle: "Die beste App für deine Bedürfnisse",
|
|
18
|
-
feature1: "Tolle Funktion",
|
|
19
|
-
feature1Desc: "Beschreibung dieser tollen Funktion",
|
|
20
|
-
feature2: "Weitere Funktion",
|
|
21
|
-
feature2Desc: "Beschreibung einer weiteren Funktion",
|
|
22
14
|
},
|
|
23
15
|
};
|
|
24
16
|
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: center;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
min-height: 100%;
|
|
7
|
-
padding: 60px 40px;
|
|
8
|
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
9
|
-
color: white;
|
|
10
|
-
font-family: "Lexend", system-ui, sans-serif;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.header {
|
|
14
|
-
text-align: center;
|
|
15
|
-
margin-bottom: 60px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.title {
|
|
19
|
-
font-size: 64px;
|
|
20
|
-
font-weight: 400;
|
|
21
|
-
margin: 0 0 16px 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.subtitle {
|
|
25
|
-
font-size: 28px;
|
|
26
|
-
font-weight: 300;
|
|
27
|
-
opacity: 0.9;
|
|
28
|
-
margin: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.features {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-direction: column;
|
|
34
|
-
gap: 32px;
|
|
35
|
-
width: 100%;
|
|
36
|
-
max-width: 800px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.feature {
|
|
40
|
-
background: rgba(255, 255, 255, 0.15);
|
|
41
|
-
border-radius: 16px;
|
|
42
|
-
padding: 32px;
|
|
43
|
-
backdrop-filter: blur(10px);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.featureTitle {
|
|
47
|
-
font-size: 24px;
|
|
48
|
-
font-weight: 400;
|
|
49
|
-
margin: 0 0 8px 0;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.featureDescription {
|
|
53
|
-
font-size: 18px;
|
|
54
|
-
font-weight: 300;
|
|
55
|
-
opacity: 0.9;
|
|
56
|
-
margin: 0;
|
|
57
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ScreenComponentProps } from "@screegen/components";
|
|
2
|
-
import styles from "./FeaturesScreen.module.scss";
|
|
3
|
-
|
|
4
|
-
interface Feature {
|
|
5
|
-
title: string;
|
|
6
|
-
description: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface FeaturesScreenProps extends ScreenComponentProps {
|
|
10
|
-
title: string;
|
|
11
|
-
subtitle: string;
|
|
12
|
-
features: Feature[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function FeaturesScreen({
|
|
16
|
-
title,
|
|
17
|
-
subtitle,
|
|
18
|
-
features,
|
|
19
|
-
}: FeaturesScreenProps) {
|
|
20
|
-
return (
|
|
21
|
-
<div className={styles.container}>
|
|
22
|
-
<div className={styles.header}>
|
|
23
|
-
<h1 className={styles.title}>{title}</h1>
|
|
24
|
-
<p className={styles.subtitle}>{subtitle}</p>
|
|
25
|
-
</div>
|
|
26
|
-
<div className={styles.features}>
|
|
27
|
-
{features.map((feature, index) => (
|
|
28
|
-
<div key={index} className={styles.feature}>
|
|
29
|
-
<h3 className={styles.featureTitle}>{feature.title}</h3>
|
|
30
|
-
<p className={styles.featureDescription}>{feature.description}</p>
|
|
31
|
-
</div>
|
|
32
|
-
))}
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
}
|