Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Bundle Static File Package #2191

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
"./src/packages/packages",
"./src/packages/property-editors",
"./src/packages/search",
"./src/packages/static-file",
"./src/packages/tags",
"./src/packages/templating",
"./src/packages/tiny-mce",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UMB_STATIC_FILE_TREE_ALIAS } from '../tree/manifests.js';
import { UMB_STATIC_FILE_TREE_ALIAS } from '../tree/index.js';
import type { UmbStaticFileItemModel } from '../repository/item/types.js';
import {
type UmbTreePickerModalValue,
Expand Down
8 changes: 8 additions & 0 deletions src/packages/static-file/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@umbraco-backoffice/static-file",
"private": true,
"type": "module",
"scripts": {
"build": "vite build"
}
}
4 changes: 4 additions & 0 deletions src/packages/static-file/tree/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const UMB_STATIC_FILE_TREE_REPOSITORY_ALIAS = 'Umb.Repository.StaticFile.Tree';
export const UMB_STATIC_FILE_TREE_STORE_ALIAS = 'Umb.Store.StaticFile.Tree';
export const UMB_STATIC_FILE_TREE_ALIAS = 'Umb.Tree.StaticFile';
export const UMB_STATIC_FILE_TREE_ITEM_ALIAS = 'Umb.TreeItem.StaticFile';
2 changes: 1 addition & 1 deletion src/packages/static-file/tree/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export {
UMB_STATIC_FILE_TREE_REPOSITORY_ALIAS,
UMB_STATIC_FILE_TREE_STORE_ALIAS,
UMB_STATIC_FILE_TREE_ALIAS,
} from './manifests.js';
} from './constants.js';
11 changes: 6 additions & 5 deletions src/packages/static-file/tree/manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import {
UMB_STATIC_FILE_FOLDER_ENTITY_TYPE,
UMB_STATIC_FILE_ROOT_ENTITY_TYPE,
} from '../entity.js';
import {
UMB_STATIC_FILE_TREE_ALIAS,
UMB_STATIC_FILE_TREE_ITEM_ALIAS,
UMB_STATIC_FILE_TREE_REPOSITORY_ALIAS,
UMB_STATIC_FILE_TREE_STORE_ALIAS,
} from './constants.js';
import type {
ManifestRepository,
ManifestTree,
Expand All @@ -11,11 +17,6 @@ import type {
ManifestTypes,
} from '@umbraco-cms/backoffice/extension-registry';

export const UMB_STATIC_FILE_TREE_REPOSITORY_ALIAS = 'Umb.Repository.StaticFile.Tree';
export const UMB_STATIC_FILE_TREE_STORE_ALIAS = 'Umb.Store.StaticFile.Tree';
export const UMB_STATIC_FILE_TREE_ALIAS = 'Umb.Tree.StaticFile';
export const UMB_STATIC_FILE_TREE_ITEM_ALIAS = 'Umb.TreeItem.StaticFile';

const treeRepository: ManifestRepository = {
type: 'repository',
alias: UMB_STATIC_FILE_TREE_REPOSITORY_ALIAS,
Expand Down
12 changes: 12 additions & 0 deletions src/packages/static-file/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'vite';
import { rmSync } from 'fs';
import { getDefaultConfig } from '../../vite-config-base';

const dist = '../../../dist-cms/packages/static-file';

// delete the unbundled dist folder
rmSync(dist, { recursive: true, force: true });

export default defineConfig({
...getDefaultConfig({ dist }),
});
Loading