Skip to content

Commit e35171b

Browse files
committed
improved webpack config & bundle & lint
1 parent b53317c commit e35171b

54 files changed

Lines changed: 102 additions & 125 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
//verbose: true, // Uncomment for detailed test output
2+
// verbose: true, // Uncomment for detailed test output
33
collectCoverage: true,
44
coverageDirectory: 'coverage',
55
testEnvironment: 'jsdom',

package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,30 @@
22
"name": "solid-ui",
33
"version": "2.6.0",
44
"description": "UI library for writing Solid read-write-web applications",
5-
"main": "./lib/index.js",
6-
"types": "./lib/index.d.ts",
5+
"main": "dist/solid-ui.js",
6+
"types": "dist/index.d.ts",
77
"files": [
8-
"lib",
9-
"dist"
8+
"dist/",
9+
"README.md",
10+
"LICENSE"
1011
],
1112
"scripts": {
12-
"build": "npm run clean && npm run build-lib && npm run build-types && npm run build-version && npm run build-dev && npm run build-dist && npm run build-storybook",
13-
"build-lib": "babel src -d lib --source-maps --extensions \".ts,.js\"",
13+
"clean": "rm -rf ./dist ./src/versionInfo.ts ./Documentation/api",
14+
"build": "npm run clean && npm run build-types && npm run build-version && npm run build-dist && npm run build-storybook",
1415
"build-types": "tsc --emitDeclarationOnly",
15-
"build-version": "sh ./timestamp.sh > src/versionInfo.ts && eslint \"src/versionInfo.ts\" --fix",
16-
"build-dev": "webpack --progress",
16+
"build-version": "sh ./timestamp.sh > src/versionInfo.ts && eslint 'src/versionInfo.ts' --fix",
1717
"build-dist": "webpack --progress --mode=production",
18-
"build-form-examples": "npm run build-lib && npm run build-dev && cp ./dist/*.js ./Documentation/form-examples/",
19-
"watch": "npm run build-version && babel src --out-dir lib --watch --source-maps --extensions \".ts,.js\"",
20-
"clean": "rm -rf lib dist ./Documentation/form-examples/main.js",
21-
"coverage": "jest --coverage --collectCoverageFrom=src/**/*.[jt]s",
18+
"build-form-examples": "npm run build && cp ./dist/solid-ui.js ./Documentation/form-examples/",
2219
"lint": "eslint",
2320
"typecheck": "tsc --noEmit",
2421
"typecheck:test": "tsc --noEmit -p tsconfig.test.json",
25-
"jest": "jest --no-coverage",
22+
"test": "jest --no-coverage",
23+
"test:coverage": "jest --coverage --collectCoverageFrom=src/**/*.[jt]s",
2624
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch",
27-
"test": "npm run build-version && npm run lint && npm run jest",
25+
"watch": "npm run build-version && babel src --out-dir dist --watch --source-maps --extensions '.ts,.js'",
2826
"doc": "typedoc --out ./Documentation/api/ ./src/ --excludeInternal",
29-
"prepublishOnly": "npm test && npm run build && npm run doc",
27+
"prepublishOnly": "npm run build && npm test && npm run doc",
28+
"preversion": "npm run lint && npm run typecheck && npm test",
3029
"postpublish": "git push origin main --follow-tags",
3130
"storybook": "storybook dev -p 6006",
3231
"build-storybook": "storybook build --output-dir ./examples/storybook"

src/acl/access-controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { DataBrowserContext } from 'pane-registry'
1010
import { shortNameForFolder } from './acl-control'
1111
import * as utils from '../utils'
1212
import * as debug from '../debug'
13-
import * as style from '../style'
13+
import { style } from '../style'
1414

1515
/**
1616
* Rendered HTML component used in the databrowser's Sharing pane.

src/acl/access-groups.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import { NamedNode, sym, Store } from 'rdflib'
88
import { ACLbyCombination, readACL } from './acl'
99
import * as widgets from '../widgets'
10-
import * as ns from '../ns'
10+
import ns from '../ns'
1111
import { AccessController } from './access-controller'
1212
import { AgentMapMap, ComboList, PartialAgentTriple } from './types'
1313
import { AddAgentButtons } from './add-agent-buttons'
1414
import * as debug from '../debug'
15-
import * as style from '../style'
15+
import { style } from '../style'
1616

1717
const ACL = ns.acl
1818

src/acl/acl-control.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* @packageDocumentation
66
*/
77

8-
import * as ns from '../ns'
8+
import ns from '../ns'
99
import * as utils from '../utils'
1010
import { getACLorDefault, getProspectiveHolder } from './acl'
1111
import { Store, NamedNode } from 'rdflib'
1212
import { DataBrowserContext } from 'pane-registry'
1313
import { AccessController } from './access-controller'
14-
import * as style from '../style'
14+
import { style } from '../style'
1515
import { log, warn } from '../debug'
1616

1717
let global: Window = window

src/acl/acl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @packageDocumentation
66
*/
77

8-
import * as ns from '../ns'
8+
import ns from '../ns'
99
import { solidLogicSingleton, ACL_LINK } from 'solid-logic'
1010
import * as utils from '../utils'
1111
import { AgentMapMap, AgentMapUnion, ComboList } from './types'

src/acl/add-agent-buttons.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import { AuthenticationContext } from 'solid-logic'
88
import * as debug from '../debug'
99
import { icons } from '../iconBase'
1010
import { ensureLoadedProfile } from '../login/login'
11-
import * as ns from '../ns'
11+
import ns from '../ns'
1212
import * as utils from '../utils'
1313
import * as widgets from '../widgets'
14-
import * as style from '../style'
14+
import { style } from '../style'
1515
import { AccessGroups } from './access-groups'
1616

1717
/**

src/chat/bookmarks.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import * as debug from '../debug'
77
import { icons } from '../iconBase'
88
import { media } from '../media/index'
9-
import * as ns from '../ns'
9+
import ns from '../ns'
1010
import * as pad from '../pad'
1111
import * as rdf from 'rdflib' // pull in first avoid cross-refs
12-
import * as style from '../style'
12+
import { style } from '../style'
1313
import * as utils from '../utils'
1414
import * as widgets from '../widgets'
15-
import { store, registerInTypeIndex, authn } from 'solid-logic'
15+
import { store, createTypeIndexLogic, authn } from 'solid-logic'
1616
import { findAppInstances } from '../login/login'
1717

1818
const UI = { icons, ns, media, pad, rdf, style, utils, widgets }
@@ -67,7 +67,7 @@ export async function findBookmarkDocument (userContext) {
6767
debug.warn('Can\'t make fresh bookmark file:' + e)
6868
return userContext
6969
}
70-
await registerInTypeIndex(
70+
await createTypeIndexLogic.registerInTypeIndex(
7171
newBookmarkFile,
7272
userContext.index,
7373
theClass

src/chat/chatLogic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import * as debug from '../debug'
77
import { DateFolder } from './dateFolder'
88
import { store, authn } from 'solid-logic'
9-
import * as ns from '../ns'
9+
import ns from '../ns'
1010
import * as $rdf from 'rdflib' // pull in first avoid cross-refs
1111
import * as utils from '../utils'
1212
import { getBlankMsg, signMsg, SEC } from './signature'

src/chat/class-version-dropped-infinte.wasjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import * as debug from '../debug'
77
import { icons } from '../iconBase'
88
import { store } from 'solid-logic'
99
// import { media } from '../media/index'
10-
import * as ns from '../ns'
10+
import ns from '../ns'
1111
// import * as pad from '../pad'
1212
// import { DateFolder } from './dateFolder'
1313
import { mostRecentVersion, ChatChannel } from './chatLogic'
1414
import { renderMessageEditor, renderMessageRow } from './message'
1515
// import { findBookmarkDocument } from './bookmarks'
1616

1717
import * as $rdf from 'rdflib' // pull in first avoid cross-refs
18-
// import * as style from '../style'
18+
// import { style } from '../style'
1919
// import * as utils from '../utils'
2020
import * as widgets from '../widgets'
2121

0 commit comments

Comments
 (0)