Skip to content

Commit

Permalink
Merge pull request #147 from ckeditor/i/144
Browse files Browse the repository at this point in the history
Feature: Add `augmentation.ts` to the TypeScript package generator. Closes #144.
  • Loading branch information
pomek committed Apr 20, 2023
2 parents fddaa52 + 1e00b93 commit f736d08
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ <h3>The directory structure</h3>
│ └─ ckeditor.ts # The editor initialization script.
├─ src
│ ├─ <%= formattedNames.plugin.lowerCaseMerged %>.ts
│ ├─ augmentation.ts # Type augmentations for the `@ckeditor/ckeditor5-core` module. Read more in <a href="https://ckeditor.com/docs/ckeditor5/latest/api/module_core_plugincollection-PluginsMap.html">PluginsMap</a> and <a href="https://ckeditor.com/docs/ckeditor5/latest/api/module_core_commandcollection-CommandsMap.html">CommandsMap</a>.
│ ├─ index.ts # The modules exported by the package when using the DLL builds.
│ └─ **/*.ts # All TypeScript source files should be saved here.
├─ tests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { <%= formattedNames.plugin.pascalCase %> } from './index';

declare module '@ckeditor/ckeditor5-core' {
interface PluginsMap {
[ <%= formattedNames.plugin.pascalCase %>.pluginName ]: <%= formattedNames.plugin.pascalCase %>;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ckeditor from './../theme/icons/ckeditor.svg';
import './augmentation';

export { default as <%= formattedNames.plugin.pascalCase %> } from './<%= formattedNames.plugin.lowerCaseMerged %>';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"lib": [
"DOM"
"DOM",
"DOM.Iterable"
],
"noImplicitAny": true,
"noImplicitOverride": true,
Expand Down
3 changes: 3 additions & 0 deletions scripts/ci/travis-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ const EXPECTED_PUBLISH_FILES = {
'ckeditor5-metadata.json'
],
ts: [
'src/augmentation.js',
'src/index.js',
'src/testpackage.js',
'src/augmentation.d.ts',
'src/index.d.ts',
'src/testpackage.d.ts',

Expand All @@ -55,6 +57,7 @@ const EXPECTED_SRC_DIR_FILES = {
'testpackage.js'
],
ts: [
'augmentation.ts',
'index.ts',
'testpackage.ts'
]
Expand Down

0 comments on commit f736d08

Please sign in to comment.