Skip to content

Commit

Permalink
feat(module): changes build from UMD to SystemJS #181, #203
Browse files Browse the repository at this point in the history
This change replaces Webpack/UMD build generation with SystemJS.

BREAKING CHANGE: This will no longer provide support for UMD.
  • Loading branch information
jshor committed Nov 26, 2022
1 parent d971edf commit 7372164
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@
"url": "https://github.com/jshor/datebook/issues"
},
"homepage": "https://datebook.dev",
"main": "dist/datebook.js",
"types": "dist/index.d.ts",
"main": "dist/datebook.min.js",
"types": "dist/datebook.d.ts",
"scripts": {
"build": "tsc",
"build": "tsc && esbuild dist/datebook.js --minify --outfile=dist/datebook.min.js",
"test": "jest",
"lint": "yarn eslint ./src",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"commit": "yarn git-cz",
"commitmsg": "commitlint -e $GIT_PARAMS",
"release": "standard-version -n"
},
"dependencies": {
Expand All @@ -46,6 +44,7 @@
"@vuepress/plugin-register-components": "^2.0.0-beta.53",
"codecov": "^3.8.3",
"commitizen": "^4.2.5",
"esbuild": "^0.15.15",
"eslint": "^8.28.0",
"husky": "^8.0.2",
"jest": "^29.3.1",
Expand Down
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import GoogleCalendar from './GoogleCalendar'
import YahooCalendar from './YahooCalendar'
import OutlookCalendar from './OutlookCalendar'
import ICalendar from './ICalendar'

export { default as CalendarBase } from './CalendarBase'
export { default as GoogleCalendar } from './GoogleCalendar'
export { default as YahooCalendar } from './YahooCalendar'
Expand All @@ -9,3 +14,10 @@ export { default as ICSAlarm } from './types/ICSAlarm'
export { default as ICSAttachment } from './types/ICSAttachment'
export { default as ICSDuration } from './types/ICSDuration'
export { default as ICSPropertyValue } from './types/ICSPropertyValue'

window.datebook = {
GoogleCalendar,
YahooCalendar,
OutlookCalendar,
ICalendar
}
17 changes: 17 additions & 0 deletions src/modules.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {
GoogleCalendar,
YahooCalendar,
OutlookCalendar,
ICalendar
} from '.'

declare global {
interface Window {
datebook: {
GoogleCalendar
YahooCalendar
OutlookCalendar
ICalendar
}
}
}
7 changes: 5 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"compilerOptions": {
"outDir": "./dist",
"target": "es5",
"lib": ["es5", "es6", "dom"],
"outFile": "./dist/datebook.js",
"module": "System",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"allowJs": true,
"declaration": true,
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2699,7 +2699,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.15.tgz#5a277ce10de999d2a6465fc92a8c2a2d207ebd31"
integrity sha512-ttuoCYCIJAFx4UUKKWYnFdrVpoXa3+3WWkXVI6s09U+YjhnyM5h96ewTq/WgQj9LFSIlABQvadHSOQyAVjW5xQ==

esbuild@^0.15.12, esbuild@^0.15.9:
esbuild@^0.15.12, esbuild@^0.15.15, esbuild@^0.15.9:
version "0.15.15"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.15.tgz#503b70bdc18d72d8fc2962ed3ab9219249e58bbe"
integrity sha512-TEw/lwK4Zzld9x3FedV6jy8onOUHqcEX3ADFk4k+gzPUwrxn8nWV62tH0udo8jOtjFodlEfc4ypsqX3e+WWO6w==
Expand Down Expand Up @@ -5651,7 +5651,7 @@ vue@^3.2.37, vue@^3.2.41:
"@vue/server-renderer" "3.2.45"
"@vue/shared" "3.2.45"

[email protected].50-pre.1:
[email protected].53:
version "2.0.0-beta.53"
resolved "https://registry.yarnpkg.com/vuepress-vite/-/vuepress-vite-2.0.0-beta.53.tgz#6724d5edd99df2d494a8145206192e4cc88e9b9a"
integrity sha512-kITVMM+LcV5mDQXQXAKgK0adAGMm7oyPls6HPTLM9gUvpSs2A19zfwf8zFoxIF9X+ANay4Tg87egtnJOcp8Wcg==
Expand All @@ -5666,7 +5666,7 @@ vuepress@^2.0.0-beta.53:
resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-2.0.0-beta.50-pre.1.tgz#26eec90444bb37590f29d10dd5923e75c476189f"
integrity sha512-4Finc3GDscIqgRFAZFwa4SUm8tIFSVQIxnPIpQPW3kaM37rKylvUDkLrs2lMvoDPTAAE+Kf+v34tAFX+ZMGKUg==
dependencies:
vuepress-vite "2.0.0-beta.50-pre.1"
vuepress-vite "2.0.0-beta.53"

walker@^1.0.8:
version "1.0.8"
Expand Down

0 comments on commit 7372164

Please sign in to comment.