- How do I make the tree shakeable?
- What JS module systems should I target (
CommonJS
,AMD
,ES6
). - Should I transpile the source?
- Should I bundle the source?
- What files should I publish?
Let's try to address all the above questions now.
# .github/workflows/test.yml | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main |
# Gist Image Hosting on Comment | |
The set
lines
set -euxo pipefail
is short for:set -e
set -u
/** | |
* Sleep, delay, pause or wait in Javascript | |
* @link https://www.sitepoint.com/delay-sleep-pause-wait/ | |
* @param {Number} timeout Number in miliseconds | |
* @return {Promise} | |
*/ | |
export const sleep = timeout => new Promise(resolve => setTimeout(resolve, timeout)) |
import { defineAsyncComponent } from 'vue' | |
const Content = defineAsyncComponent(() => import('./component-content.js')) | |
export default { | |
name: 'App', | |
components: { Content }, | |
template: /*html*/` | |
<Content /> | |
` |
#!/bin/bash | |
# see also | |
# - Google's Shell Style Guide: https://google.github.io/styleguide/shell.xml | |
# - ShellCheck: https://github.com/koalaman/shellcheck | |
# src: | |
# - http://hackaday.com/2017/07/21/linux-fu-better-bash-scripting | |
# - https://dev.to/thiht/shell-scripts-matter |
https://cloud.digitalocean.com/account/api/tokens
sudo apt-get install s3cmd
https://docs.digitalocean.com/products/spaces/resources/s3cmd/
require 'singleton' | |
class SimpleLogger | |
include Singleton | |
attr_accessor :level | |
ERROR=1 | |
WARNING=2 | |
INFO=3 |
module Authenticable | |
# Devise methods overwrite | |
def current_user | |
@current_user ||= User.find_by(authentication_token: request.headers['Authorization']) | |
end | |
def authenticate_with_token! | |
render json: { errors: "Not authenticated" }, | |
status: :unauthorized unless user_signed_in? |