prep for release

This commit is contained in:
Aravinth Manivannan 2021-12-08 14:28:38 +05:30
parent 9ea8676d24
commit 03c8026470
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
4 changed files with 45 additions and 47 deletions

View file

@ -15,9 +15,7 @@
To generate proof-of-work, per mCaptcha specification: To generate proof-of-work, per mCaptcha specification:
```typescript ```typescript
import {generate_proof} from "@mcaptcha/pow_sha256-polyfill"; /* yet to import {generate_proof} from "@mcaptcha/pow_sha256-polyfill";
be published in npm */
let salt = "randomsaltvalueprovidedbymcaptcha"; let salt = "randomsaltvalueprovidedbymcaptcha";
let phrase = "randomphrasevalueprovidedbymcaptcha"; let phrase = "randomphrasevalueprovidedbymcaptcha";

View file

@ -1,12 +1,13 @@
{ {
"author": "Aravinth Manivannan <realaravinth@batsense.net>", "author": "Aravinth Manivannan <realaravinth@batsense.net>",
"name": "pow_sha256-polyfill", "name": "@mcaptcha/pow_sha256-polyfill",
"version": "0.1.0-alpha-1",
"license": "(MIT OR Apache-2.0)", "license": "(MIT OR Apache-2.0)",
"keywords": [ "keywords": ["mCaptcha", "CAPTCHA", "proof of work"],
"mCaptcha", "browser": "dist/index.js",
"CAPTCHA", "types": "dist/index.d.ts",
"proof of work" "files": ["dist"],
],
"homepage": "https://mcaptcha.org", "homepage": "https://mcaptcha.org",
"bugs": { "bugs": {
"url": "https://github.com/mCaptcha/pow_sha256-polyfill/issues", "url": "https://github.com/mCaptcha/pow_sha256-polyfill/issues",
@ -16,7 +17,25 @@
"type": "git", "type": "git",
"url": "https://github.com/mCaptcha/pow_sha256-polyfill.git" "url": "https://github.com/mCaptcha/pow_sha256-polyfill.git"
}, },
"version": "0.1.0", "funding": [
{
"type": "individual",
"url": "http://mcaptcha.org/donate"
},
{
"type": "liberapay",
"url": "https://liberapay.com/mcaptcha"
},
{
"type": "individual",
"url": "http://batsense.net/donate"
},
{
"type": "liberapay",
"url": "https://liberapay.com/realaravinth"
}
],
"scripts": { "scripts": {
"build": "webpack --mode production", "build": "webpack --mode production",
"doc": "yarn typedoc src/index.ts", "doc": "yarn typedoc src/index.ts",

View file

@ -2,30 +2,18 @@
"compilerOptions": { "compilerOptions": {
"incremental": true, "incremental": true,
"target": "es2020", "target": "es2020",
"module": "es2020", "lib": ["es2015", "dom"],
"module": "commonjs",
"allowJs": false, "allowJs": false,
"sourceMap": true, "sourceMap": true,
"outDir": "./dist/bundle", "declaration": true,
"outDir": "./dist/",
"rootDir": "./src/", "rootDir": "./src/",
"removeComments": true, "removeComments": true,
"moduleResolution": "node", "moduleResolution": "node",
//"strict": true, "strict": true,
"noImplicitAny": true, "noImplicitAny": true,
//"strictNullChecks": true,
//"strictFunctionTypes": true,
//"strictBindCallApply": true,
//"strictPropertyInitialization": true,
//"noImplicitThis": true,
//"alwaysStrict": true,
//"noUnusedLocals": true,
//"noUnusedParameters": true,
//"noImplicitReturns": true,
//"noFallthroughCasesInSwitch": true,
//"noUncheckedIndexedAccess": true,
//"noPropertyAccessFromIndexSignature": true,
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true, "skipLibCheck": true,
@ -37,8 +25,8 @@
"docs", "docs",
"jest.config.ts", "jest.config.ts",
"**/*.test.ts", "**/*.test.ts",
"src/test-data.ts",
"tmp", "tmp",
"dist",
"**/*setupTests" "**/*setupTests"
], ],

View file

@ -1,43 +1,36 @@
('use strict'); ("use strict");
const path = require('path'); const path = require("path");
const dist = path.resolve(__dirname, 'dist'); const dist = path.resolve(__dirname, "dist");
module.exports = { module.exports = {
//devtool: 'inline-source-map', //devtool: 'inline-source-map',
//mode: 'development', //mode: 'development',
mode: 'production', mode: "production",
entry: './src/index.ts', entry: "./src/",
output: { output: {
path: dist, path: dist,
filename: 'bundle.js', libraryTarget: "umd",
filename: "index.js",
library: "pow256-polyfill",
}, },
module: { module: {
rules: [ rules: [
{ {
test: /\.tsx?$/, test: /\.ts$/,
loader: 'ts-loader', loader: "ts-loader",
}, },
], ],
}, },
resolve: { resolve: {
extensions: ['.ts', '.tsx', '.js'], extensions: [".ts", ".tsx", ".js"],
}, },
plugins: [], plugins: [],
optimization: { optimization: {
minimizer: [ minimizer: [
// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line // For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
`...`, "...",
], ],
}, },
experiments: {
// executeModule: true,
// outputModule: true,
//syncWebAssembly: true,
// topLevelAwait: true,
//asyncWebAssembly: true,
// layers: true,
// lazyCompilation: true,
},
}; };