This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const worker = new Worker('/tests.js') | |
| worker.onmessage = e => { | |
| if (e.data && e.data._command) { | |
| if (e.data._command === 'console') { | |
| const type = e.data.type || 'log' | |
| const msg = e.data.msg || '<empty>' | |
| switch (type) { | |
| case 'error': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** @typedef {() => Promise<unknown>} Task */ | |
| /** | |
| * @param {Task[]} pending | |
| * @param {number} max | |
| * @returns {Promise<unknown[]>} | |
| */ | |
| export function drain (pending, max) { | |
| return new Promise((resolve, reject) => { | |
| let nextIndex = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { join, resolve } = require('path') | |
| const { basename, build, file, log, glob, cliopts, stdoutStyle, watch } = require('estrella') | |
| async function serve (cwd, opts = null) { | |
| opts || (opts = {}) | |
| let pkgOpts = { devServerPort: null, publicPath: null, rewrites: null, redirects: null } | |
| if (isNodeProject(cwd)) { | |
| const pkg = JSON.parse(await file.read(join(cwd, 'package.json'), { encoding: 'utf8' })) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // NOTE: we are just assuming _tests is an alright place to render to | |
| export async function buildAndRunTests (cwd: string): Promise<void> { | |
| const [{ once }] = cliopts.parse( | |
| ['o, once', 'run the tests and then exit'] | |
| ) | |
| await file.mkdirs(join(cwd, '_tests')) | |
| await buildBrowserTests(cwd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-disable @typescript-eslint/no-var-requires */ | |
| const { join } = require('path') | |
| const { build, file, cliopts } = require('estrella') | |
| module.exports = { | |
| buildPackage, | |
| buildBrowserAndNodeModule, | |
| buildBrowserModule, | |
| buildNodeModule |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-disable @typescript-eslint/no-var-requires */ | |
| const perf = require('perf_hooks') | |
| const { spawn } = require('child_process') | |
| const { cliopts, fmtDuration, findInPATH, log, stdoutStyle } = require('estrella') | |
| module.exports = { | |
| clock, | |
| tscBuild | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clone() { | |
| org=$(echo $1 | awk -F/ '{ print $1 }') | |
| mkdir -p ~/src/github.com/$org | |
| path=~/src/github.com/$1 | |
| git clone $@ $path | |
| cd $path | |
| } | |
| # Examples: | |
| # $ clone myobie/dot-files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Gentle.Application do | |
| use Application | |
| def start(_type, _args) do | |
| children = [ | |
| {Task.Supervisor, name: Gentle.TaskSupervisor} | |
| ] | |
| opts = [strategy: :one_for_one, name: Gentle.Supervisor] | |
| Supervisor.start_link(children, opts) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| root: true, | |
| env: { | |
| browser: true, | |
| mocha: true | |
| }, | |
| globals: { | |
| expect: true | |
| }, | |
| plugins: [], |