Skip to content

Commit

Permalink
feat: Register new entrypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
CGNonofr committed Jul 5, 2022
1 parent 8e6e6ff commit b89a9f4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,26 @@
"./services": {
"types": "./dist/services.d.ts",
"default": "./dist/services.js"
},
"./service-override/messages": {
"types": "./dist/messages.d.ts",
"default": "./dist/messages.js"
},
"./service-override/modelEditor": {
"types": "./dist/modelEditor.d.ts",
"default": "./dist/modelEditor.js"
}
},
"typesVersions": {
"*": {
"services": [
"./dist/services.d.ts"
],
"service-override/messages": [
"./dist/messages.d.ts"
],
"service-override/modelEditor": [
"./dist/modelEditor.d.ts"
]
}
},
Expand Down
4 changes: 3 additions & 1 deletion rollup/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export default (args: Record<string, string>): rollup.RollupOptions => {
}],
input: {
api: './src/api.ts',
services: './src/services.ts'
services: './src/services.ts',
messages: './src/service-override/messages.ts',
modelEditor: './src/service-override/modelEditor.ts'
},
plugins: [
{
Expand Down
13 changes: 12 additions & 1 deletion rollup/rollup.types.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ interfaceOverride.set('URI', 'monaco.Uri')
interfaceOverride.set('ITextModel', 'monaco.editor.ITextModel')
interfaceOverride.set('vs/editor/common/config/editorOptions:IEditorOptions', 'monaco.editor.IEditorOptions')

export default rollup.defineConfig([
'./dist/types/src/services.d.ts',
'./dist/types/src/service-override/messages.d.ts',
'./dist/types/src/service-override/modelEditor.d.ts'
].map((input): rollup.RollupOptions => ({
input,
output: {
format: 'esm',
dir: 'dist',
entryFileNames: chunk => `${chunk.name}.ts`
},
external: function isExternal (id) {
if (id === 'vscode') {
return true
Expand Down Expand Up @@ -68,4 +79,4 @@ interfaceOverride.set('vs/editor/common/config/editorOptions:IEditorOptions', 'm
respectExternal: true
})
]
})
})))
2 changes: 1 addition & 1 deletion tsconfig.types.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
"emitDeclarationOnly": true,
"skipLibCheck": true
},
"include": ["src/services.ts"]
"include": ["src/services.ts", "src/types.d.ts", "src/service-override/messages.ts", "src/service-override/modelEditor.ts"]
}

0 comments on commit b89a9f4

Please sign in to comment.