geeknative 0.1.0 → 0.1.1
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 +13 -2
- package/src/codegen/app.js +9 -1
- package/src/commands/check.js +6 -1
- package/src/commands/create.js +4 -0
package/package.json
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geeknative",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "One prompt, three native apps: your coding agent builds SwiftUI, Jetpack Compose and TanStack Start apps from one shared spec.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"homepage": "https://geekyants.github.io/geeknative/",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/GeekyAnts/geeknative.git",
|
|
10
|
+
"directory": "packages/geeknative"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/GeekyAnts/geeknative/issues"
|
|
14
|
+
},
|
|
15
|
+
"author": "GeekyAnts (https://geekyants.com)",
|
|
6
16
|
"keywords": [
|
|
7
17
|
"agents",
|
|
8
18
|
"AGENTS.md",
|
|
@@ -28,6 +38,7 @@
|
|
|
28
38
|
},
|
|
29
39
|
"scripts": {
|
|
30
40
|
"prepack": "node scripts/prepack.js",
|
|
31
|
-
"postpack": "node scripts/prepack.js --clean"
|
|
41
|
+
"postpack": "node scripts/prepack.js --clean",
|
|
42
|
+
"test": "node --test 'test/**/*.test.js'"
|
|
32
43
|
}
|
|
33
44
|
}
|
package/src/codegen/app.js
CHANGED
|
@@ -11,7 +11,15 @@ import { banner, kotlinString, OUT, swiftString } from './util.js'
|
|
|
11
11
|
|
|
12
12
|
/** @param {string} root @returns {AppIdentity} */
|
|
13
13
|
export function readApp(root) {
|
|
14
|
-
|
|
14
|
+
return validateApp(readJson(path.join(root, 'contracts', 'app.json'), 'contracts/app.json'))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Checks an app identity and fills in defaults. Throws a CliError describing the first problem.
|
|
19
|
+
* @param {any} app
|
|
20
|
+
* @returns {AppIdentity}
|
|
21
|
+
*/
|
|
22
|
+
export function validateApp(app) {
|
|
15
23
|
const where = 'contracts/app.json'
|
|
16
24
|
if (typeof app.name !== 'string' || !app.name.trim() || /[\n$]|\/\//.test(app.name)) {
|
|
17
25
|
throw new CliError(`${where} "name" must be a non-empty display name without "$", "//" or line breaks.`)
|
package/src/commands/check.js
CHANGED
|
@@ -15,7 +15,8 @@ export const PLATFORMS = ['ios', 'android', 'web']
|
|
|
15
15
|
* @param {string[]} targets "all", "contracts", or platform names
|
|
16
16
|
*/
|
|
17
17
|
export async function check(root, targets) {
|
|
18
|
-
const
|
|
18
|
+
const everything = !targets.length || targets.includes('all')
|
|
19
|
+
const wanted = everything ? PLATFORMS : targets
|
|
19
20
|
for (const target of wanted) {
|
|
20
21
|
if (target !== 'contracts' && !PLATFORMS.includes(target)) {
|
|
21
22
|
throw new CliError(`Unknown check "${target}". Use: all, contracts, ${PLATFORMS.join(', ')}.`)
|
|
@@ -31,6 +32,10 @@ export async function check(root, targets) {
|
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
for (const platform of wanted.filter((t) => t !== 'contracts')) {
|
|
35
|
+
if (everything && platform === 'ios' && process.platform !== 'darwin') {
|
|
36
|
+
log.warn('ios', 'skipped: iOS builds need macOS with Xcode')
|
|
37
|
+
continue
|
|
38
|
+
}
|
|
34
39
|
const started = Date.now()
|
|
35
40
|
const result = await CHECKS[platform](root)
|
|
36
41
|
const seconds = `${Math.round((Date.now() - started) / 1000)}s`
|
package/src/commands/create.js
CHANGED
|
@@ -7,6 +7,7 @@ import { CliError, color, log } from '../lib/log.js'
|
|
|
7
7
|
import { writeLock } from '../lib/managed.js'
|
|
8
8
|
import { isLocalCheckout, PACKAGE_DIR, packageVersion, templateDir } from '../lib/project.js'
|
|
9
9
|
import { findAndroidSdk, writeLocalProperties } from '../lib/toolchains.js'
|
|
10
|
+
import { validateApp } from '../codegen/app.js'
|
|
10
11
|
import { gen } from './gen.js'
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -24,6 +25,9 @@ export async function create(dir, { name, id, install = true, git = true }) {
|
|
|
24
25
|
const appId = id ?? `com.example.${slug.replace(/-/g, '')}`
|
|
25
26
|
const version = packageVersion()
|
|
26
27
|
|
|
28
|
+
// Fail before writing anything if the name or ID can't work on every platform.
|
|
29
|
+
validateApp({ name: appName, id: appId, version: '1.0.0', build: 1 })
|
|
30
|
+
|
|
27
31
|
log.step('create', `${appName} (${appId}) in ${dir}`)
|
|
28
32
|
copyTemplate(templateDir(), root)
|
|
29
33
|
|