Editor-core - one of the sub-dependencies is not available

Hi,

After upgrading the @atlaskit/ediotr-core package, we are experiencing an issue with dependency installation @atlassiansox/analytics-web-client. This packages (used for testing) is not publicly available. Can we expect a fix for this, or should we look for a workaround? :slightly_smiling_face:

Regards,

2 Likes

Same here

error Couldnโ€™t find package โ€œ@atlassiansox/analytics-web-client@^5.1.0โ€ required by โ€œ@loomhq/record-sdk@^4.4.0โ€ on the โ€œnpmโ€ registry.

I am also stumbling upon this. I know that the editor is not technically made for public consumption but itโ€™s still the closest thing we have to get as close as possible to a native UI.

@dmorrow Do you happen to know a good person on the Atlaskit team to refer this to? Would appreciate a pointer in the right direction :slight_smile:

Fix and our config - maybe useful to some of you

  "dependencies": {
    "@atlaskit/adf-schema": "51.4.0",
    "@atlaskit/editor-common": "110.32.2",
    "@atlaskit/editor-core": "215.13.8",
    "@atlaskit/editor-json-transformer": "8.31.3",
    "@atlaskit/editor-prosemirror": "7.2.0",
    "@atlaskit/media-core": "^37.0.0",
    "@atlaskit/media-state": "^1.8.0",
    "@atlaskit/renderer": "124.15.1",,
    "@atlaskit/smart-card": "43.7.2",
  },


  "resolutions": {
    "@atlaskit/editor-plugin-loom": "7.1.2",
    "prosemirror-view": "1.37.1"
  },


// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
  
    resolve: {
      dedupe: [
        // Atlaskit plugin facade that pulls many editor-plugin-* packages
        '@atlaskit/editor-plugins',

        // Editor foundations (must be singletons across core + plugins)
        '@atlaskit/editor-core',
        '@atlaskit/editor-common',
        '@atlaskit/editor-prosemirror',
        '@atlaskit/custom-steps',
        '@atlaskit/adf-schema',
        '@atlaskit/editor-json-transformer',

        // Every ProseMirror lib must be a singleton or the keyed-plugin error appears
        'prosemirror-model',
        'prosemirror-state',
        'prosemirror-view',
        'prosemirror-transform',
        'prosemirror-commands',
        'prosemirror-keymap',
        'prosemirror-inputrules',
        'prosemirror-history',
        'prosemirror-dropcursor',
        'prosemirror-gapcursor',

        // tiny helper that PM uses and gets duplicated often
        'w3c-keyname',
      ],
   
    optimizeDeps: {
       include: [
        '@atlaskit/editor-core',
        '@atlaskit/editor-plugins',
        '@atlaskit/editor-common',
        '@atlaskit/editor-prosemirror',
        'prosemirror-state',
        'prosemirror-view',
        'prosemirror-model',
     ]

   build: {
      rollupOptions: {
        output: {
          manualChunks: manualChunks,
        },
    },


function manualChunks(id: string): string | undefined {
  // 1) Floating Toolbar
  if (
    id.includes(
      path.posix.join(
        "node_modules",
        "@atlaskit",
        "editor-common",
        "dist/esm",
        "floating-toolbar",
        "DropdownMenuItem.js",
      ),
    ) ||
    id.includes(
      path.posix.join("node_modules", "@atlaskit", "editor-common", "dist/esm", "floating-toolbar", "index.js"),
    ) ||
    id.includes(
      path.posix.join(
        "node_modules",
        "@atlaskit",
        "editor-plugin-floating-toolbar",
        "dist/esm",
        "ui",
        "DropdownMenu.js",
      ),
    )
  ) {
    return "floating-toolbar"
  }

  // 2) Smart-Card & Link-Extractors
  if (
    // the original extractors
    id.includes(
      path.posix.join(
        "node_modules",
        "@atlaskit",
        "link-extractors",
        "dist/esm",
        "common",
        "person",
        "extractPersonAssignedTo.js",
      ),
    ) ||
    id.includes(
      path.posix.join(
        "node_modules",
        "@atlaskit",
        "link-extractors",
        "dist/esm",
        "common",
        "person",
        "extractPersonOwnedBy.js",
      ),
    ) ||
    id.includes(
      path.posix.join("node_modules", "@atlaskit", "link-extractors", "dist/esm", "common", "person", "index.js"),
    ) ||
    id.includes(
      path.posix.join(
        "node_modules",
        "@atlaskit",
        "link-extractors",
        "dist/esm",
        "common",
        "primitives",
        "extractTitle.js",
      ),
    ) ||
    id.includes(
      path.posix.join("node_modules", "@atlaskit", "link-extractors", "dist/esm", "common", "primitives", "index.js"),
    ) ||
    // **any** nested smart-card extractors (under renderer or link-datasource)
    id.includes(path.posix.join("node_modules", "@atlaskit", "smart-card", "dist/esm", "extractors"))
  ) {
    return "smart-card-extractors"
  }
}

Our workaround is to define a mocked analytics-web-client in the project and set the resolutions:

  "resolutions": {
    "prosemirror-model": "1.25.1",
    "@atlassiansox/analytics-web-client": "portal:./mocks/analytics-web-client"
  },

@pch @PeterAppsvio :folded_hands: I really appreciate it, thank you!