From 8bcfaf466fd104317b1e32fc50729675673f26d5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:15:24 -0400 Subject: [PATCH] Version Packages (next) (#46) Co-authored-by: github-actions[bot] --- .changeset/pre.json | 4 +++ CHANGELOG.md | 77 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 2570351..f6296a7 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -6,13 +6,17 @@ }, "changesets": [ "chilled-baboons-battle", + "chilly-bobcats-reflect", "cool-dingos-provide", "dull-candles-exercise", "eight-fishes-enjoy", + "eleven-kiwis-remain", + "loud-rivers-pretend", "many-spies-fix", "rude-berries-rescue", "shy-turkeys-count", "silly-seas-impress", + "swift-planets-rescue", "tasty-radios-rhyme", "two-pets-rescue" ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 12061c6..1af5e44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,82 @@ # @heymp/scratchpad +## 1.0.0-next.8 + +### Major Changes + +- 4aa2817: Add `generate config` command [#38](https://github.com/heyMP/scratchpad/issues/38) + + ```bash + npx @heymp/scratchpad generate --help + + Usage: scratchpad generate [options] [command] + + Generate files from templates. + + Options: + -h, --help display help for command + + Commands: + config Generates an example config file. + help [command] display help for command + ``` + +- 4aa2817: Add `run` command + + ```bash + npx @heymp/scratchpad run --help + + Usage: cli run [options] + + Execute a file in a browser. + + Arguments: + file file to execute in the browser. + + Options: + --headless [boolean] specify running the browser in headless + mode. + --devtools [boolean] open browser devtools automatically. + --ts-write [boolean] write the js output of the target ts file. + --url [string] specify a specific url to execute the code + in. + -h, --help display help for command + ``` + +### Minor Changes + +- ea5b50d: Add `writeFile`, `appendFile` exposed functions. (#44)[https://github.com/heyMP/scratchpad/issues/44] + + ```.js + await writeFile('./log.txt', 'hello'); + await appendFile('./log.txt', '\n'); + await appendFile('./log.txt', 'world'); + ``` + + Include custom exposed functions example. + + ```.js + import { join } from 'node:path' + import fs from 'node:fs/promises'; + + function loadFile(path) { + return fs.readFile(join(process.cwd(), path), 'utf8'); + } + + export default /** @type {import('@heymp/scratchpad/src/config').Config} */ ({ + playwright: async (args) => { + const { context, page } = args; + await context.exposeFunction('loadFile', loadFile) + } + }); + ``` + +- a242c0f: ⚠️ Change config types directory. + + ```js + export default /** @type {import('@heymp/scratchpad/src/config').Config} */ ({}); + ``` + ## 1.0.0-next.7 ### Minor Changes diff --git a/package.json b/package.json index 677383e..c514b5c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@heymp/scratchpad", "description": "Run TS/JS snippets in a locally", - "version": "1.0.0-next.7", + "version": "1.0.0-next.8", "main": "bin/cli.js", "type": "module", "bin": {