append api to lib name
This commit is contained in:
@@ -40,7 +40,7 @@ Create an umbraco-package.json file in the root of your package.
|
||||
Then create a dashboard.js file the same folder.
|
||||
|
||||
```javascript
|
||||
import { UmbElementMixin } from '@umbraco-cms/backoffice/element';
|
||||
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
|
||||
import { UMB_NOTIFICATION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/notification';
|
||||
|
||||
const template = document.createElement('template');
|
||||
@@ -106,12 +106,11 @@ Then go to the element located in `src/my-element.ts` and replace it with the fo
|
||||
// src/my-element.ts
|
||||
import { LitElement, html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { UmbElementMixin } from '@umbraco-cms/backoffice/element';
|
||||
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
|
||||
import { UmbNotificationContext, UMB_NOTIFICATION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/notification';
|
||||
|
||||
@customElement('my-element')
|
||||
export default class MyElement extends UmbElementMixin(LitElement) {
|
||||
|
||||
private _notificationContext?: UmbNotificationContext;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { LitElement } from 'lit';
|
||||
import { UmbElementMixin } from '@umbraco-cms/backoffice/element';
|
||||
import { UmbElementMixin } from 'libs/element-api';
|
||||
|
||||
export class UmbLitElement extends UmbElementMixin(LitElement) {
|
||||
|
||||
}
|
||||
export class UmbLitElement extends UmbElementMixin(LitElement) {}
|
||||
|
||||
@@ -63,7 +63,7 @@ The Tree Item Manifest
|
||||
```typescript
|
||||
import { css, html, nothing } from 'lit';
|
||||
import { customElement, property } from 'lit/decorators.js';
|
||||
import { UmbElementMixin } from '@umbraco-cms/backoffice/element';
|
||||
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
|
||||
import { UmbMyTreeItemContext, MyTreeItemDataModel } from './my-tree-item.context';
|
||||
|
||||
@customElement('my-tree-item')
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
"@umbraco-cms/backoffice/context-api": ["libs/context-api"],
|
||||
"@umbraco-cms/backoffice/controller-api": ["libs/controller-api"],
|
||||
"@umbraco-cms/backoffice/css": ["libs/css/custom-properties.css"],
|
||||
"@umbraco-cms/backoffice/element": ["libs/element"],
|
||||
"@umbraco-cms/backoffice/element.js": ["libs/element"],
|
||||
"@umbraco-cms/backoffice/element-api-api": ["libs/element-api"],
|
||||
"@umbraco-cms/backoffice/entity-action": ["libs/entity-action"],
|
||||
"@umbraco-cms/backoffice/events": ["libs/umb-events"],
|
||||
"@umbraco-cms/backoffice/extension-api": ["libs/extension-api"],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Load all .d.ts files from the dist/libs folder
|
||||
// and replace all imports from @umbraco-cms/backoffice with relative imports
|
||||
// Example: import { Foo } from '@umbraco-cms/backoffice/element' -> import { Foo } from './element'
|
||||
// Example: import { Foo } from '@umbraco-cms/backoffice/element-api' -> import { Foo } from './element'
|
||||
// This is needed because the d.ts files are not in the same folder as the source files
|
||||
// and the absolute paths are not valid when the d.ts files are copied to the dist folder
|
||||
// This is only used when building the d.ts files.
|
||||
@@ -35,8 +35,7 @@ try {
|
||||
}
|
||||
|
||||
// Transform all .d.ts files and copy all other files to the output folder
|
||||
libs.forEach(lib => {
|
||||
|
||||
libs.forEach((lib) => {
|
||||
if (lib.endsWith('.js') === false && lib.endsWith('.js.map') === false) return;
|
||||
|
||||
console.log(`Transforming ${lib}`);
|
||||
@@ -55,5 +54,4 @@ libs.forEach(lib => {
|
||||
writeFileSync(dtsFile, code, 'utf8');
|
||||
|
||||
cpSync(dtsFile, `${outputDir}/${lib}`, { recursive: true });
|
||||
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@ export default {
|
||||
'@umbraco-cms/backoffice/backend-api': './libs/backend-api/index.ts',
|
||||
'@umbraco-cms/backoffice/context-api': './libs/context-api/index.ts',
|
||||
'@umbraco-cms/backoffice/controller-api': './libs/controller-api/index.ts',
|
||||
'@umbraco-cms/backoffice/element': './libs/element/index.ts',
|
||||
'@umbraco-cms/backoffice/element-api': './libs/element-api/index.ts',
|
||||
'@umbraco-cms/backoffice/extension-api': './libs/extension-api/index.ts',
|
||||
'@umbraco-cms/backoffice/observable-api': './libs/observable-api/index.ts',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user