diff --git a/package.json b/package.json index 573dd29..8a98bb4 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,15 @@ { "name": "@hitechline/next-mdx", - "version": "0.0.1f", + "version": "0.0.1", "license": "AGPL-3.0", - "main": "index.js", - "module": "index.esm.js", - "types": "index.d.ts", + "main": "dist/index.js", + "module": "dist/index.esm.js", + "types": "typings/index.d.ts", "scripts": { "fix": "yarn lint:fix && yarn prettier:fix", - "clean": "rimraf dist typings", - "purge": "node scripts/clean", - "postpublish": "yarn purge", - "prepare": "node scripts/prepare", + "clean": "rimraf .tarball dist typings provider/**.js*", "prepublishOnly": "yarn build", - "release": "yarn node-env-run --exec \"semantic-release --ci false\"", - "release:check": "yarn node-env-run --exec \"semantic-release\"", + "release": "yarn node-env-run --exec \"semantic-release\"", "test": "jest --passWithNoTests", "test:watch": "yarn test --watchAll", "lint": "eslint ./ --ext js,jsx,ts,tsx", @@ -38,6 +34,11 @@ "lib": "src", "test": "__tests__" }, + "files": [ + "dist", + "typings", + "provider" + ], "keywords": [ "react", "next", diff --git a/scripts/checkPath.js b/scripts/checkPath.js deleted file mode 100644 index 259cf32..0000000 --- a/scripts/checkPath.js +++ /dev/null @@ -1,12 +0,0 @@ -const { promises } = require('fs'); - -async function checkPath(path) { - return promises - .access(path) - .then(() => true) - .catch(() => false); -} - -module.exports = { - checkPath, -}; diff --git a/scripts/clean.js b/scripts/clean.js deleted file mode 100644 index 22ed21d..0000000 --- a/scripts/clean.js +++ /dev/null @@ -1,42 +0,0 @@ -const { promises } = require('fs'); -const { join, resolve } = require('path'); - -const { checkPath } = require('./checkPath'); - -const ROOT_DIR = resolve(__dirname, '..'); -const DIST_DIR = resolve(ROOT_DIR, 'dist'); -const TYPINGS_DIR = resolve(ROOT_DIR, 'typings'); - -async function run() { - const files = await promises.readdir(DIST_DIR); - - await Promise.all( - files.map(async file => { - const fileRootPath = join(ROOT_DIR, file); - const pathExists = await checkPath(fileRootPath); - - if (pathExists) { - await promises.unlink(fileRootPath); - } - - return true; - }), - ); - - const typings = await promises.readdir(TYPINGS_DIR); - - await Promise.all( - typings.map(async file => { - const fileRootPath = join(ROOT_DIR, file); - const pathExists = await checkPath(fileRootPath); - - if (pathExists) { - await promises.unlink(fileRootPath); - } - - return true; - }), - ); -} - -run(); diff --git a/scripts/prepare.js b/scripts/prepare.js deleted file mode 100644 index a4d72d9..0000000 --- a/scripts/prepare.js +++ /dev/null @@ -1,32 +0,0 @@ -const { promises } = require('fs'); -const { join, resolve } = require('path'); - -const ROOT_DIR = resolve(__dirname, '..'); -const DIST_DIR = resolve(ROOT_DIR, 'dist'); -const TYPINGS_DIR = resolve(ROOT_DIR, 'typings'); - -async function run() { - const files = await promises.readdir(DIST_DIR); - - await Promise.all( - files.map(async file => { - const filePath = join(DIST_DIR, file); - - await promises.copyFile(filePath, join(ROOT_DIR, file)); - return true; - }), - ); - - const typings = await promises.readdir(TYPINGS_DIR); - - await Promise.all( - typings.map(async file => { - const filePath = join(TYPINGS_DIR, file); - - await promises.copyFile(filePath, join(ROOT_DIR, file)); - return true; - }), - ); -} - -run();