@astrale-os/sdk 0.6.0-beta.0 → 0.6.0-beta.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.
@@ -1,6 +1,10 @@
1
1
  import { type ViewHostRequirements } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
2
2
  export type { ViewHostRequirements } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
3
3
  export type FrontendHandshake = 'shell' | 'none';
4
+ /**
5
+ * @deprecated Every trusted View receives the Shell's shared browser profile: requirements within
6
+ * it are redundant, and Astrale hosts refuse any beyond it. Declare none.
7
+ */
4
8
  export interface IframeRequirements {
5
9
  readonly sandbox?: readonly string[];
6
10
  readonly allow?: readonly string[];
@@ -9,6 +13,10 @@ export type FrontendRouteInput = string | {
9
13
  readonly path?: string;
10
14
  readonly document?: string;
11
15
  readonly handshake?: FrontendHandshake;
16
+ /**
17
+ * @deprecated Every trusted View receives the Shell's shared browser profile: requirements
18
+ * within it are redundant, and Astrale hosts refuse any beyond it. Remove this field.
19
+ */
12
20
  readonly iframe?: IframeRequirements;
13
21
  readonly host?: ViewHostRequirements;
14
22
  };
@@ -0,0 +1,9 @@
1
+ import type { FrontendCompilation } from '../../deployment/build/frontend/index.js';
2
+ /**
3
+ * What a build still declares that the SDK has deprecated, one line each for its author. A View's
4
+ * iframe requirements change nothing it receives: every trusted View gets the Shell's shared browser
5
+ * profile, and Astrale hosts refuse requirements beyond it.
6
+ */
7
+ export declare function deprecationWarnings(build: {
8
+ readonly frontend?: FrontendCompilation;
9
+ }): readonly string[];
@@ -0,0 +1,15 @@
1
+ /**
2
+ * What a build still declares that the SDK has deprecated, one line each for its author. A View's
3
+ * iframe requirements change nothing it receives: every trusted View gets the Shell's shared browser
4
+ * profile, and Astrale hosts refuse requirements beyond it.
5
+ */
6
+ export function deprecationWarnings(build) {
7
+ return (build.frontend?.routes ?? []).flatMap(({ view, iframe }) => {
8
+ if (iframe === undefined)
9
+ return [];
10
+ const declared = [...(iframe.sandbox ?? []), ...(iframe.allow ?? [])].join(', ');
11
+ return [
12
+ `View ${view} declares iframe requirements (${declared}), which are deprecated: every trusted View receives the Shell's shared browser profile, and Astrale hosts refuse requirements beyond it. Remove its \`iframe\` field.`,
13
+ ];
14
+ });
15
+ }
@@ -3,8 +3,9 @@ import { join } from 'node:path';
3
3
  import { resolveAstraleInstanceIssuer } from '../astrale/instance.js';
4
4
  import { resolveCompatibleAstrale } from '../astrale/version.js';
5
5
  import { loadPrivateCredentialFile } from '../credential.js';
6
+ import { deprecationWarnings } from '../deprecations.js';
6
7
  import { loadPrivateSecretsFile } from '../dotenv.js';
7
- import { error, info } from '../log.js';
8
+ import { error, info, warn } from '../log.js';
8
9
  import { DevelopmentCandidateBuilder, discoverRuntimePath, sameDeploymentCandidate, sameEnvironment, } from './candidate.js';
9
10
  import { deployDevelopmentCandidate } from './deployment.js';
10
11
  import { DevelopmentLifecycle } from './lifecycle.js';
@@ -59,6 +60,8 @@ export async function develop(input) {
59
60
  throw new TypeError('--session-file requires an Environment installation that is active for this development session.');
60
61
  }
61
62
  info(`Domain: ${current.artifact.build.schema.compiled.root.origin}`);
63
+ for (const warning of deprecationWarnings(current.artifact.build))
64
+ warn(warning);
62
65
  if (current.installation !== undefined && !input.deployOnly) {
63
66
  installationExecutable = await resolveCompatibleAstrale({
64
67
  projectDir: input.projectDir,
@@ -5,11 +5,12 @@ import { packageDomain } from '../packaging/index.js';
5
5
  import { parseArgs } from './arguments.js';
6
6
  import { resolveCompatibleAstrale } from './astrale/version.js';
7
7
  import { BunRequiredError } from './bun.js';
8
+ import { deprecationWarnings } from './deprecations.js';
8
9
  import { develop } from './development/develop.js';
9
10
  import { loadDeclaredSecrets } from './dotenv.js';
10
11
  import { reconcileEnvironmentRelease } from './environment-release.js';
11
12
  import { ERROR_USAGE, helpRequest, helpText } from './help.js';
12
- import { error, info } from './log.js';
13
+ import { error, info, warn } from './log.js';
13
14
  import { importModule, loadProject, runtimeEntrypoint, selectEnvironment } from './project.js';
14
15
  import { executeTests } from './test.js';
15
16
  const CONFIG_NAMES = ['astrale.config.ts', 'astrale.config.js', 'astrale.config.mjs'];
@@ -67,6 +68,8 @@ export async function run(argv) {
67
68
  });
68
69
  }
69
70
  const build = compile(project.application);
71
+ for (const warning of deprecationWarnings(build))
72
+ warn(warning);
70
73
  const resolved = await resolveRuntime(runtimeEntrypoint(project), (path) => importModule(resolve(dirname(configPath), path)));
71
74
  admitRuntime({ runtime: build.runtime }, resolved);
72
75
  if (parsed.command === 'build') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/sdk",
3
- "version": "0.6.0-beta.0",
3
+ "version": "0.6.0-beta.1",
4
4
  "description": "Schema-first SDK for defining, composing, and deploying Astrale domains",
5
5
  "keywords": [
6
6
  "astrale",