Skip to content

Commit

Permalink
Merge pull request #539 from ikemo3/package/top-level-await
Browse files Browse the repository at this point in the history
package: enable 'top-level await'
  • Loading branch information
ikemo3 authored Nov 19, 2022
2 parents aff999e + a65ebf2 commit bf2a05c
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 534 deletions.
454 changes: 0 additions & 454 deletions .dependency-cruiser.js

This file was deleted.

File renamed without changes.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"version": "1.15.0.1",
"author": "Hideki Ikemoto",
"license": "MIT",
"type": "module",
"devDependencies": {
"@types/chrome": "0.0.202",
"@types/copy-webpack-plugin": "^10.1.0",
"@types/html-webpack-plugin": "^3.2.6",
"@types/jest": "^28.1.8",
"@types/node": "^18.11.9",
"@types/webpack": "^5.28.0",
Expand All @@ -33,13 +33,13 @@
"zip-a-folder": "1.1.5"
},
"scripts": {
"archive": "ts-node ./scripts/archive.ts",
"build": "webpack",
"deploy": "ts-node scripts/github_release.ts",
"fix": "yarn eslint --fix --ext .ts apps scripts test *.ts jest.config.js",
"lint": "prettier --write .; yarn eslint --ext .ts apps scripts test *.ts jest.config.js",
"lint-for-ci": "prettier --check .; yarn eslint --format junit --output-file ./reports/eslint/eslint.xml --ext .ts apps scripts test *.ts jest.config.js",
"lint:deps": "depcruise --config .dependency-cruiser.js apps test",
"archive": "NODE_OPTIONS='--loader ts-node/esm' ts-node ./scripts/archive.ts",
"build": "NODE_OPTIONS='--loader ts-node/esm' webpack",
"develop": "NODE_OPTIONS='--loader ts-node/esm' webpack --watch",
"deploy": "NODE_OPTIONS='--loader ts-node/esm' ts-node scripts/github_release.ts",
"fix": "yarn eslint --fix --ext .ts apps scripts test *.ts jest.config.cjs",
"lint": "prettier --write .; yarn eslint --ext .ts apps scripts test *.ts jest.config.cjs",
"lint-for-ci": "prettier --check .; yarn eslint --format junit --output-file ./reports/eslint/eslint.xml --ext .ts apps scripts test *.ts jest.config.cjs",
"manifest": "ts-node ./scripts/make_manifest.ts",
"test": "jest"
},
Expand Down
4 changes: 4 additions & 0 deletions scripts/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { copyFileSync, cpSync, existsSync, mkdirSync, renameSync, readFileSync,
import path from "path";
import { execSync } from "child_process";
import { zip } from "zip-a-folder";
import { fileURLToPath } from "url";

// eslint-disable-next-line no-underscore-dangle
const __dirname = path.dirname(fileURLToPath(import.meta.url));

function clearDirectory(path: string) {
if (existsSync(path)) {
Expand Down
1 change: 0 additions & 1 deletion scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ fi

yarn install
yarn lint-for-ci
yarn lint:deps
yarn test

yarn build
Expand Down
4 changes: 4 additions & 0 deletions scripts/github_release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { execSync, spawnSync } from "child_process";
import { readFileSync, renameSync } from "fs";
import path from "path";
import { isError, configureGhrOption } from "./libs";
import { fileURLToPath } from "url";

// eslint-disable-next-line no-underscore-dangle
const __dirname = path.dirname(fileURLToPath(import.meta.url));

function getGitSha() {
const sha = execSync("git rev-parse HEAD");
Expand Down
4 changes: 4 additions & 0 deletions scripts/make_manifest.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import path from "path";
import { mkdirSync, existsSync, readFileSync, writeFileSync } from "fs";
import { format } from "date-fns";
import { fileURLToPath } from "url";

// eslint-disable-next-line no-underscore-dangle
const __dirname = path.dirname(fileURLToPath(import.meta.url));

// Create if there is no dist directory
const projectDir = path.dirname(__dirname);
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"compilerOptions": {
"esModuleInterop": true,
"alwaysStrict": false,
"module": "commonjs",
"module": "es2022",
"moduleResolution": "node",
"sourceMap": true,
"skipLibCheck": true,
"strict": true,
"strictPropertyInitialization": false,
"target": "es2017"
"target": "es2022"
},
"exclude": ["dist", "node_modules", "webpack.config.ts"]
}
8 changes: 8 additions & 0 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ import { join } from "path";
import HtmlWebpackPlugin from "html-webpack-plugin";
import CopyPlugin from "copy-webpack-plugin";
import WebpackShellPluginNext from "webpack-shell-plugin-next";
import path from "path";
import { fileURLToPath } from "url";

// eslint-disable-next-line no-underscore-dangle
const __dirname = path.dirname(fileURLToPath(import.meta.url));

const config: Configuration = {
mode: "development",
experiments: {
topLevelAwait: true,
},
entry: {
document_start: join(__dirname, "apps", "entry", "document_start.ts"),
document_idle: join(__dirname, "apps", "entry", "document_idle.ts"),
Expand Down
70 changes: 1 addition & 69 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1098,13 +1098,6 @@
"@types/filesystem" "*"
"@types/har-format" "*"

"@types/clean-css@*":
version "4.2.1"
resolved "https://registry.yarnpkg.com/@types/clean-css/-/clean-css-4.2.1.tgz#cb0134241ec5e6ede1b5344bc829668fd9871a8d"
integrity sha512-A1HQhQ0hkvqqByJMgg+Wiv9p9XdoYEzuwm11SVo1mX2/4PSdhjcrUlilJQoqLscIheC51t1D5g+EFWCXZ2VTQQ==
dependencies:
"@types/node" "*"

"@types/color-name@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
Expand Down Expand Up @@ -1167,24 +1160,6 @@
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35"
integrity sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==

"@types/html-minifier@*":
version "3.5.3"
resolved "https://registry.yarnpkg.com/@types/html-minifier/-/html-minifier-3.5.3.tgz#5276845138db2cebc54c789e0aaf87621a21e84f"
integrity sha512-j1P/4PcWVVCPEy5lofcHnQ6BtXz9tHGiFPWzqm7TtGuWZEfCHEP446HlkSNc9fQgNJaJZ6ewPtp2aaFla/Uerg==
dependencies:
"@types/clean-css" "*"
"@types/relateurl" "*"
"@types/uglify-js" "*"

"@types/html-webpack-plugin@^3.2.6":
version "3.2.6"
resolved "https://registry.yarnpkg.com/@types/html-webpack-plugin/-/html-webpack-plugin-3.2.6.tgz#07951aaf0fa260dbf626f9644f1d13106d537625"
integrity sha512-U8uJSvlf9lwrKG6sKFnMhqY4qJw2QXad+PHlX9sqEXVUMilVt96aVvFde73tzsdXD+QH9JS6kEytuGO2JcYZog==
dependencies:
"@types/html-minifier" "*"
"@types/tapable" "^1"
"@types/webpack" "^4"

"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
Expand Down Expand Up @@ -1246,64 +1221,21 @@
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.1.tgz#e1303048d5389563e130f5bdd89d37a99acb75eb"
integrity sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw==

"@types/relateurl@*":
version "0.2.28"
resolved "https://registry.yarnpkg.com/@types/relateurl/-/relateurl-0.2.28.tgz#6bda7db8653fa62643f5ee69e9f69c11a392e3a6"
integrity sha1-a9p9uGU/piZD9e5p6facEaOS46Y=

"@types/semver@^7.3.12":
version "7.3.12"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.12.tgz#920447fdd78d76b19de0438b7f60df3c4a80bf1c"
integrity sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A==

"@types/source-list-map@*":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9"
integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1MCwlkhUms+gtdzigTeUyBr09+u8BwOIY3MXvHdcsA==

"@types/stack-utils@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff"
integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==

"@types/tapable@^1":
version "1.0.7"
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.7.tgz#545158342f949e8fd3bfd813224971ecddc3fac4"
integrity sha512-0VBprVqfgFD7Ehb2vd8Lh9TG3jP98gvr8rgehQqzztZNI7o8zS8Ad4jyZneKELphpuE212D8J70LnSNQSyO6bQ==

"@types/tough-cookie@*":
version "4.0.2"
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.2.tgz#6286b4c7228d58ab7866d19716f3696e03a09397"
integrity sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==

"@types/uglify-js@*":
version "3.9.0"
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.9.0.tgz#4490a140ca82aa855ad68093829e7fd6ae94ea87"
integrity sha512-3ZcoyPYHVOCcLpnfZwD47KFLr8W/mpUcgjpf1M4Q78TMJIw7KMAHSjiCLJp1z3ZrBR9pTLbe191O0TldFK5zcw==
dependencies:
source-map "^0.6.1"

"@types/webpack-sources@*":
version "0.1.7"
resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-0.1.7.tgz#0a330a9456113410c74a5d64180af0cbca007141"
integrity sha512-XyaHrJILjK1VHVC4aVlKsdNN5KBTwufMb43cQs+flGxtPAf/1Qwl8+Q0tp5BwEGaI8D6XT1L+9bSWXckgkjTLw==
dependencies:
"@types/node" "*"
"@types/source-list-map" "*"
source-map "^0.6.1"

"@types/webpack@^4":
version "4.41.29"
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.29.tgz#2e66c1de8223c440366469415c50a47d97625773"
integrity sha512-6pLaORaVNZxiB3FSHbyBiWM7QdazAWda1zvAq4SbZObZqHSDbWLi62iFdblVea6SK9eyBIVp5yHhKt/yNQdR7Q==
dependencies:
"@types/node" "*"
"@types/tapable" "^1"
"@types/uglify-js" "*"
"@types/webpack-sources" "*"
anymatch "^3.0.0"
source-map "^0.6.0"

"@types/webpack@^5.28.0":
version "5.28.0"
resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-5.28.0.tgz#78dde06212f038d77e54116cfe69e88ae9ed2c03"
Expand Down Expand Up @@ -1694,7 +1626,7 @@ ansi-styles@^5.0.0:
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==

anymatch@^3.0.0, anymatch@^3.0.3:
anymatch@^3.0.3:
version "3.1.2"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
Expand Down

0 comments on commit bf2a05c

Please sign in to comment.