Skip to content
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
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
4 changes: 2 additions & 2 deletions post-build.ps1
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/const-types.ts
Original file line number Diff line number Diff line change
@@ -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;
1 change: 1 addition & 0 deletions src/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { imPostingOptionsId, imoUiOptionsId } from "./shared/options.js";
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
10 changes: 0 additions & 10 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,6 @@ export type ImoUiFactoryOptions = {
*/
export declare function imoUiFactory(options?: ImoUiFactoryOptions): Promise<CorePiece<{}>>;

/**
* 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.
*/
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Loading