@microsoft/power-apps-native-host 0.3.0 → 0.3.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.
Files changed (62) hide show
  1. package/README.md +1 -9
  2. package/compatibility/current.json +31 -3
  3. package/lib/NOTICE.txt +1323 -16
  4. package/lib/commonjs/auth/AuthContext.js +36 -15
  5. package/lib/commonjs/config/babelConfig.js +13 -0
  6. package/lib/commonjs/config/expoConfig.js +71 -0
  7. package/lib/commonjs/config/metroConfig.js +70 -0
  8. package/lib/commonjs/config/metroLogger.js +182 -0
  9. package/lib/commonjs/config/tamaguiConfig.js +98 -0
  10. package/lib/commonjs/connections/resolveConnections.js +3 -2
  11. package/lib/commonjs/connections/useConnectionRefs.js +3 -1
  12. package/lib/commonjs/index.js +1 -0
  13. package/lib/commonjs/offline/useOfflineIntegrationWithStartupGate.js +3 -1
  14. package/lib/commonjs/platform/DataverseDataSources.js +4 -0
  15. package/lib/commonjs/platform/DataverseGlobalDiscoveryApi.js +45 -0
  16. package/lib/commonjs/provider/PowerAppsHostProvider.js +1 -0
  17. package/lib/commonjs/provider/PowerAppsProvider.js +10 -5
  18. package/lib/commonjs/provider/SessionDetailsGesture.js +1 -9
  19. package/lib/module/auth/AuthContext.js +36 -15
  20. package/lib/module/config/babelConfig.js +9 -0
  21. package/lib/module/config/expoConfig.js +67 -0
  22. package/lib/module/config/metroConfig.js +65 -0
  23. package/{scripts/metro-logger.js → lib/module/config/metroLogger.js} +58 -96
  24. package/lib/module/config/tamaguiConfig.js +93 -0
  25. package/lib/module/connections/resolveConnections.js +3 -2
  26. package/lib/module/connections/useConnectionRefs.js +3 -1
  27. package/lib/module/index.js +4 -0
  28. package/lib/module/offline/useOfflineIntegrationWithStartupGate.js +3 -1
  29. package/lib/module/platform/DataverseDataSources.js +3 -0
  30. package/lib/module/platform/DataverseGlobalDiscoveryApi.js +44 -0
  31. package/lib/module/provider/PowerAppsHostProvider.js +2 -1
  32. package/lib/module/provider/PowerAppsProvider.js +10 -5
  33. package/lib/module/provider/SessionDetailsGesture.js +1 -9
  34. package/lib/typescript/commonjs/config/babelConfig.d.ts +12 -0
  35. package/lib/typescript/commonjs/config/expoConfig.d.ts +21 -0
  36. package/lib/typescript/commonjs/config/metroConfig.d.ts +6 -0
  37. package/lib/typescript/commonjs/config/metroLogger.d.ts +21 -0
  38. package/lib/typescript/commonjs/config/tamaguiConfig.d.ts +1792 -0
  39. package/lib/typescript/commonjs/connections/resolveConnections.d.ts +3 -1
  40. package/lib/typescript/commonjs/connections/useConnectionRefs.d.ts +3 -1
  41. package/lib/typescript/commonjs/index.d.ts +2 -1
  42. package/lib/typescript/commonjs/platform/DataverseDataSources.d.ts +1 -0
  43. package/lib/typescript/commonjs/provider/PowerAppsProvider.d.ts +27 -4
  44. package/lib/typescript/module/config/babelConfig.d.ts +12 -0
  45. package/lib/typescript/module/config/expoConfig.d.ts +21 -0
  46. package/lib/typescript/module/config/metroConfig.d.ts +6 -0
  47. package/lib/typescript/module/config/metroLogger.d.ts +21 -0
  48. package/lib/typescript/module/config/tamaguiConfig.d.ts +1792 -0
  49. package/lib/typescript/module/connections/resolveConnections.d.ts +3 -1
  50. package/lib/typescript/module/connections/useConnectionRefs.d.ts +3 -1
  51. package/lib/typescript/module/index.d.ts +2 -1
  52. package/lib/typescript/module/platform/DataverseDataSources.d.ts +1 -0
  53. package/lib/typescript/module/provider/PowerAppsProvider.d.ts +27 -4
  54. package/package.json +47 -13
  55. package/scripts/build-codegen-package.js +283 -0
  56. package/scripts/start-web.mjs +9 -5
  57. package/scripts/upgrade/runtime.js +126 -17
  58. package/scripts/upgrade-authoring.js +274 -179
  59. package/scripts/upgrade.js +10 -16
  60. package/src/config/generated-config.d.ts +4 -0
  61. package/src/config/index.d.ts +3 -0
  62. package/src/config/tsconfig.json +26 -0
@@ -38,21 +38,20 @@ function parseArgs(argv) {
38
38
  'no-install': { type: 'boolean' },
39
39
  project: { type: 'string', default: process.cwd() },
40
40
  'from-tag': { type: 'string' },
41
- 'from-version': { type: 'string' },
42
41
  message: { type: 'string' },
43
42
  id: { type: 'string' },
43
+ 'skip-if-no-changes': { type: 'boolean' },
44
44
  },
45
45
  });
46
- const fromVersion = values['from-version'] === undefined ? undefined : parsePositiveInteger(values['from-version']);
47
46
  return {
48
47
  command: positionals[0] || 'upgrade',
49
- fromTag: values['from-tag'] || process.env.MIGRATION_BASE_TAG || null,
50
- fromVersion,
48
+ fromTag: values['from-tag'] || null,
51
49
  dryRun: Boolean(values['dry-run']),
52
50
  install: !values['no-install'],
53
51
  project: path.resolve(values.project),
54
52
  message: values.message,
55
53
  id: values.id,
54
+ skipIfNoChanges: Boolean(values['skip-if-no-changes']),
56
55
  help,
57
56
  };
58
57
  }
@@ -60,25 +59,20 @@ function parseArgs(argv) {
60
59
  function printHelp() {
61
60
  console.log(`Usage: upgrade-template [command] [options]
62
61
 
63
- Commands: upgrade, change, check, build
62
+ Commands: upgrade, build
64
63
 
65
64
  Options:
66
65
  --dry-run Show changes without writing or installing
67
66
  --no-install Write changes without installation or state advancement
68
67
  --project PATH Project path (defaults to current directory)
69
- --from-tag TAG Version tag for change/check
70
- --from-version N Source template version for legacy apps
71
- --message TEXT Changelog description
68
+ --from-tag TAG Release version tag for build
69
+ --message TEXT Migration description
72
70
  --id ID Migration ID
71
+ --skip-if-no-changes
72
+ Exit successfully when build finds no template changes
73
73
  -h, --help Show this help`);
74
74
  }
75
75
 
76
- function parsePositiveInteger(value) {
77
- const parsed = Number(value);
78
- if (!Number.isInteger(parsed) || parsed < 1) throw new Error('--from-version must be a positive integer');
79
- return parsed;
80
- }
81
-
82
76
  function findProjectRoot(startPath) {
83
77
  let current = path.resolve(startPath);
84
78
  if (fs.existsSync(current) && fs.statSync(current).isFile()) current = path.dirname(current);
@@ -119,7 +113,7 @@ async function main(argv = process.argv.slice(2)) {
119
113
  return;
120
114
  }
121
115
 
122
- if (!['upgrade', 'change', 'check', 'build'].includes(options.command)) {
116
+ if (!['upgrade', 'build'].includes(options.command)) {
123
117
  throw new Error(`Unknown command: ${options.command}`);
124
118
  }
125
119
  if (options.command !== 'upgrade') {
@@ -137,7 +131,7 @@ async function main(argv = process.argv.slice(2)) {
137
131
  recoverInterruptedUpgrade(projectRoot);
138
132
  const profile = readJson(PROFILE_PATH);
139
133
  const hostVersion = readJson(path.join(__dirname, '..', 'package.json')).version;
140
- const fullPlan = buildUpgradePlan(projectRoot, profile, hostVersion, options.fromVersion, MIGRATIONS_PATH, options.install || options.dryRun);
134
+ const fullPlan = buildUpgradePlan(projectRoot, profile, hostVersion, MIGRATIONS_PATH, options.install || options.dryRun);
141
135
  const { operations, conflicts, migration, targetProfile, hasMore } = fullPlan;
142
136
  printPlan(projectRoot, profile, operations, conflicts, options.dryRun);
143
137
 
@@ -0,0 +1,4 @@
1
+ declare module '*/auth.config.json' {
2
+ const value: import('@microsoft/power-apps-native-auth').AuthConfig;
3
+ export default value;
4
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference path="./generated-config.d.ts" />
2
+
3
+ export * from '../../lib/typescript/commonjs/index';
@@ -0,0 +1,26 @@
1
+ {
2
+ "extends": "expo/tsconfig.base",
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "moduleResolution": "bundler",
6
+ "baseUrl": "${configDir}",
7
+ "paths": {
8
+ "react-native": ["node_modules/react-native"],
9
+ "expo-auth-session": ["node_modules/expo-auth-session"],
10
+ "expo-secure-store": ["node_modules/expo-secure-store"],
11
+ "expo-web-browser": ["node_modules/expo-web-browser"],
12
+ "@/components": ["src/components"],
13
+ "@/components/*": ["src/components/*"],
14
+ "@/hooks": ["src/hooks"],
15
+ "@/hooks/*": ["src/hooks/*"],
16
+ "@/utils": ["src/utils"],
17
+ "@/utils/*": ["src/utils/*"],
18
+ "@/tokens": ["src/tokens"],
19
+ "@/tokens/*": ["src/tokens/*"],
20
+ "@/generated": ["src/generated"],
21
+ "@/generated/*": ["src/generated/*"],
22
+ "@/native": ["src/native"],
23
+ "@/native/*": ["src/native/*"]
24
+ }
25
+ }
26
+ }