Skip to content

Commit 3cd90fe

Browse files
authored
Merge pull request #159 from solid/module-fix
Need to package things a bit different than what I thought before
2 parents eee1e08 + 9ad71aa commit 3cd90fe

File tree

3 files changed

+57
-35
lines changed

3 files changed

+57
-35
lines changed

src/index.ts

Lines changed: 48 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,52 +39,79 @@ https://github.com/solid/solid
3939
// REMOVE @ts-ignore as you migrate files to TypeScript
4040
import * as rdf from 'rdflib' // pull in first avoid cross-refs
4141
// @ts-ignore
42-
import * as ns from './ns'
42+
import ns from './ns'
4343
// @ts-ignore
44-
import * as acl from './acl'
44+
import acl from './acl'
4545
// @ts-ignore
46-
import * as aclControl from './acl-control'
46+
import aclControl from './acl-control'
4747
// @ts-ignore
48-
import * as authn from './signin'
48+
import authn from './signin'
4949
// @ts-ignore
50-
import * as create from './create'
50+
import create from './create'
5151
// @ts-ignore
52-
import * as icons from './iconBase'
52+
import icons from './iconBase'
5353
// @ts-ignore
54-
import * as log from './log'
54+
import log from './log'
5555
// @ts-ignore
56-
import * as matrix from './matrix'
56+
import matrix from './matrix'
5757
// @ts-ignore
58-
import * as media from './media-capture'
58+
import media from './media-capture'
5959
// @ts-ignore
60-
import * as messageArea from './messageArea'
60+
import messageArea from './messageArea'
6161
// @ts-ignore
6262
import { infiniteMessageArea } from './chat/infinite'
6363
// @ts-ignore
64-
import * as pad from './pad'
64+
import pad from './pad'
6565
// @ts-ignore
66-
import * as preferences from './preferences'
66+
import preferences from './preferences'
6767
// @ts-ignore
68-
import * as store from './store'
68+
import store from './store'
6969
// @ts-ignore
70-
import * as style from './style'
70+
import style from './style'
7171
// @ts-ignore
72-
import * as table from './table'
72+
import table from './table'
7373
// @ts-ignore
74-
import * as tabs from './tabs'
74+
import tabs from './tabs'
7575
// @ts-ignore
76-
import * as utils from './utils'
77-
// @ts-ignore
78-
import * as widgets from './widgets'
76+
import utils from './utils'
77+
import widgets from './widgets'
78+
79+
const dom = window ? window.document : null // Idea that UI.dom can be adapted in non-browser environments
80+
81+
if (typeof window !== 'undefined') {
82+
;(<any>window).UI = {
83+
ns,
84+
rdf,
85+
acl,
86+
aclControl,
87+
authn,
88+
create,
89+
dom,
90+
icons,
91+
log,
92+
matrix,
93+
media,
94+
messageArea,
95+
infiniteMessageArea,
96+
pad,
97+
preferences,
98+
store,
99+
style,
100+
table,
101+
tabs,
102+
utils,
103+
widgets
104+
} // Simpler access by non-node scripts
105+
}
79106

80-
const UI = {
107+
export {
81108
ns,
82109
rdf,
83110
acl,
84111
aclControl,
85112
authn,
86113
create,
87-
dom: window.document, // Idea that UI.dom can be adapted in non-browser environments
114+
dom,
88115
icons,
89116
log,
90117
matrix,
@@ -100,8 +127,3 @@ const UI = {
100127
utils,
101128
widgets
102129
}
103-
104-
if (typeof window !== 'undefined') {
105-
;(<any>window).UI = UI // Simpler access by non-node scripts
106-
}
107-
export default UI

src/widgets/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// export widgets with the same name)
2121
var widgets = Object.assign(
2222
{},
23-
{ PeoplePicker: require('./peoplePicker') },
23+
require('./peoplePicker'),
2424
require('./dragAndDrop'), // uploadFiles etc
2525
require('./error'), // UI.widgets.errorMessageBlock
2626
require('./buttons'),

tsconfig.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
2727

2828
/* Strict Type-Checking Options */
29-
"strict": true /* Enable all strict type-checking options. */,
30-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
31-
// "strictNullChecks": true, /* Enable strict null checks. */
32-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
33-
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
34-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
35-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
36-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
29+
"strict": false /* Enable all strict type-checking options. */,
30+
"noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */,
31+
"strictNullChecks": true /* Enable strict null checks. */,
32+
"strictFunctionTypes": true /* Enable strict checking of function types. */,
33+
"strictBindCallApply": true /* Enable strict 'bind', 'call', and 'apply' methods on functions. */,
34+
"strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */,
35+
"noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */,
36+
"alwaysStrict": true /* Parse in strict mode and emit "use strict" for each source file. */,
3737

3838
/* Additional Checks */
3939
// "noUnusedLocals": true, /* Report errors on unused locals. */

0 commit comments

Comments
 (0)