Icon and Localization Manifest issues 15.0-rc1
# package-development
k
I'm office this week, so starting strong with some 6am upgrades 😞 just looking at migrating client code to 15-rc1 and when moving all the manifests to
UmbExtensionManifest
i am hitting a problem with custom icons and localization manifests. Specifically.
Copy code
ts
const icons: UmbExtensionManifest = {
    type: 'icons',
    alias: 'usync.icons',
    name: 'uSync Icons',
    js: () => import('./icons.js'),
};
now complains on build
Copy code
src/icons/manifest.ts:5:2 - error TS2353: Object literal may only specify known properties, and 'js' does not exist in type 'ManifestBase'.

5  js: () => import('./icons.js'),
and for localization its similar but for the meta value.
Copy code
ts
const localizations: Array<UmbExtensionManifest> = [
    {
        type: 'localization',
        alias: 'usync.lang.enus',
        name: 'English',
        weight: 0,
        meta: {
            culture: 'en',
        },
        js: () => import('./files/en-us'),
}];
complains about meta
Copy code
src/lang/manifest.ts:7:3 - error TS2353: Object literal may only specify known properties, and 'meta' does not exist in type 'ManifestBase'.

7   meta: {
    ~~~~
any clues.
all th other manifests i have moved over (about 10 files) are fine.
j
There are breaking changes around where to import types from
Icons, for instance, have a new package: https://github.com/umbraco/Umbraco.CMS.Backoffice/pull/2361
But there is a trick to it: We want to make it possible to add all global types from the backoffice package in one go. From RC2, which should release this week, you should be able to set the "types" property in tsconfig to the npm package, and in doing so, you can avoid any future breaking types changes for the manifest types: https://github.com/umbraco/Umbraco.CMS.Backoffice/pull/2442
I believe even for RC1, you can get most of the types automatically by including the extension registry:
Copy code
json
"compilerOptions": {
  "types": ["@umbraco-cms/backoffice/extension-registry"]
}
but if you need more types, you can add them to the array:
Copy code
json
"compilerOptions": {
  "types": [
"@umbraco-cms/backoffice/extension-registry",
"@umbraco-cms/backoffice/icon",
"@umbraco-cms/backoffice/localization"
]
}
k
👍 - the second one (with all three in) worked. (rc1) - will wait for rc2 and check then too 🙂
n
I may mention for RC-2, this should do the job:
Copy code
json
"compilerOptions": {
  "types": ["@umbraco-cms/backoffice/extension-types"]
}
9 Views