diff --git a/package.json b/package.json index 60a357e..17ce38a 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,11 @@ "import": "./dist/index.js", "default": "./dist/index.js" }, + "./const": { + "types": "./dist/const.d.ts", + "import": "./dist/const.js", + "default": "./dist/const.js" + }, "./imo": { "import": "./dist/imo.min.js" }, diff --git a/post-build.ps1 b/post-build.ps1 index 4144ce0..c588ec2 100644 --- a/post-build.ps1 +++ b/post-build.ps1 @@ -1,8 +1,8 @@ Write-Host "Starting post-build script..." -ForegroundColor Green # Copy the types file to the dist folder -$srcFiles = @("./src/types.ts", "./src/global.d.ts") -$destFiles = @("index.d.ts", "global.d.ts") +$srcFiles = @("./src/types.ts", "./src/global.d.ts", "./src/const-types.ts") +$destFiles = @("index.d.ts", "global.d.ts", "const.d.ts") $destFolder = "dist" if (!(Test-Path -Path $destFolder)) { New-Item -ItemType Directory -Path $destFolder | Out-Null diff --git a/src/const-types.ts b/src/const-types.ts new file mode 100644 index 0000000..da9b4a7 --- /dev/null +++ b/src/const-types.ts @@ -0,0 +1,9 @@ +/** + * Identifier used to tag IMO options. + */ +export declare const imPostingOptionsId: string; + +/** + * Identifier used to tag IMO UI options. + */ +export declare const imoUiOptionsId: string; diff --git a/src/const.ts b/src/const.ts new file mode 100644 index 0000000..de19f8d --- /dev/null +++ b/src/const.ts @@ -0,0 +1 @@ +export { imPostingOptionsId, imoUiOptionsId } from "./shared/options.js"; diff --git a/src/index.ts b/src/index.ts index b2e06d4..cd350b4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,6 @@ import type { ImoUiFactoryOptions } from "./types.js"; import { getInitialImoUiOptions } from "./shared/options.js"; import { initImoUiOptions } from "./lib/state/imoUiOptions"; import type { CorePiece } from "@collagejs/core"; -export { imPostingOptionsId, imoUiOptionsId } from "./shared/options.js"; const cssMount = cssMountFactory('piece'); diff --git a/src/types.ts b/src/types.ts index 5a16bbe..af8b486 100644 --- a/src/types.ts +++ b/src/types.ts @@ -91,16 +91,6 @@ export type ImoUiFactoryOptions = { */ export declare function imoUiFactory(options?: ImoUiFactoryOptions): Promise>; -/** - * Identifier used to tag IMO options. - */ -export declare const imPostingOptionsId: string; - -/** - * Identifier used to tag IMO UI options. - */ -export declare const imoUiOptionsId: string; - /** * Supported `p-retry` options. */ diff --git a/vite.config.ts b/vite.config.ts index ff258f8..9ef0865 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -10,7 +10,7 @@ export default defineConfig({ cjsCssPlugin({ serverPort: 4444, projectId: 'cjs-imo', - entryPoints: ['src/index.ts', 'src/imo-ui.ts'], + entryPoints: ['src/index.ts', 'src/const.js', 'src/imo-ui.ts'], assetFileNames: 'assets/[name][extname]', }), viteTest(),