Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
cavellblood committed Sep 26, 2021
2 parents 5299aa1 + fe6d0ec commit 105b929
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 29 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.0.0
## 1.0.1 - - 2021-09-26
### Changed
- Specify Vite port number so that it doesn't conflict with other test projects running on port `3000`.

### Fixed
- Fix an issue where the opening times were being set too soon on the full message template and subsequently not being rendered. ([#3](https://github.com/cavellblood/sunset-to-sunset/issues/3))

## 1.0.0 - 2021-09-23
### Changed
- Initial Release

## 1.0.0-beta.2
## 1.0.0-beta.2 - 2021-09-23
### Fixed
- Added build files.

## 1.0.0-beta.1
## 1.0.0-beta.1 - 2021-09-23
### Added
- Added a default banner template if no template is defined.
- Allow multiple closing and opening elements to be added to the banner.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sunset-to-sunset",
"version": "1.0.0",
"version": "1.0.1",
"description": "",
"main": "src/js/main.js",
"author": "Cavell Blood",
Expand Down
3 changes: 3 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
useTabs: true
}
12 changes: 5 additions & 7 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ const renderMessage = (opening) => {

const messageTemplate = template.content.cloneNode(true)

// Find all opening elements and add formatted times
const openingElements = messageTemplate.querySelectorAll('.sts-opening-time')
formatTimes(openingElements, opening)

if (userFullTemplate) {
console.log('full user template')
let messageContainer = messageTemplate.querySelector('.sts-full-message__container');

while (messageContainer.firstElementChild) {
Expand All @@ -98,16 +93,19 @@ const renderMessage = (opening) => {
messageContainer.insertBefore(message, null)

} else if (userSimpleTemplate) {
console.log('simple user template')
const messageArea = messageTemplate.querySelector('.sts-message-area');
messageArea.insertBefore(message, null)
}


const html = document.getElementsByTagName('html')[0]
html.classList.add('sts-during-sabbath')

// Find all opening elements and add formatted times
const openingElements = messageTemplate.querySelectorAll('.sts-opening-time')
formatTimes(openingElements, opening)

// Insert the messageTemplate as the last item on the page.
// Insert the messageTemplate as the first item on the page.
document.body.insertBefore(messageTemplate, document.body.firstChild)
}

Expand Down
37 changes: 19 additions & 18 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
import legacy from '@vitejs/plugin-legacy'
import { nodeResolve } from '@rollup/plugin-node-resolve';
import path from 'path';
import legacy from "@vitejs/plugin-legacy";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import path from "path";

// https://vitejs.dev/config/
export default ({ command }) => ({
root: path.resolve(__dirname, "src"),
root: path.resolve(__dirname, "src"),
build: {
emptyOutDir: true,
manifest: true,
outDir: "../dist/",
rollupOptions: {
input: {
"sunset-to-sunset": "./src/js/main.js",
test: "./src/tests/index.html"
test: "./src/tests/index.html",
},
output: {
sourcemap: true,
entryFileNames: `assets/[name].min.js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`
assetFileNames: `assets/[name].[ext]`,
},
},
},
publicDir: './src/tests',
plugins: [
legacy({
targets: ['defaults', 'not IE 11']
}),
nodeResolve({
moduleDirectories: [
path.resolve('./node_modules'),
],
}),
],
})
publicDir: "./src/tests",
plugins: [
legacy({
targets: ["defaults", "not IE 11"],
}),
nodeResolve({
moduleDirectories: [path.resolve("./node_modules")],
}),
],
server: {
port: 3100
}
});

0 comments on commit 105b929

Please sign in to comment.