Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
reindernijhoff committed Mar 18, 2024
0 parents commit 9c94d0a
Show file tree
Hide file tree
Showing 25 changed files with 4,673 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Build

on:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
66 changes: 66 additions & 0 deletions .github/workflows/bump-version-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Bump version, Tag & Publish

on:
workflow_dispatch:
inputs:
version:
description: 'Semver type of new version'
required: true
type: choice
options:
- major
- minor
- patch
- prerelease
prereleaseId:
description: 'Prerelease id'
required: false
type: choice
options:
- alpha
- beta
- rc

jobs:
bump-version:
runs-on: ubuntu-latest

steps:
- name: Check out source
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'

- name: Install npm packages
run: npm ci

- name: Setup Git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Bump Version
run: |
npm version ${{ github.event.inputs.version }} --no-git-tag-version --preid ${{ github.event.inputs.prereleaseId }}
git add .
git commit -m "v$(npm pkg get version | tr -d '"')" --no-verify
git tag $(npm pkg get version | tr -d '"') -m "v$(npm pkg get version | tr -d '"')"
- name: Build & Publish
run: npm run build

- name: Publish to NPM
run: |
npm run prepare-publish
cd ./dist
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Push latest version
run: git push origin main --follow-tags
43 changes: 43 additions & 0 deletions .github/workflows/publish-dev-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish dev release

on:
push:
branches: [main]

jobs:
bump-version:
runs-on: ubuntu-latest

steps:
- name: Check out source
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'

- name: Install npm packages
run: npm ci

- name: Setup Git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Bump Version
run: |
echo "$(npm pkg get version | cut -d '"' -f 2 | cut -d '-' -f 1)-dev.$(git rev-parse --short HEAD)" | xargs npm version --no-git-tag-version
- name: Build & Publish
run: npm run build

- name: Publish
run: |
npm run prepare-publish
cd ./dist
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
npm publish --tag next
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# cypress
/cypress/screenshots
/cypress/videos

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.idea
.vscode

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.eslintcache

# npm publish artifects
/dist
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Media.Monks

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Dittytoy
24 changes: 24 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
9 changes: 9 additions & 0 deletions example/counter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export function setupCounter(element) {
let counter = 0
const setCounter = (count) => {
counter = count
element.innerHTML = `count is ${counter}`
}
element.addEventListener('click', () => setCounter(counter + 1))
setCounter(0)
}
15 changes: 15 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app">
<ul id="ditties">
</ul>
</div>
<script type="module" src="/main.js"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions example/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import "./style.css";
import DittytoyJukebox from './src/dittytoyJukebox.js';

const example = new DittytoyJukebox();
Loading

0 comments on commit 9c94d0a

Please sign in to comment.