@nimiplatform/app-tools 0.1.1 → 0.1.2

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/README.md CHANGED
@@ -10,8 +10,9 @@ pnpm dlx @nimiplatform/app-tools nimi-app update --dir path/to/app
10
10
 
11
11
  `nimi-app create` emits a publishable Tauri app-authoring scaffold. The
12
12
  generated project is designed to install its own dependencies with
13
- `pnpm install`, run local checks, produce a pre-submission package artifact,
14
- and remain directly usable without hand-editing scaffold-managed glue.
13
+ `pnpm install`, run with `pnpm dev:shell`, run local checks, produce a
14
+ developer-submitted Nimi listing packet, and remain directly usable without
15
+ hand-editing scaffold-managed glue.
15
16
 
16
17
  `nimi-app doctor` verifies scaffold lock state, managed glue, package-owned
17
18
  projections, dependency alignment, and forbidden shortcut patterns in a source
@@ -210,6 +210,8 @@ function buildForbiddenPatterns() {
210
210
  ['stale Runtime shell API', new RegExp(runtimeBridgeName)],
211
211
  ['retired template flag', new RegExp(retiredFlag.replace('-', '\\-'))],
212
212
  ['retired template builder', new RegExp(retiredBuilders)],
213
+ ['retired kit package name', /@nimiplatform\/nimi-kit/],
214
+ ['retired developer tools package name', /@nimiplatform\/dev-tools/],
213
215
  ['retired profile switch branch', new RegExp(`case\\s+['"](?:${retiredProfiles.join('|')})['"]`)],
214
216
  ['retired submitted profile', new RegExp(`(?:profile|template):\\s*(?:${retiredProfiles.join('|')})\\b`)],
215
217
  ['retired vercel profile remnant', new RegExp(retiredProfiles[1])],
@@ -272,6 +274,20 @@ function assertSemanticMarkers(targetDir) {
272
274
  throw new Error('Submitted manifest contains admission or grant wording');
273
275
  }
274
276
 
277
+ const submission = readFileSync(path.join(targetDir, '.nimi/admission/submission.yaml'), 'utf8');
278
+ for (const marker of [
279
+ 'submission_role: developer-submitted-input',
280
+ 'dev_shell_command: pnpm dev:shell',
281
+ 'admission_truth: platform-owned-after-review',
282
+ ]) {
283
+ if (!submission.includes(marker)) {
284
+ throw new Error(`Admission submission marker missing: ${marker}`);
285
+ }
286
+ }
287
+ if (/admitted|descriptor_role:\s*release|grant(ed)?_permissions/i.test(submission)) {
288
+ throw new Error('Admission submission contains admission or grant wording');
289
+ }
290
+
275
291
  const buildProfile = readFileSync(path.join(targetDir, '.nimi/config/build-profile.yaml'), 'utf8');
276
292
  for (const marker of [
277
293
  'build_profile_ref:',
@@ -125,15 +125,21 @@ function resolveProfile(options) {
125
125
  function buildPackageJson(profile, versions, identity) {
126
126
  const packageJson = {
127
127
  name: identity.packageName,
128
- private: true,
128
+ private: false,
129
129
  type: 'module',
130
+ publishConfig: {
131
+ access: 'public',
132
+ },
130
133
  scripts: {
131
- dev: 'vite',
134
+ dev: 'pnpm run dev:renderer',
135
+ 'dev:renderer': 'vite --host 127.0.0.1 --port 1420 --strictPort',
136
+ 'dev:shell': 'tauri dev',
132
137
  typecheck: 'tsc --noEmit',
133
138
  build: 'tsc --noEmit && vite build',
139
+ 'build:shell': 'tauri build',
134
140
  test: 'node --test test/*.test.mjs',
135
141
  check: 'pnpm run doctor && pnpm run test && pnpm run validate',
136
- pack: 'node scripts/pack.mjs',
142
+ pack: 'pnpm run build && node scripts/pack.mjs',
137
143
  validate: 'node scripts/validate.mjs',
138
144
  'local-audit': 'node scripts/local-audit.mjs',
139
145
  doctor: 'nimi-app doctor',
@@ -148,6 +154,7 @@ function buildPackageJson(profile, versions, identity) {
148
154
  },
149
155
  devDependencies: {
150
156
  '@nimiplatform/app-tools': profile === 'workspace-app' ? 'workspace:*' : versions.appToolsVersion,
157
+ '@tauri-apps/cli': versions.tauriCliVersion,
151
158
  '@types/node': versions.nodeTypesVersion,
152
159
  '@types/react': versions.reactTypesVersion,
153
160
  '@types/react-dom': versions.reactDomTypesVersion,
@@ -480,6 +487,31 @@ function buildCommonFiles(identity, versions) {
480
487
  '',
481
488
  ].join('\n'),
482
489
  },
490
+ {
491
+ path: '.nimi/admission/submission.yaml',
492
+ content: [
493
+ `app_id: ${identity.appId}`,
494
+ `display_name: ${identity.appTitle}`,
495
+ `profile: ${identity.profile}`,
496
+ `npm_package_name: ${identity.packageName}`,
497
+ `cargo_package_name: ${identity.cargoPackageName}`,
498
+ `tauri_identifier: ${identity.tauriIdentifier}`,
499
+ ...(identity.author ? [`package_author: ${identity.author}`] : []),
500
+ 'submission_role: developer-submitted-input',
501
+ 'publish_readiness:',
502
+ ' install_command: pnpm install',
503
+ ' dev_shell_command: pnpm dev:shell',
504
+ ' build_command: pnpm run build',
505
+ ' pack_command: pnpm run pack',
506
+ 'review_inputs:',
507
+ ' manifest: nimi.app.yaml',
508
+ ' build_profile: .nimi/config/build-profile.yaml',
509
+ ' scaffold_boundary: .nimi/contracts/scaffold-boundary.yaml',
510
+ ' local_audit: pnpm run local-audit',
511
+ 'admission_truth: platform-owned-after-review',
512
+ '',
513
+ ].join('\n'),
514
+ },
483
515
  {
484
516
  path: '.nimi/config/app-identity.yaml',
485
517
  content: [
@@ -526,10 +558,12 @@ function buildCommonFiles(identity, versions) {
526
558
  ' - .nimi/config/**',
527
559
  ' - .nimi/contracts/**',
528
560
  ' - .nimi/methodology/**',
561
+ ' - .nimi/admission/**',
529
562
  ' scaffold_managed_glue:',
530
563
  ' - .github/**',
531
564
  ' - .gitignore',
532
565
  ' - package.json',
566
+ ' - ADMISSION.md',
533
567
  ' - README.md',
534
568
  ' - SECURITY.md',
535
569
  ' - nimi.app.yaml',
@@ -547,7 +581,8 @@ function buildCommonFiles(identity, versions) {
547
581
  '# AGENTS.md',
548
582
  '- Treat `.nimi/**` as host-local scaffold truth for this generated app.',
549
583
  '- Keep auth, Runtime, permission, manifest, and Tauri shell glue in scaffold-managed files.',
550
- '- Product behavior belongs under `src/shell/routes/product-area.tsx` unless a later scaffold update expands the app-owned area.',
584
+ '- The app-owned area is `src/shell/routes/product-area.tsx` unless a later scaffold update expands it.',
585
+ '- `.nimi/admission/**` and `ADMISSION.md` are developer-submitted review inputs, not platform admission truth.',
551
586
  '- Local checks are pre-submission self-checks only.',
552
587
  '',
553
588
  ].join('\n'),
@@ -577,7 +612,7 @@ function buildCommonFiles(identity, versions) {
577
612
  '',
578
613
  '```bash',
579
614
  'pnpm install',
580
- 'pnpm run dev',
615
+ 'pnpm dev:shell',
581
616
  'pnpm run validate',
582
617
  'pnpm run local-audit',
583
618
  'pnpm run pack',
@@ -587,10 +622,41 @@ function buildCommonFiles(identity, versions) {
587
622
  '',
588
623
  '`doctor` and `update` are developer scaffold checks for this source repository. They do not update an installed app, publish admission truth, create release descriptors, or grant permissions.',
589
624
  '',
625
+ 'For Nimi listing review, keep `nimi.app.yaml`, `.nimi/admission/submission.yaml`, `.nimi/config/build-profile.yaml`, and `ADMISSION.md` in sync with the product behavior under `src/shell/routes/product-area.tsx`.',
626
+ '',
590
627
  'Upstream Platform/Runtime review produces release descriptors, ordinary visibility, install truth, and scope authorization. This scaffold does not mint those outcomes.',
591
628
  '',
592
629
  ].join('\n'),
593
630
  },
631
+ {
632
+ path: 'ADMISSION.md',
633
+ content: [
634
+ `# ${identity.appTitle} Nimi Listing Request`,
635
+ '',
636
+ 'This document is a developer-submitted listing request. It is not an approval, release descriptor, permission grant, or install truth.',
637
+ '',
638
+ '## Developer Runbook',
639
+ '',
640
+ '```bash',
641
+ 'pnpm install',
642
+ 'pnpm dev:shell',
643
+ 'pnpm run check',
644
+ 'pnpm run pack',
645
+ '```',
646
+ '',
647
+ '## Submission Inputs',
648
+ '',
649
+ '- `nimi.app.yaml` declares app identity and requested API scopes.',
650
+ '- `.nimi/admission/submission.yaml` records publish-readiness commands and review inputs.',
651
+ '- `.nimi/config/build-profile.yaml` records install, build, and lockfile policy.',
652
+ '- `dist/nimi-app-submission.json` is produced by `pnpm run pack` after a successful renderer build.',
653
+ '',
654
+ '## Reviewer Boundary',
655
+ '',
656
+ 'Nimi Platform review owns final admission, release descriptors, ordinary-user visibility, install availability, and permission grants.',
657
+ '',
658
+ ].join('\n'),
659
+ },
594
660
  {
595
661
  path: 'LICENSE',
596
662
  content: [
@@ -623,9 +689,16 @@ function buildCommonFiles(identity, versions) {
623
689
  "import { readFileSync } from 'node:fs';",
624
690
  '',
625
691
  "const manifest = readFileSync(new URL('../nimi.app.yaml', import.meta.url), 'utf8');",
692
+ "const submission = readFileSync(new URL('../.nimi/admission/submission.yaml', import.meta.url), 'utf8');",
626
693
  "if (!manifest.includes('manifest_role: submitted-input')) {",
627
694
  " throw new Error('submitted manifest role marker missing');",
628
695
  '}',
696
+ "if (!submission.includes('submission_role: developer-submitted-input')) {",
697
+ " throw new Error('developer submission role marker missing');",
698
+ '}',
699
+ "if (!submission.includes('dev_shell_command: pnpm dev:shell')) {",
700
+ " throw new Error('dev shell command marker missing');",
701
+ '}',
629
702
  "console.log('[nimi-app] validate pre-submission self-check passed');",
630
703
  '',
631
704
  ].join('\n'),
@@ -646,12 +719,35 @@ function buildCommonFiles(identity, versions) {
646
719
  {
647
720
  path: 'scripts/pack.mjs',
648
721
  content: [
649
- "import { mkdirSync, writeFileSync } from 'node:fs';",
722
+ "import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';",
650
723
  "import { join } from 'node:path';",
651
724
  '',
725
+ "if (!existsSync(join('dist', 'index.html'))) {",
726
+ " throw new Error('renderer build output missing: run pnpm run build before packing');",
727
+ '}',
728
+ "const packageJson = JSON.parse(readFileSync('package.json', 'utf8'));",
729
+ "const tauriConfig = JSON.parse(readFileSync(join('src-tauri', 'tauri.conf.json'), 'utf8'));",
730
+ "const manifest = readFileSync('nimi.app.yaml', 'utf8');",
731
+ "const submission = readFileSync(join('.nimi', 'admission', 'submission.yaml'), 'utf8');",
732
+ "if (!manifest.includes('manifest_role: submitted-input')) {",
733
+ " throw new Error('submitted manifest role marker missing');",
734
+ '}',
735
+ "if (!submission.includes('submission_role: developer-submitted-input')) {",
736
+ " throw new Error('developer submission role marker missing');",
737
+ '}',
652
738
  "mkdirSync('dist', { recursive: true });",
653
- "writeFileSync(join('dist', 'pre-submission-pack.txt'), 'pre-submission self-check artifact\\n');",
654
- "console.log('[nimi-app] pack pre-submission self-check wrote dist/pre-submission-pack.txt');",
739
+ 'const packet = {',
740
+ " packetRole: 'developer-submitted-input',",
741
+ ' packageName: packageJson.name,',
742
+ ' appVersion: tauriConfig.version,',
743
+ ' tauriIdentifier: tauriConfig.identifier,',
744
+ " rendererEntry: 'dist/index.html',",
745
+ " manifestPath: 'nimi.app.yaml',",
746
+ " admissionRequestPath: '.nimi/admission/submission.yaml',",
747
+ " generatedBy: '@nimiplatform/app-tools',",
748
+ '};',
749
+ "writeFileSync(join('dist', 'nimi-app-submission.json'), `${JSON.stringify(packet, null, 2)}\\n`);",
750
+ "console.log('[nimi-app] pack wrote dist/nimi-app-submission.json');",
655
751
  '',
656
752
  ].join('\n'),
657
753
  },
@@ -664,6 +760,7 @@ function buildCommonFiles(identity, versions) {
664
760
  '',
665
761
  "const authSource = readFileSync(new URL('../src/shell/auth/runtime-platform.ts', import.meta.url), 'utf8');",
666
762
  "const manifest = readFileSync(new URL('../nimi.app.yaml', import.meta.url), 'utf8');",
763
+ "const submission = readFileSync(new URL('../.nimi/admission/submission.yaml', import.meta.url), 'utf8');",
667
764
  '',
668
765
  "test('auth glue uses Nimi App runtime platform helper', () => {",
669
766
  " assert.match(authSource, /createNimiAppRuntimePlatformClient/);",
@@ -675,6 +772,12 @@ function buildCommonFiles(identity, versions) {
675
772
  " assert.match(manifest, /declared_nimi_api_scopes/);",
676
773
  "});",
677
774
  '',
775
+ "test('admission request remains submitted input', () => {",
776
+ " assert.match(submission, /submission_role: developer-submitted-input/);",
777
+ " assert.match(submission, /dev_shell_command: pnpm dev:shell/);",
778
+ " assert.match(submission, /admission_truth: platform-owned-after-review/);",
779
+ "});",
780
+ '',
678
781
  ].join('\n'),
679
782
  },
680
783
  {
@@ -741,7 +844,7 @@ function buildTauriFiles(identity, versions) {
741
844
  version: '0.1.0',
742
845
  identifier: identity.tauriIdentifier,
743
846
  build: {
744
- beforeDevCommand: 'pnpm run dev',
847
+ beforeDevCommand: 'pnpm run dev:renderer',
745
848
  beforeBuildCommand: 'pnpm run build',
746
849
  devUrl: 'http://localhost:1420',
747
850
  frontendDist: '../dist',
@@ -814,6 +917,7 @@ function classifyScaffoldFile(filePath) {
814
917
  filePath.startsWith('.nimi/config/')
815
918
  || filePath.startsWith('.nimi/contracts/')
816
919
  || filePath.startsWith('.nimi/methodology/')
920
+ || filePath.startsWith('.nimi/admission/')
817
921
  || /^apps\/[^/]+\/spec\//.test(filePath)
818
922
  ) {
819
923
  return 'package-owned projection';
@@ -836,6 +940,7 @@ function buildDependencyMatrix(profile, versions) {
836
940
  'react-dom': versions.reactDomVersion,
837
941
  typescript: versions.typescriptVersion,
838
942
  vite: versions.viteVersion,
943
+ '@tauri-apps/cli': versions.tauriCliVersion,
839
944
  '@vitejs/plugin-react': versions.viteReactPluginVersion,
840
945
  },
841
946
  cargo: {
package/lib/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { createAppScaffold } from './app-scaffold.mjs';
4
4
  import { doctorApp, updateApp } from './app-doctor-update.mjs';
5
5
 
6
6
  const SDK_VERSION = '^0.5.15';
7
- const APP_TOOLS_VERSION = '^0.1.1';
7
+ const APP_TOOLS_VERSION = '^0.1.2';
8
8
  const KIT_VERSION = '^0.1.0';
9
9
  const REACT_VERSION = '^19.1.0';
10
10
  const REACT_DOM_VERSION = '^19.1.0';
@@ -16,6 +16,7 @@ const REACT_DOM_TYPES_VERSION = '^19.2.3';
16
16
  const VITE_VERSION = '^7.2.4';
17
17
  const VITE_REACT_PLUGIN_VERSION = '^5.1.1';
18
18
  const TAURI_API_VERSION = '^2.9.1';
19
+ const TAURI_CLI_VERSION = '^2.11.2';
19
20
  const NIMI_SHELL_TAURI_VERSION = '0.1.0';
20
21
  const AI_SDK_VERSION = '^6.0.85';
21
22
 
@@ -61,6 +62,7 @@ function appScaffoldVersions() {
61
62
  viteVersion: VITE_VERSION,
62
63
  viteReactPluginVersion: VITE_REACT_PLUGIN_VERSION,
63
64
  tauriApiVersion: TAURI_API_VERSION,
65
+ tauriCliVersion: TAURI_CLI_VERSION,
64
66
  nimiShellTauriVersion: NIMI_SHELL_TAURI_VERSION,
65
67
  };
66
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimiplatform/app-tools",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "private": false,