client dev tool setup breaks after 2025.06 upgrade

A12 changed import logic for deep imports in ext4 and made it illegal to import from internal. That is a problem for my project in the case of our dev tool helper that replaces GeneratedScriptCodeAccessor values:

the import in this case is `import { GeneratedScriptCodeAccessor } from “@com.mgmtp.a12.kernelcom.mgmtp.a12.kernel/kernel-md-facade/lib/main/js/internal/GeneratedScriptCodeAccessor”;`

I can see the same logic in some a12 projects (uiflows, workbench-gallery).

For now i can supress the error with `// @ts-expect-error` but I wander if there is a way that a12 expects us to setup the dev tools in general. I couldn’t find something in the project template.

Hi @constantin-cool-needle,

The GeneratedScriptCodeAccessor class has always lived under an internal module path, but the project template introduced stricter linting rules in ext4 that now correctly flag imports from internal/ paths. Your dev tools setup can be adapted without relying on that import at all.

Assumed A12: 2025.06-ext4 (from thread context)

1. Workaround: drop the instanceof check and use the key instead

Instead of checking value instanceof GeneratedScriptCodeAccessor in your replacer, you can identify the code accessor by its key. The replacer function receives the property name as key — for code accessor values that key is "generatedCodeAccessor". So you can replace the instanceof check with a simple string comparison on key.

For typing value["script"] you can use the IGeneratedCodeAccessor interface, which is the return type of createScriptAccessor and is part of the public API. That way you keep full type safety without importing any internal class.

Your replacer would look roughly like this:

function replacer(key: string, value: any): any {
  if (key === "generatedCodeAccessor") {
    return {
      script: (value as IGeneratedCodeAccessor)["script"],
      __serializedType__: "GeneratedScriptCodeAccessor",
    };
  }
  return value;
}

The reviver stays the same since it already uses GeneratedCodeAccessorFactory().createScriptAccessor(...) which is public API.

2. Upcoming project template improvement

We created a ticket for the project template to ship a default EnhancerOptions configuration that includes a reviver/replacer pattern for code accessor hydration out of the box. Once that lands, new projects will have this wired up automatically and you won’t need to maintain the custom serialization setup yourself.

3. If you still need a public GeneratedScriptCodeAccessor

If your project has a specific need for GeneratedScriptCodeAccessor to be publicly available (beyond the dev tools use case), feel free to create an A12 request ticket for that. We can evaluate making it part of the public API.

Note: The // @ts-expect-error suppression works as a short-term fix, but switching to the key-based check described above is the cleaner path and avoids relying on internal module structure entirely.

Cheers, Markus

Hi @markus-agile-fog ,

Thank you for your answer. For now the workaround for checking by key works for us.

I am glad to hear that this will be addressed by the Project Template in the future.

Cheers, Constantin