mirror of
https://github.com/kou029w/_.git
synced 2025-01-30 22:08:02 +00:00
remove bolt, node-test, playwright, ts
This commit is contained in:
parent
aa1ba85751
commit
84b0494547
25 changed files with 0 additions and 4690 deletions
|
@ -1,19 +0,0 @@
|
||||||
# bolt
|
|
||||||
|
|
||||||
## インストール
|
|
||||||
|
|
||||||
Step 1
|
|
||||||
: Slack アプリの作成
|
|
||||||
|
|
||||||
[Create New Slack App](https://api.slack.com/apps?new_app=1) → [Select a workspace] → [Create]
|
|
||||||
|
|
||||||
- ボットユーザーを有効化
|
|
||||||
- `app_mentions:read` `chat:write` スコープ必須
|
|
||||||
|
|
||||||
→ [Install to Workspace]
|
|
||||||
|
|
||||||
Step 2
|
|
||||||
: Deno Deploy
|
|
||||||
|
|
||||||
- `SLACK_BOT_TOKEN` ... [Slack Applications](https://api.slack.com/apps) → 作成した Slack アプリ → Permissions ページにある `xoxb-` から始まるボットトークン
|
|
||||||
- `SLACK_SIGNING_SECRET` ... [Slack Applications](https://api.slack.com/apps) → 作成した Slack アプリ → Basic Information ページにある Signing Secret
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
"imports": {
|
|
||||||
"@slack/bolt": "npm:@slack/bolt@^3.17.1"
|
|
||||||
},
|
|
||||||
"deploy": {
|
|
||||||
"project": "b0bd997b-0b41-4348-9657-73a44c2bc25a",
|
|
||||||
"exclude": [
|
|
||||||
"**/node_modules"
|
|
||||||
],
|
|
||||||
"include": [],
|
|
||||||
"entrypoint": "main.ts"
|
|
||||||
}
|
|
||||||
}
|
|
1295
bolt/deno.lock
generated
1295
bolt/deno.lock
generated
File diff suppressed because it is too large
Load diff
14
bolt/main.ts
14
bolt/main.ts
|
@ -1,14 +0,0 @@
|
||||||
import bolt from "npm:@slack/bolt";
|
|
||||||
|
|
||||||
const { SLACK_BOT_TOKEN = "", SLACK_SIGNING_SECRET = "" } = Deno.env.toObject();
|
|
||||||
|
|
||||||
const app = new bolt.App({
|
|
||||||
token: SLACK_BOT_TOKEN,
|
|
||||||
signingSecret: SLACK_SIGNING_SECRET,
|
|
||||||
});
|
|
||||||
|
|
||||||
app.event("app_mention", async (c) => {
|
|
||||||
await c.say(`Pong! ${c.event.text}`);
|
|
||||||
});
|
|
||||||
|
|
||||||
await app.start();
|
|
|
@ -1,6 +0,0 @@
|
||||||
import { test } from "node:test";
|
|
||||||
import assert from "node:assert/strict";
|
|
||||||
|
|
||||||
test("1 + 2 = 3", () => {
|
|
||||||
assert.equal(1 + 2, 3);
|
|
||||||
});
|
|
|
@ -1 +0,0 @@
|
||||||
export default "hello!";
|
|
|
@ -1,7 +0,0 @@
|
||||||
import { test } from "node:test";
|
|
||||||
import assert from "node:assert/strict";
|
|
||||||
import message from "./hello.js";
|
|
||||||
|
|
||||||
test("say hello", () => {
|
|
||||||
assert.equal(message, "hello!");
|
|
||||||
});
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"test": "node --test"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "^18.7.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
import { test } from "node:test";
|
|
||||||
import assert from "node:assert/strict";
|
|
||||||
|
|
||||||
test("parse json", () => {
|
|
||||||
const json = `{"name": "太郎", "age": 42}`;
|
|
||||||
const obj = JSON.parse(json);
|
|
||||||
assert.deepEqual(obj, { name: "太郎", age: 42 });
|
|
||||||
});
|
|
1
playwright-rust/.gitignore
vendored
1
playwright-rust/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
target
|
|
1660
playwright-rust/Cargo.lock
generated
1660
playwright-rust/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,12 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "playwright-rust"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
playwright = "0.0.20"
|
|
||||||
tokio = { version = "1.39.3", features = ["full"] }
|
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name = "playwright-rust"
|
|
||||||
path = "main.rs"
|
|
|
@ -1,18 +0,0 @@
|
||||||
use playwright::Playwright;
|
|
||||||
|
|
||||||
#[tokio::main]
|
|
||||||
async fn main() -> Result<(), playwright::Error> {
|
|
||||||
let playwright = Playwright::initialize().await?;
|
|
||||||
playwright.prepare()?;
|
|
||||||
let chromium = playwright.chromium();
|
|
||||||
let browser = chromium.launcher().launch().await?;
|
|
||||||
let context = browser.context_builder().build().await?;
|
|
||||||
let page = context.new_page().await?;
|
|
||||||
page.goto_builder("https://example.com/").goto().await?;
|
|
||||||
let s: String = page.eval("() => location.href").await?;
|
|
||||||
println!("{}", s);
|
|
||||||
page.click_builder("a").click().await?;
|
|
||||||
let s: String = page.eval("() => location.href").await?;
|
|
||||||
println!("{}", s);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
1
playwright-screenshot/.gitignore
vendored
1
playwright-screenshot/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
/screenshot/
|
|
|
@ -1,29 +0,0 @@
|
||||||
const { chromium } = require("playwright");
|
|
||||||
|
|
||||||
async function main() {
|
|
||||||
const browser = await chromium.launch({
|
|
||||||
headless: false,
|
|
||||||
});
|
|
||||||
const context = await browser.newContext({
|
|
||||||
screen: { width: 1280, height: 720 },
|
|
||||||
});
|
|
||||||
const page = await context.newPage();
|
|
||||||
await page.goto("about:blank");
|
|
||||||
for (let i = 0 /* NOP */; ; i++) {
|
|
||||||
try {
|
|
||||||
const seq = i.toString().padStart(6, "0");
|
|
||||||
const title = await page.title();
|
|
||||||
const date = new Date().toISOString().split("T")[0];
|
|
||||||
const path = `screenshot/${date}/${seq}-${title}.png`;
|
|
||||||
await page.screenshot({ path });
|
|
||||||
await page.waitForTimeout(1_000);
|
|
||||||
} catch {
|
|
||||||
// NOP
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await page.close();
|
|
||||||
await context.close();
|
|
||||||
await browser.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
main();
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"dependencies": {
|
|
||||||
"playwright": "latest"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
playwright-core@1.31.2:
|
|
||||||
version "1.31.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.31.2.tgz#debf4b215d14cb619adb7e511c164d068075b2ed"
|
|
||||||
integrity sha512-a1dFgCNQw4vCsG7bnojZjDnPewZcw7tZUNFN0ZkcLYKj+mPmXvg4MpaaKZ5SgqPsOmqIf2YsVRkgqiRDxD+fDQ==
|
|
||||||
|
|
||||||
playwright@latest:
|
|
||||||
version "1.31.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.31.2.tgz#4252280586c596746122cd1fdf9f8ff6a63fa852"
|
|
||||||
integrity sha512-jpC47n2PKQNtzB7clmBuWh6ftBRS/Bt5EGLigJ9k2QAKcNeYXZkEaDH5gmvb6+AbcE0DO6GnXdbl9ogG6Eh+og==
|
|
||||||
dependencies:
|
|
||||||
playwright-core "1.31.2"
|
|
|
@ -1,11 +0,0 @@
|
||||||
import { chromium } from "playwright";
|
|
||||||
|
|
||||||
const browser = await chromium.launch();
|
|
||||||
const page = await browser.newPage();
|
|
||||||
await page.goto("https://example.com/");
|
|
||||||
const l1 = await page.evaluate(() => location.href);
|
|
||||||
console.log(l1);
|
|
||||||
await page.click("a");
|
|
||||||
const l2 = await page.evaluate(() => location.href);
|
|
||||||
console.log(l2);
|
|
||||||
await browser.close();
|
|
56
playwright/package-lock.json
generated
56
playwright/package-lock.json
generated
|
@ -1,56 +0,0 @@
|
||||||
{
|
|
||||||
"name": "playwright",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {
|
|
||||||
"": {
|
|
||||||
"dependencies": {
|
|
||||||
"playwright": "^1.46.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/fsevents": {
|
|
||||||
"version": "2.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
|
||||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"optional": true,
|
|
||||||
"os": [
|
|
||||||
"darwin"
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/playwright": {
|
|
||||||
"version": "1.46.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.46.1.tgz",
|
|
||||||
"integrity": "sha512-oPcr1yqoXLCkgKtD5eNUPLiN40rYEM39odNpIb6VE6S7/15gJmA1NzVv6zJYusV0e7tzvkU/utBFNa/Kpxmwng==",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"dependencies": {
|
|
||||||
"playwright-core": "1.46.1"
|
|
||||||
},
|
|
||||||
"bin": {
|
|
||||||
"playwright": "cli.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
},
|
|
||||||
"optionalDependencies": {
|
|
||||||
"fsevents": "2.3.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/playwright-core": {
|
|
||||||
"version": "1.46.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.46.1.tgz",
|
|
||||||
"integrity": "sha512-h9LqIQaAv+CYvWzsZ+h3RsrqCStkBHlgo6/TJlFst3cOTlLghBQlJwPOZKQJTKNaD3QIB7aAVQ+gfWbN3NXB7A==",
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"bin": {
|
|
||||||
"playwright-core": "cli.js"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"start": "node --experimental-transform-types main.ts"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"playwright": "^1.46.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=22.7.0"
|
|
||||||
}
|
|
||||||
}
|
|
1
ts/.gitignore
vendored
1
ts/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
dist/
|
|
37
ts/README.md
37
ts/README.md
|
@ -1,37 +0,0 @@
|
||||||
# TypeScript で書いたサーバーをワンライナーで構築してみよう
|
|
||||||
|
|
||||||
tsx
|
|
||||||
|
|
||||||
```
|
|
||||||
npx tsx main.ts
|
|
||||||
```
|
|
||||||
|
|
||||||
tsx + watch
|
|
||||||
|
|
||||||
```
|
|
||||||
npx tsx --watch main.ts
|
|
||||||
```
|
|
||||||
|
|
||||||
esbuild (esbuild-register)
|
|
||||||
|
|
||||||
```
|
|
||||||
node -r esbuild-register main.ts
|
|
||||||
```
|
|
||||||
|
|
||||||
esbuild (esbuild-register) + watch
|
|
||||||
|
|
||||||
```
|
|
||||||
node -r esbuild-register --watch main.ts
|
|
||||||
```
|
|
||||||
|
|
||||||
tsup
|
|
||||||
|
|
||||||
```
|
|
||||||
npx tsup main.ts --clean --onSuccess 'node dist/main.js'
|
|
||||||
```
|
|
||||||
|
|
||||||
tsup + watch
|
|
||||||
|
|
||||||
```
|
|
||||||
npx tsup main.ts --clean --watch --onSuccess 'node dist/main.js'
|
|
||||||
```
|
|
17
ts/main.ts
17
ts/main.ts
|
@ -1,17 +0,0 @@
|
||||||
import express from "express";
|
|
||||||
|
|
||||||
const app = express();
|
|
||||||
|
|
||||||
app.get("/", (req, res) => {
|
|
||||||
res.send("OK");
|
|
||||||
});
|
|
||||||
|
|
||||||
const address = app.listen(3000).address();
|
|
||||||
|
|
||||||
console.log(address);
|
|
||||||
|
|
||||||
(async () => {
|
|
||||||
const res = await fetch(`http://127.0.0.1:${address?.port}/`);
|
|
||||||
console.log(res.url, res.status, res.statusText);
|
|
||||||
console.log(await res.text());
|
|
||||||
})();
|
|
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
"name": "ts",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"private": true,
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/express": "^4.17.21",
|
|
||||||
"@types/node": "^20.10.5",
|
|
||||||
"esbuild": "^0.18.20",
|
|
||||||
"esbuild-register": "^3.5.0",
|
|
||||||
"express": "^4.18.2",
|
|
||||||
"tsup": "^7.2.0",
|
|
||||||
"tsx": "^4.6.2",
|
|
||||||
"typescript": "^5.3.3"
|
|
||||||
}
|
|
||||||
}
|
|
1428
ts/pnpm-lock.yaml
generated
1428
ts/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue