Skip to content

Commit

Permalink
fix(#128, #126): Updates to project configuration to support usage in…
Browse files Browse the repository at this point in the history
…side svelte-kit applications (#129)

- added svelte property to package.json
- updated readme with instructions for svelte-kit users (add optimizeDeps config)
- update CI to create prerelease (next dist-tag) on pushes to next branch
  • Loading branch information
6eDesign authored Sep 19, 2021
1 parent f1d2f22 commit 739b6d4
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 210 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- master
- next
jobs:
release:
name: Release
Expand Down
367 changes: 169 additions & 198 deletions CHANGELOG.md

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ A small date picker built with Svelte 3. Demo available here: [view docs and exa
npm i -D svelte-calendar
```

## Usage within svelte-kit project

When using this component within a svelte-kit application it is necessary to add its two dependencies (`just-throttle` and `dayjs`) to the `config.kit.vite.optimizeDeps.include` array in `svelte.config.js`. Eg: your config should include the following:

```js
const config = {
kit: {
vite: {
optimizeDeps: {
include: ['just-throttle', 'dayjs']
}
}
}
};

export default config;
```

## Features

- Day, Month & Year pickers
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h1 class="svelte-alugsa">svelte-calendar</h1>
</pre></div></div></div>
<div class="column-secondary svelte-92c9vu"><div class="sc-popover svelte-197aegr" style="--sc-theme-calendar-width: 620px;--sc-theme-calendar-maxWidth: 100vw;--sc-theme-calendar-legend-height: 45px;--sc-theme-calendar-shadow: 0px 10px 26px rgba(0, 0, 0, 0.25);--sc-theme-calendar-colors-text-primary: #eee;--sc-theme-calendar-colors-text-highlight: #fff;--sc-theme-calendar-colors-background-primary: #333;--sc-theme-calendar-colors-background-highlight: #5829d6;--sc-theme-calendar-colors-background-hover: #222;--sc-theme-calendar-colors-border: #222;--sc-theme-calendar-font-regular: 1.5em;--sc-theme-calendar-font-large: 37em;--sc-theme-calendar-grid-disabledOpacity: .5;--sc-theme-calendar-grid-outsiderOpacity: .7; min-width: NaNpx; min-height: NaNpx;"><div class="trigger svelte-197aegr">
<div class="button-container svelte-18igz6t"><button class="svelte-18igz6t"></button>
<span class="button-text svelte-18igz6t">09/18/2021</span></div>
<span class="button-text svelte-18igz6t">09/19/2021</span></div>
</div></div></div>
</div></div></div></div>

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "svelte-calendar",
"version": "3.0.19",
"version": "3.0.27",
"main": "index.js",
"scripts": {
"dev": "svelte-kit dev",
"package": "svelte-kit package",
"postpackage": "node scripts/postpackage",
"prebuild": "rm -rf build",
"build": "svelte-kit build",
"postbuild": "touch docs/.nojekyll",
Expand Down Expand Up @@ -37,5 +38,6 @@
"svelte2tsx": "^0.4.6",
"typescript": "^4.4.3"
},
"type": "module"
"type": "module",
"svelte": "index.js"
}
18 changes: 10 additions & 8 deletions release.config.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
const npm = [
'@semantic-release/npm',
{
pkgRoot: 'package'
}
];
module.exports = {
branches: ['master'],
branches: [{ name: 'master' }, { name: 'next', channel: 'next' }],
verifyConditions: [
'@semantic-release/changelog',
'@semantic-release/npm',
Expand All @@ -20,5 +14,13 @@ module.exports = {
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
}
],
publish: [npm, '@semantic-release/github']
publish: [
[
'@semantic-release/npm',
{
pkgRoot: 'package'
}
],
'@semantic-release/github'
]
};

0 comments on commit 739b6d4

Please sign in to comment.