@cbnventures/nova 0.35.0 → 0.36.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/bin/nova.mjs +17 -0
- package/build/package.json +3 -2
- package/build/scaffold-versions.json +16 -6
- package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts +2 -2
- package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint-validate.js +116 -3
- package/build/src/cli/generate/github/workflows-blueprint-validate.js.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint.d.ts +11 -5
- package/build/src/cli/generate/github/workflows-blueprint.d.ts.map +1 -1
- package/build/src/cli/generate/github/workflows-blueprint.js +411 -35
- package/build/src/cli/generate/github/workflows-blueprint.js.map +1 -1
- package/build/src/cli/generate/must-haves/agent-conventions.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/agent-conventions.js +3 -0
- package/build/src/cli/generate/must-haves/agent-conventions.js.map +1 -1
- package/build/src/cli/generate/must-haves/dotenv.d.ts.map +1 -1
- package/build/src/cli/generate/must-haves/dotenv.js +1 -0
- package/build/src/cli/generate/must-haves/dotenv.js.map +1 -1
- package/build/src/cli/scaffold/app/vite.js +1 -1
- package/build/src/cli/scaffold/app/vite.js.map +1 -1
- package/build/src/cli/utility/changelog.d.ts.map +1 -1
- package/build/src/cli/utility/changelog.js +119 -67
- package/build/src/cli/utility/changelog.js.map +1 -1
- package/build/src/cli/utility/configure.d.ts.map +1 -1
- package/build/src/cli/utility/configure.js +126 -1
- package/build/src/cli/utility/configure.js.map +1 -1
- package/build/src/lib/corepack.d.ts +2 -2
- package/build/src/lib/corepack.d.ts.map +1 -1
- package/build/src/lib/corepack.js +16 -6
- package/build/src/lib/corepack.js.map +1 -1
- package/build/src/lib/docker-packaging.d.ts.map +1 -1
- package/build/src/lib/docker-packaging.js +5 -4
- package/build/src/lib/docker-packaging.js.map +1 -1
- package/build/src/lib/dotenv.d.ts.map +1 -1
- package/build/src/lib/dotenv.js +17 -8
- package/build/src/lib/dotenv.js.map +1 -1
- package/build/src/lib/env-managed-set.d.ts.map +1 -1
- package/build/src/lib/env-managed-set.js +55 -11
- package/build/src/lib/env-managed-set.js.map +1 -1
- package/build/src/lib/env-namespace.d.ts.map +1 -1
- package/build/src/lib/env-namespace.js +1 -0
- package/build/src/lib/env-namespace.js.map +1 -1
- package/build/src/lib/env-profiles.d.ts +3 -0
- package/build/src/lib/env-profiles.d.ts.map +1 -0
- package/build/src/lib/env-profiles.js +70 -0
- package/build/src/lib/env-profiles.js.map +1 -0
- package/build/src/lib/env-status.d.ts.map +1 -1
- package/build/src/lib/env-status.js +23 -2
- package/build/src/lib/env-status.js.map +1 -1
- package/build/src/lib/item.d.ts.map +1 -1
- package/build/src/lib/item.js +20 -3
- package/build/src/lib/item.js.map +1 -1
- package/build/src/lib/nova-config.d.ts.map +1 -1
- package/build/src/lib/nova-config.js +31 -0
- package/build/src/lib/nova-config.js.map +1 -1
- package/build/src/lib/regex.d.ts +7 -0
- package/build/src/lib/regex.d.ts.map +1 -1
- package/build/src/lib/regex.js +7 -0
- package/build/src/lib/regex.js.map +1 -1
- package/build/src/lib/run-scripts.d.ts.map +1 -1
- package/build/src/lib/run-scripts.js +24 -0
- package/build/src/lib/run-scripts.js.map +1 -1
- package/build/src/lib/scaffold.d.ts.map +1 -1
- package/build/src/lib/scaffold.js +7 -0
- package/build/src/lib/scaffold.js.map +1 -1
- package/build/src/lib/workflow-templates.js +4 -4
- package/build/src/lib/workflow-templates.js.map +1 -1
- package/build/src/types/cli/generate/github/workflows-blueprint-validate.d.ts +42 -4
- package/build/src/types/cli/generate/github/workflows-blueprint.d.ts +193 -17
- package/build/src/types/cli/utility/changelog.d.ts +49 -6
- package/build/src/types/cli/utility/configure.d.ts +52 -0
- package/build/src/types/lib/corepack.d.ts +13 -0
- package/build/src/types/lib/docker-packaging.d.ts +1 -0
- package/build/src/types/lib/dotenv.d.ts +10 -3
- package/build/src/types/lib/env-managed-set.d.ts +15 -0
- package/build/src/types/lib/env-namespace.d.ts +5 -0
- package/build/src/types/lib/env-profiles.d.ts +67 -0
- package/build/src/types/lib/env-status.d.ts +9 -0
- package/build/src/types/lib/item.d.ts +20 -3
- package/build/src/types/lib/nova-config.d.ts +14 -0
- package/build/src/types/lib/run-scripts.d.ts +16 -0
- package/build/src/types/lib/scaffold.d.ts +8 -0
- package/build/src/types/shared.d.ts +47 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-publish-parity.test.d.ts +20 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint-validate.test.d.ts +22 -0
- package/build/src/types/tests/cli/generate/github/workflows-blueprint.test.d.ts +16 -0
- package/build/src/types/tests/cli/generate/must-haves/agent-conventions.test.d.ts +40 -0
- package/build/src/types/tests/cli/utility/changelog.test.d.ts +48 -45
- package/build/src/types/tests/cli/utility/configure.test.d.ts +1 -0
- package/build/src/types/tests/cli/utility/run-scripts.test.d.ts +29 -0
- package/build/src/types/tests/lib/env-profiles.test.d.ts +20 -0
- package/build/templates/generators/must-haves/agent-conventions/AGENTS.md +8 -5
- package/build/templates/generators/must-haves/agent-conventions/CLAUDE.md +8 -5
- package/build/templates/generators/must-haves/agent-conventions/conventions/csharp.md +6 -6
- package/build/templates/generators/must-haves/agent-conventions/conventions/go.md +241 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/nova.md +155 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/python.md +7 -7
- package/build/templates/generators/must-haves/agent-conventions/conventions/rust.md +227 -0
- package/build/templates/generators/must-haves/agent-conventions/conventions/swift.md +9 -9
- package/build/templates/generators/must-haves/agent-conventions/conventions/typescript.md +145 -23
- package/build/templates/generators/must-haves/agent-conventions/conventions/universal.md +112 -103
- package/build/templates/generators/must-haves/ignore-files/gitignore +1 -0
- package/build/templates/scaffold/app/android/package.json +1 -1
- package/build/templates/scaffold/app/apple/Sources/App.swift +15 -2
- package/build/templates/scaffold/app/apple/Tests/AppTests.swift +14 -2
- package/build/templates/scaffold/app/apple/package.json +1 -1
- package/build/templates/scaffold/app/astro/package.json +1 -1
- package/build/templates/scaffold/app/discord-bot/package.json +1 -1
- package/build/templates/scaffold/app/express/package.json +1 -1
- package/build/templates/scaffold/app/nextjs/package.json +1 -1
- package/build/templates/scaffold/app/vite/package.json +2 -2
- package/build/templates/scaffold/app/vite/vite.config.mts +3 -0
- package/build/templates/scaffold/docs/docusaurus/package.json +2 -2
- package/build/templates/scaffold/docs/docusaurus/vitest.config.mts +9 -0
- package/build/templates/scaffold/package/github-action/package.json +1 -1
- package/build/templates/scaffold/package/homebridge/package.json +1 -1
- package/build/templates/scaffold/package/pfsense/package.json +1 -1
- package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__].inc +10 -0
- package/build/templates/scaffold/package/pfsense-root/.github/workflows/pfsense-[__WORKSPACE_NAME__].yml +62 -0
- package/build/templates/scaffold-options/app/android-native/.gitattributes +2 -0
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/MainActivity.kt +16 -2
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/NavigationKeys.kt +7 -1
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/data/DataRepository.kt +28 -4
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/theme/Color.kt +40 -6
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/theme/Theme.kt +22 -1
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/theme/Type.kt +8 -2
- package/build/templates/scaffold-options/app/android-native/app/src/main/java/[__ANDROID_PACKAGE_PATH__]/ui/main/MainScreenViewModel.kt +42 -6
- package/build/templates/scaffold-options/app/android-native/app/src/test/java/[__ANDROID_PACKAGE_PATH__]/ui/main/MainScreenViewModelTest.kt +31 -4
- package/build/templates/scaffold-options/app/astro/cloudflare/public/.assetsignore +15 -0
- package/build/templates/scaffold-options/docker-image/common/dockerignore +2 -0
- package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/package.json +1 -1
- package/build/templates/scaffold-options/tool/serverless/vercel-functions/package.json +1 -1
- package/package.json +3 -2
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import SwiftUI
|
|
2
2
|
|
|
3
|
+
///
|
|
4
|
+
/// [__WORKSPACE_TITLE__] Application.
|
|
5
|
+
///
|
|
6
|
+
/// Creates the shared SwiftUI scene for the generated iOS and macOS
|
|
7
|
+
/// application.
|
|
8
|
+
///
|
|
9
|
+
/// - Since: UNRELEASED
|
|
10
|
+
///
|
|
3
11
|
@main
|
|
4
|
-
struct [__WORKSPACE_IDENTIFIER__]App: App {
|
|
5
|
-
|
|
12
|
+
internal struct [__WORKSPACE_IDENTIFIER__]App: App {
|
|
13
|
+
///
|
|
14
|
+
/// [__WORKSPACE_TITLE__] Application - Body.
|
|
15
|
+
///
|
|
16
|
+
/// - Since: UNRELEASED
|
|
17
|
+
///
|
|
18
|
+
internal var body: some Scene {
|
|
6
19
|
#if os(macOS)
|
|
7
20
|
WindowGroup {
|
|
8
21
|
ContentView()
|
|
@@ -2,9 +2,21 @@ import Testing
|
|
|
2
2
|
|
|
3
3
|
@testable import [__WORKSPACE_IDENTIFIER__]
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
///
|
|
6
|
+
/// [__WORKSPACE_TITLE__] Tests.
|
|
7
|
+
///
|
|
8
|
+
/// - Since: UNRELEASED
|
|
9
|
+
///
|
|
10
|
+
internal struct [__WORKSPACE_IDENTIFIER__]Tests {
|
|
11
|
+
///
|
|
12
|
+
/// [__WORKSPACE_TITLE__] Tests - Application Loads.
|
|
13
|
+
///
|
|
14
|
+
/// Confirms the generated test target can load the application module.
|
|
15
|
+
///
|
|
16
|
+
/// - Since: UNRELEASED
|
|
17
|
+
///
|
|
6
18
|
@Test
|
|
7
|
-
func applicationLoads() {
|
|
19
|
+
internal func applicationLoads() {
|
|
8
20
|
#expect(true)
|
|
9
21
|
}
|
|
10
22
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"node": "[__SCAFFOLD_VERSION_NODE_ENGINE__]"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@cbnventures/nova": "0.
|
|
27
|
+
"@cbnventures/nova": "0.36.0",
|
|
28
28
|
"next": "[__SCAFFOLD_VERSION_NEXT__]",
|
|
29
29
|
"react": "[__SCAFFOLD_VERSION_REACT__]",
|
|
30
30
|
"react-dom": "[__SCAFFOLD_VERSION_REACT_DOM__]"
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"build:types": "nova utility type-check --project tsconfig.json",
|
|
17
17
|
"build:app": "vite build",
|
|
18
18
|
"clean": "nova utility run-scripts --parallel \"clean:*\"",
|
|
19
|
-
"clean:build": "shx rm -rf ./
|
|
19
|
+
"clean:build": "shx rm -rf ./build"
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": "[__SCAFFOLD_VERSION_NODE_ENGINE__]"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@cbnventures/nova": "0.
|
|
25
|
+
"@cbnventures/nova": "0.36.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "[__SCAFFOLD_VERSION_TYPES_NODE_22__]",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"node": "[__SCAFFOLD_VERSION_NODE_ENGINE__]"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cbnventures/docusaurus-preset-nova": "0.
|
|
31
|
-
"@cbnventures/nova": "0.
|
|
30
|
+
"@cbnventures/docusaurus-preset-nova": "0.36.0",
|
|
31
|
+
"@cbnventures/nova": "0.36.0",
|
|
32
32
|
"@docusaurus/core": "[__SCAFFOLD_VERSION_DOCUSAURUS__]",
|
|
33
33
|
"react": "[__SCAFFOLD_VERSION_REACT__]",
|
|
34
34
|
"react-dom": "[__SCAFFOLD_VERSION_REACT_DOM__]"
|
|
@@ -9,6 +9,15 @@ import { defineConfig } from 'vitest/config';
|
|
|
9
9
|
* @since 0.20.0
|
|
10
10
|
*/
|
|
11
11
|
const currentFilePath = fileURLToPath(import.meta.url);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Vitest Configuration - Root directory.
|
|
15
|
+
*
|
|
16
|
+
* Stores this module-level value in one named location.
|
|
17
|
+
* Related code reuses it instead of duplicating the definition.
|
|
18
|
+
*
|
|
19
|
+
* @since UNRELEASED
|
|
20
|
+
*/
|
|
12
21
|
const rootDirectory = dirname(currentFilePath);
|
|
13
22
|
|
|
14
23
|
export default defineConfig({
|
package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__].inc
CHANGED
|
@@ -10,6 +10,8 @@ require_once('services.inc');
|
|
|
10
10
|
* Returns the saved package settings.
|
|
11
11
|
*
|
|
12
12
|
* @return array<string, mixed> Package settings.
|
|
13
|
+
*
|
|
14
|
+
* @since UNRELEASED
|
|
13
15
|
*/
|
|
14
16
|
function pfsensePackage[__WORKSPACE_IDENTIFIER__]GetSettings(): array
|
|
15
17
|
{
|
|
@@ -24,6 +26,8 @@ function pfsensePackage[__WORKSPACE_IDENTIFIER__]GetSettings(): array
|
|
|
24
26
|
* @param string $frequency Selected frequency.
|
|
25
27
|
*
|
|
26
28
|
* @return array{string, string, string, string, string} Cron fields.
|
|
29
|
+
*
|
|
30
|
+
* @since UNRELEASED
|
|
27
31
|
*/
|
|
28
32
|
function pfsensePackage[__WORKSPACE_IDENTIFIER__]GetCronFields(string $frequency): array
|
|
29
33
|
{
|
|
@@ -37,6 +41,8 @@ function pfsensePackage[__WORKSPACE_IDENTIFIER__]GetCronFields(string $frequency
|
|
|
37
41
|
|
|
38
42
|
/**
|
|
39
43
|
* Synchronizes the package cron job with the saved WebGUI settings.
|
|
44
|
+
*
|
|
45
|
+
* @since UNRELEASED
|
|
40
46
|
*/
|
|
41
47
|
function pfsensePackage[__WORKSPACE_IDENTIFIER__]Sync(): void
|
|
42
48
|
{
|
|
@@ -63,6 +69,8 @@ function pfsensePackage[__WORKSPACE_IDENTIFIER__]Sync(): void
|
|
|
63
69
|
|
|
64
70
|
/**
|
|
65
71
|
* Removes the package cron job.
|
|
72
|
+
*
|
|
73
|
+
* @since UNRELEASED
|
|
66
74
|
*/
|
|
67
75
|
function pfsensePackage[__WORKSPACE_IDENTIFIER__]Remove(): void
|
|
68
76
|
{
|
|
@@ -74,6 +82,8 @@ function pfsensePackage[__WORKSPACE_IDENTIFIER__]Remove(): void
|
|
|
74
82
|
*
|
|
75
83
|
* @param array<string, mixed> $post Submitted values.
|
|
76
84
|
* @param string[] $inputErrors Validation errors.
|
|
85
|
+
*
|
|
86
|
+
* @since UNRELEASED
|
|
77
87
|
*/
|
|
78
88
|
function pfsensePackage[__WORKSPACE_IDENTIFIER__]Validate(array $post, array &$inputErrors): void
|
|
79
89
|
{
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: "Publish [__WORKSPACE_TITLE__] pfSense Package"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types:
|
|
6
|
+
- "published"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
tag:
|
|
10
|
+
description: "Existing GitHub release tag that receives the package"
|
|
11
|
+
required: true
|
|
12
|
+
type: "string"
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: "write"
|
|
16
|
+
|
|
17
|
+
concurrency:
|
|
18
|
+
group: "${{ github.workflow }}-${{ github.event.release.tag_name || inputs.tag }}"
|
|
19
|
+
cancel-in-progress: false
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
package:
|
|
23
|
+
name: "Build pfSense Package"
|
|
24
|
+
runs-on: "ubuntu-latest"
|
|
25
|
+
env:
|
|
26
|
+
RELEASE_TAG: "${{ github.event.release.tag_name || inputs.tag }}"
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: "Checkout"
|
|
30
|
+
uses: "actions/checkout@v7"
|
|
31
|
+
|
|
32
|
+
- name: "Validate and Stage Port"
|
|
33
|
+
run: |
|
|
34
|
+
node "./[__WORKSPACE_RELATIVE_PATH__]/scripts/check-package.mjs"
|
|
35
|
+
node "./[__WORKSPACE_RELATIVE_PATH__]/scripts/stage-package.mjs"
|
|
36
|
+
|
|
37
|
+
- name: "Build on FreeBSD"
|
|
38
|
+
uses: "vmactions/freebsd-vm@v1"
|
|
39
|
+
with:
|
|
40
|
+
release: "${{ vars.PFSENSE_FREEBSD_VERSION || '15' }}"
|
|
41
|
+
copyback: true
|
|
42
|
+
prepare: |
|
|
43
|
+
pkg install -y ca_root_nss git
|
|
44
|
+
run: |
|
|
45
|
+
git clone --depth 1 --single-branch --branch devel --filter=blob:none --sparse https://github.com/pfsense/FreeBSD-ports.git /usr/ports
|
|
46
|
+
git -C /usr/ports sparse-checkout set Mk Templates Keywords
|
|
47
|
+
PFSENSE_PORTS_DIR=/usr/ports sh "./[__WORKSPACE_RELATIVE_PATH__]/scripts/build-package.sh"
|
|
48
|
+
|
|
49
|
+
- name: "Upload Workflow Artifact"
|
|
50
|
+
uses: "actions/upload-artifact@v7"
|
|
51
|
+
with:
|
|
52
|
+
name: "pfsense-[__WORKSPACE_NAME__]"
|
|
53
|
+
path: "./[__WORKSPACE_RELATIVE_PATH__]/build/release/*"
|
|
54
|
+
if-no-files-found: "error"
|
|
55
|
+
retention-days: 7
|
|
56
|
+
include-hidden-files: true
|
|
57
|
+
|
|
58
|
+
- name: "Upload GitHub Release Assets"
|
|
59
|
+
env:
|
|
60
|
+
GH_TOKEN: "${{ github.token }}"
|
|
61
|
+
run: |
|
|
62
|
+
gh release upload "${RELEASE_TAG}" "./[__WORKSPACE_RELATIVE_PATH__]/build/release/"* --clobber
|
|
@@ -10,8 +10,22 @@ import androidx.compose.material3.Surface
|
|
|
10
10
|
import androidx.compose.ui.Modifier
|
|
11
11
|
import [__ANDROID_APPLICATION_ID__].theme.[__WORKSPACE_IDENTIFIER__]Theme
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Main Activity.
|
|
15
|
+
*
|
|
16
|
+
* Hosts the generated Compose application.
|
|
17
|
+
*
|
|
18
|
+
* @since UNRELEASED
|
|
19
|
+
*/
|
|
20
|
+
public class MainActivity : ComponentActivity() {
|
|
21
|
+
/**
|
|
22
|
+
* Main Activity - On Create.
|
|
23
|
+
*
|
|
24
|
+
* @param savedInstanceState - Saved instance state.
|
|
25
|
+
*
|
|
26
|
+
* @since UNRELEASED
|
|
27
|
+
*/
|
|
28
|
+
public override fun onCreate(savedInstanceState: Bundle?) {
|
|
15
29
|
super.onCreate(savedInstanceState)
|
|
16
30
|
|
|
17
31
|
enableEdgeToEdge()
|
|
@@ -3,4 +3,10 @@ package [__ANDROID_APPLICATION_ID__]
|
|
|
3
3
|
import androidx.navigation3.runtime.NavKey
|
|
4
4
|
import kotlinx.serialization.Serializable
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Main Navigation Key.
|
|
8
|
+
*
|
|
9
|
+
* @since UNRELEASED
|
|
10
|
+
*/
|
|
11
|
+
@Serializable
|
|
12
|
+
public data object Main : NavKey
|
|
@@ -3,10 +3,34 @@ package [__ANDROID_APPLICATION_ID__].data
|
|
|
3
3
|
import kotlinx.coroutines.flow.Flow
|
|
4
4
|
import kotlinx.coroutines.flow.flow
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Data Repository.
|
|
8
|
+
*
|
|
9
|
+
* Defines the starter data source consumed by the generated launch screen.
|
|
10
|
+
*
|
|
11
|
+
* @since UNRELEASED
|
|
12
|
+
*/
|
|
13
|
+
public interface DataRepository {
|
|
14
|
+
/**
|
|
15
|
+
* Data Repository - Data.
|
|
16
|
+
*
|
|
17
|
+
* @since UNRELEASED
|
|
18
|
+
*/
|
|
19
|
+
public val data: Flow<List<String>>
|
|
8
20
|
}
|
|
9
21
|
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Default Data Repository.
|
|
24
|
+
*
|
|
25
|
+
* Supplies starter data until the generated project adopts a real data source.
|
|
26
|
+
*
|
|
27
|
+
* @since UNRELEASED
|
|
28
|
+
*/
|
|
29
|
+
public class DefaultDataRepository : DataRepository {
|
|
30
|
+
/**
|
|
31
|
+
* Default Data Repository - Data.
|
|
32
|
+
*
|
|
33
|
+
* @since UNRELEASED
|
|
34
|
+
*/
|
|
35
|
+
public override val data: Flow<List<String>> = flow { emit(listOf("Android")) }
|
|
12
36
|
}
|
|
@@ -2,10 +2,44 @@ package [__ANDROID_APPLICATION_ID__].theme
|
|
|
2
2
|
|
|
3
3
|
import androidx.compose.ui.graphics.Color
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Purple 80.
|
|
7
|
+
*
|
|
8
|
+
* @since UNRELEASED
|
|
9
|
+
*/
|
|
10
|
+
public val Purple80: Color = Color(0xFFD0BCFF)
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Purple Grey 80.
|
|
14
|
+
*
|
|
15
|
+
* @since UNRELEASED
|
|
16
|
+
*/
|
|
17
|
+
public val PurpleGrey80: Color = Color(0xFFCCC2DC)
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Pink 80.
|
|
21
|
+
*
|
|
22
|
+
* @since UNRELEASED
|
|
23
|
+
*/
|
|
24
|
+
public val Pink80: Color = Color(0xFFEFB8C8)
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Purple 40.
|
|
28
|
+
*
|
|
29
|
+
* @since UNRELEASED
|
|
30
|
+
*/
|
|
31
|
+
public val Purple40: Color = Color(0xFF6650a4)
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Purple Grey 40.
|
|
35
|
+
*
|
|
36
|
+
* @since UNRELEASED
|
|
37
|
+
*/
|
|
38
|
+
public val PurpleGrey40: Color = Color(0xFF625b71)
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Pink 40.
|
|
42
|
+
*
|
|
43
|
+
* @since UNRELEASED
|
|
44
|
+
*/
|
|
45
|
+
public val Pink40: Color = Color(0xFF7D5260)
|
|
@@ -10,8 +10,20 @@ import androidx.compose.material3.lightColorScheme
|
|
|
10
10
|
import androidx.compose.runtime.Composable
|
|
11
11
|
import androidx.compose.ui.platform.LocalContext
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Dark Color Scheme.
|
|
15
|
+
*
|
|
16
|
+
* @private
|
|
17
|
+
* @since UNRELEASED
|
|
18
|
+
*/
|
|
13
19
|
private val DarkColorScheme = darkColorScheme(primary = Purple80, secondary = PurpleGrey80, tertiary = Pink80)
|
|
14
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Light Color Scheme.
|
|
23
|
+
*
|
|
24
|
+
* @private
|
|
25
|
+
* @since UNRELEASED
|
|
26
|
+
*/
|
|
15
27
|
private val LightColorScheme =
|
|
16
28
|
lightColorScheme(
|
|
17
29
|
primary = Purple40,
|
|
@@ -29,8 +41,17 @@ private val LightColorScheme =
|
|
|
29
41
|
*/
|
|
30
42
|
)
|
|
31
43
|
|
|
44
|
+
/**
|
|
45
|
+
* [__WORKSPACE_TITLE__] Theme.
|
|
46
|
+
*
|
|
47
|
+
* @param darkTheme - Dark theme.
|
|
48
|
+
* @param dynamicColor - Dynamic color.
|
|
49
|
+
* @param content - Content.
|
|
50
|
+
*
|
|
51
|
+
* @since UNRELEASED
|
|
52
|
+
*/
|
|
32
53
|
@Composable
|
|
33
|
-
fun [__WORKSPACE_IDENTIFIER__]Theme(
|
|
54
|
+
public fun [__WORKSPACE_IDENTIFIER__]Theme(
|
|
34
55
|
darkTheme: Boolean = isSystemInDarkTheme(),
|
|
35
56
|
// Dynamic color is available on Android 12+
|
|
36
57
|
dynamicColor: Boolean = true,
|
|
@@ -6,8 +6,14 @@ import androidx.compose.ui.text.font.FontFamily
|
|
|
6
6
|
import androidx.compose.ui.text.font.FontWeight
|
|
7
7
|
import androidx.compose.ui.unit.sp
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Typography.
|
|
11
|
+
*
|
|
12
|
+
* Provides the starter Material typography used by the generated application.
|
|
13
|
+
*
|
|
14
|
+
* @since UNRELEASED
|
|
15
|
+
*/
|
|
16
|
+
public val Typography: Typography =
|
|
11
17
|
Typography(
|
|
12
18
|
bodyLarge =
|
|
13
19
|
TextStyle(
|
|
@@ -10,18 +10,54 @@ import kotlinx.coroutines.flow.catch
|
|
|
10
10
|
import kotlinx.coroutines.flow.map
|
|
11
11
|
import kotlinx.coroutines.flow.stateIn
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Main Screen View Model.
|
|
15
|
+
*
|
|
16
|
+
* @param dataRepository - Data repository.
|
|
17
|
+
*
|
|
18
|
+
* @since UNRELEASED
|
|
19
|
+
*/
|
|
20
|
+
public class MainScreenViewModel(dataRepository: DataRepository) : ViewModel() {
|
|
21
|
+
/**
|
|
22
|
+
* Main Screen View Model - UI State.
|
|
23
|
+
*
|
|
24
|
+
* @since UNRELEASED
|
|
25
|
+
*/
|
|
26
|
+
public val uiState: StateFlow<MainScreenUiState> =
|
|
15
27
|
dataRepository.data
|
|
16
28
|
.map<List<String>, MainScreenUiState>(::Success)
|
|
17
29
|
.catch { emit(MainScreenUiState.Error(it)) }
|
|
18
30
|
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), MainScreenUiState.Loading)
|
|
19
31
|
}
|
|
20
32
|
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Main Screen UI State.
|
|
35
|
+
*
|
|
36
|
+
* @since UNRELEASED
|
|
37
|
+
*/
|
|
38
|
+
public sealed interface MainScreenUiState {
|
|
39
|
+
/**
|
|
40
|
+
* Main Screen UI State - Loading.
|
|
41
|
+
*
|
|
42
|
+
* @since UNRELEASED
|
|
43
|
+
*/
|
|
44
|
+
public object Loading : MainScreenUiState
|
|
23
45
|
|
|
24
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Main Screen UI State - Error.
|
|
48
|
+
*
|
|
49
|
+
* @param throwable - Throwable.
|
|
50
|
+
*
|
|
51
|
+
* @since UNRELEASED
|
|
52
|
+
*/
|
|
53
|
+
public data class Error(public val throwable: Throwable) : MainScreenUiState
|
|
25
54
|
|
|
26
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Main Screen UI State - Success.
|
|
57
|
+
*
|
|
58
|
+
* @param data - Data.
|
|
59
|
+
*
|
|
60
|
+
* @since UNRELEASED
|
|
61
|
+
*/
|
|
62
|
+
public data class Success(public val data: List<String>) : MainScreenUiState
|
|
27
63
|
}
|
|
@@ -8,20 +8,47 @@ import kotlinx.coroutines.flow.flow
|
|
|
8
8
|
import kotlinx.coroutines.test.runTest
|
|
9
9
|
import org.junit.Test
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Main Screen View Model Test.
|
|
13
|
+
*
|
|
14
|
+
* @since UNRELEASED
|
|
15
|
+
*/
|
|
16
|
+
public class MainScreenViewModelTest {
|
|
17
|
+
/**
|
|
18
|
+
* Main Screen View Model Test - UI State Initially Loading.
|
|
19
|
+
*
|
|
20
|
+
* @since UNRELEASED
|
|
21
|
+
*/
|
|
12
22
|
@Test
|
|
13
|
-
fun uiState_initiallyLoading() = runTest {
|
|
23
|
+
public fun uiState_initiallyLoading() = runTest {
|
|
14
24
|
val viewModel = MainScreenViewModel(FakeMyModelRepository())
|
|
15
25
|
assertEquals(viewModel.uiState.first(), MainScreenUiState.Loading)
|
|
16
26
|
}
|
|
17
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Main Screen View Model Test - Saved Item Displayed.
|
|
30
|
+
*
|
|
31
|
+
* @since UNRELEASED
|
|
32
|
+
*/
|
|
18
33
|
@Test
|
|
19
|
-
fun uiState_onItemSaved_isDisplayed() = runTest {
|
|
34
|
+
public fun uiState_onItemSaved_isDisplayed() = runTest {
|
|
20
35
|
val viewModel = MainScreenViewModel(FakeMyModelRepository())
|
|
21
36
|
assertEquals(viewModel.uiState.first(), MainScreenUiState.Loading)
|
|
22
37
|
}
|
|
23
38
|
}
|
|
24
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Fake Model Repository.
|
|
42
|
+
*
|
|
43
|
+
* @private
|
|
44
|
+
* @since UNRELEASED
|
|
45
|
+
*/
|
|
25
46
|
private class FakeMyModelRepository : DataRepository {
|
|
26
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Fake Model Repository - Data.
|
|
49
|
+
*
|
|
50
|
+
* @private
|
|
51
|
+
* @since UNRELEASED
|
|
52
|
+
*/
|
|
53
|
+
public override val data: Flow<List<String>> = flow { emit(listOf("Sample")) }
|
|
27
54
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file is generated by @cbnventures/nova.
|
|
2
|
+
# Do not edit manually.
|
|
3
|
+
#
|
|
4
|
+
# Run `nova generate must-haves ignore-files` to regenerate.
|
|
5
|
+
# See: https://nova.cbnventures.io/docs/cli/generators/must-haves/ignore-files
|
|
6
|
+
|
|
7
|
+
########################################
|
|
8
|
+
#### Web Hosting - Cloudflare Astro ####
|
|
9
|
+
########################################
|
|
10
|
+
_worker.js
|
|
11
|
+
_routes.json
|
|
12
|
+
|
|
13
|
+
##########################
|
|
14
|
+
#### Project Excludes ####
|
|
15
|
+
##########################
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"node": "[__SCAFFOLD_VERSION_NODE_ENGINE__]"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@cbnventures/nova": "0.
|
|
52
|
+
"@cbnventures/nova": "0.36.0",
|
|
53
53
|
"chalk": "[__SCAFFOLD_VERSION_CHALK__]",
|
|
54
54
|
"commander": "[__SCAFFOLD_VERSION_COMMANDER__]",
|
|
55
55
|
"wrangler": "[__SCAFFOLD_VERSION_WRANGLER__]"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"node": "[__SCAFFOLD_VERSION_NODE_ENGINE__]"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@cbnventures/nova": "0.
|
|
52
|
+
"@cbnventures/nova": "0.36.0",
|
|
53
53
|
"chalk": "[__SCAFFOLD_VERSION_CHALK__]",
|
|
54
54
|
"commander": "[__SCAFFOLD_VERSION_COMMANDER__]",
|
|
55
55
|
"vercel": "[__SCAFFOLD_VERSION_VERCEL__]"
|