create-turniza-app 1.0.2 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-turniza-app",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "CLI scaffold for creating new Turniza monorepo apps (Flutter + Astro + Cloudflare Workers)",
5
5
  "type": "module",
6
6
  "bin": {
package/src/scaffold.ts CHANGED
@@ -38,7 +38,28 @@ export async function scaffoldProject(options: ProjectOptions): Promise<void> {
38
38
  console.log(chalk.cyan('📱 Setting up Flutter mobile app...'));
39
39
  const mobileTarget = join(targetDir, 'apps', 'mobile');
40
40
  await mkdir(mobileTarget, { recursive: true });
41
- await processTemplateDir(join(TEMPLATES_DIR, 'mobile'), mobileTarget, context);
41
+ await processTemplateDir(join(TEMPLATES_DIR, 'mobile'), mobileTarget, context, [
42
+ '_kotlin',
43
+ ]);
44
+
45
+ // Place Kotlin MainActivity at the correct package path
46
+ const orgLower = options.org.toLowerCase();
47
+ const kotlinPackageDir = join(
48
+ mobileTarget,
49
+ 'android',
50
+ 'app',
51
+ 'src',
52
+ 'main',
53
+ 'kotlin',
54
+ 'com',
55
+ orgLower,
56
+ options.projectNameSnake,
57
+ );
58
+ await processTemplateDir(
59
+ join(TEMPLATES_DIR, 'mobile', '_kotlin'),
60
+ kotlinPackageDir,
61
+ context,
62
+ );
42
63
  }
43
64
 
44
65
  // ── 3. Copy web templates ────────────────────────────────
@@ -94,10 +115,16 @@ async function processTemplateDir(
94
115
  sourceDir: string,
95
116
  targetDir: string,
96
117
  context: Record<string, unknown>,
118
+ skipDirs: string[] = [],
97
119
  ): Promise<void> {
98
120
  const entries = await readdir(sourceDir, { withFileTypes: true });
99
121
 
100
122
  for (const entry of entries) {
123
+ // Skip directories in the skip list
124
+ if (entry.isDirectory() && skipDirs.includes(entry.name)) {
125
+ continue;
126
+ }
127
+
101
128
  const sourcePath = join(sourceDir, entry.name);
102
129
 
103
130
  // Skip symlinks – they can't be copied reliably (e.g. iOS .symlinks)
@@ -0,0 +1,5 @@
1
+ package com.{{org}}.{{projectNameSnake}}
2
+
3
+ import io.flutter.embedding.android.FlutterActivity
4
+
5
+ class MainActivity : FlutterActivity()
@@ -0,0 +1,44 @@
1
+ plugins {
2
+ id("com.android.application")
3
+ id("kotlin-android")
4
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5
+ id("dev.flutter.flutter-gradle-plugin")
6
+ }
7
+
8
+ android {
9
+ namespace = "com.{{org}}.{{projectNameSnake}}"
10
+ compileSdk = flutter.compileSdkVersion
11
+ ndkVersion = flutter.ndkVersion
12
+
13
+ compileOptions {
14
+ sourceCompatibility = JavaVersion.VERSION_17
15
+ targetCompatibility = JavaVersion.VERSION_17
16
+ }
17
+
18
+ kotlinOptions {
19
+ jvmTarget = JavaVersion.VERSION_17.toString()
20
+ }
21
+
22
+ defaultConfig {
23
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24
+ applicationId = "com.{{org}}.{{projectNameSnake}}"
25
+ // You can update the following values to match your application needs.
26
+ // For more information, see: https://flutter.dev/to/review-gradle-config.
27
+ minSdk = flutter.minSdkVersion
28
+ targetSdk = flutter.targetSdkVersion
29
+ versionCode = flutter.versionCode
30
+ versionName = flutter.versionName
31
+ }
32
+
33
+ buildTypes {
34
+ release {
35
+ // TODO: Add your own signing config for the release build.
36
+ // Signing with the debug keys for now, so `flutter run --release` works.
37
+ signingConfig = signingConfigs.getByName("debug")
38
+ }
39
+ }
40
+ }
41
+
42
+ flutter {
43
+ source = "../.."
44
+ }
@@ -1,35 +1,23 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
- <application
3
- android:label="holidays"
4
- android:name="${applicationName}"
2
+ <application android:label="{{projectNameSnake}}" android:name="${applicationName}"
5
3
  android:icon="@mipmap/ic_launcher">
6
- <activity
7
- android:name=".MainActivity"
8
- android:exported="true"
9
- android:launchMode="singleTop"
10
- android:taskAffinity=""
11
- android:theme="@style/LaunchTheme"
4
+ <activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop"
5
+ android:taskAffinity="" android:theme="@style/LaunchTheme"
12
6
  android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
13
- android:hardwareAccelerated="true"
14
- android:windowSoftInputMode="adjustResize">
7
+ android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
15
8
  <!-- Specifies an Android theme to apply to this Activity as soon as
16
9
  the Android process has started. This theme is visible to the user
17
10
  while the Flutter UI initializes. After that, this theme continues
18
11
  to determine the Window background behind the Flutter UI. -->
19
- <meta-data
20
- android:name="io.flutter.embedding.android.NormalTheme"
21
- android:resource="@style/NormalTheme"
22
- />
12
+ <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
23
13
  <intent-filter>
24
- <action android:name="android.intent.action.MAIN"/>
25
- <category android:name="android.intent.category.LAUNCHER"/>
14
+ <action android:name="android.intent.action.MAIN" />
15
+ <category android:name="android.intent.category.LAUNCHER" />
26
16
  </intent-filter>
27
17
  </activity>
28
18
  <!-- Don't delete the meta-data below.
29
19
  This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
30
- <meta-data
31
- android:name="flutterEmbedding"
32
- android:value="2" />
20
+ <meta-data android:name="flutterEmbedding" android:value="2" />
33
21
  </application>
34
22
  <!-- Required to query activities that can process text, see:
35
23
  https://developer.android.com/training/package-visibility and
@@ -38,8 +26,8 @@
38
26
  In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39
27
  <queries>
40
28
  <intent>
41
- <action android:name="android.intent.action.PROCESS_TEXT"/>
42
- <data android:mimeType="text/plain"/>
29
+ <action android:name="android.intent.action.PROCESS_TEXT" />
30
+ <data android:mimeType="text/plain" />
43
31
  </intent>
44
32
  </queries>
45
- </manifest>
33
+ </manifest>
@@ -0,0 +1,16 @@
1
+ import 'package:flutter_test/flutter_test.dart';
2
+ import 'package:{{projectNameSnake}}/main.dart';
3
+ import 'package:integration_test/integration_test.dart';
4
+
5
+ void main() {
6
+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();
7
+
8
+ group('App Integration Tests', () {
9
+ testWidgets('app should launch successfully', (final tester) async {
10
+ await tester.pumpWidget(const MyApp());
11
+ await tester.pumpAndSettle();
12
+
13
+ expect(find.byType(MyApp), findsOneWidget);
14
+ });
15
+ });
16
+ }
@@ -0,0 +1,49 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>$(DEVELOPMENT_LANGUAGE)</string>
7
+ <key>CFBundleDisplayName</key>
8
+ <string>{{projectTitle}}</string>
9
+ <key>CFBundleExecutable</key>
10
+ <string>$(EXECUTABLE_NAME)</string>
11
+ <key>CFBundleIdentifier</key>
12
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
13
+ <key>CFBundleInfoDictionaryVersion</key>
14
+ <string>6.0</string>
15
+ <key>CFBundleName</key>
16
+ <string>{{projectNameSnake}}</string>
17
+ <key>CFBundlePackageType</key>
18
+ <string>APPL</string>
19
+ <key>CFBundleShortVersionString</key>
20
+ <string>$(FLUTTER_BUILD_NAME)</string>
21
+ <key>CFBundleSignature</key>
22
+ <string>????</string>
23
+ <key>CFBundleVersion</key>
24
+ <string>$(FLUTTER_BUILD_NUMBER)</string>
25
+ <key>LSRequiresIPhoneOS</key>
26
+ <true />
27
+ <key>UILaunchStoryboardName</key>
28
+ <string>LaunchScreen</string>
29
+ <key>UIMainStoryboardFile</key>
30
+ <string>Main</string>
31
+ <key>UISupportedInterfaceOrientations</key>
32
+ <array>
33
+ <string>UIInterfaceOrientationPortrait</string>
34
+ <string>UIInterfaceOrientationLandscapeLeft</string>
35
+ <string>UIInterfaceOrientationLandscapeRight</string>
36
+ </array>
37
+ <key>UISupportedInterfaceOrientations~ipad</key>
38
+ <array>
39
+ <string>UIInterfaceOrientationPortrait</string>
40
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
41
+ <string>UIInterfaceOrientationLandscapeLeft</string>
42
+ <string>UIInterfaceOrientationLandscapeRight</string>
43
+ </array>
44
+ <key>CADisableMinimumFrameDurationOnPhone</key>
45
+ <true />
46
+ <key>UIApplicationSupportsIndirectInputEvents</key>
47
+ <true />
48
+ </dict>
49
+ </plist>