From 6333eef901bae6e0dc1ddcbae21b6c7d49ba9a25 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Wed, 14 Oct 2020 14:35:04 -0400 Subject: [PATCH] add metadata and build process --- .gitignore | 6 ++++++ .prettierrc.yaml | 4 ++++ package.json | 38 ++++++++++++++++++++++++++++++++++++++ rollup.config.js | 11 +++++++++++ tsconfig.json | 11 +++++++++++ 5 files changed, 70 insertions(+) create mode 100644 .gitignore create mode 100644 .prettierrc.yaml create mode 100644 package.json create mode 100644 rollup.config.js create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..74c19c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/dist/ +/node_modules/ +/package-lock.json +/pnpm-lock.yaml +/shrinkwrap.yaml +/yarn.lock diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..7bb07f4 --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,4 @@ +printWidth: 120 +useTabs: true +singleQuote: true +trailingComma: all diff --git a/package.json b/package.json new file mode 100644 index 0000000..d1bd650 --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "@conduitry/autocache", + "version": "0.0.0", + "description": "A cache that cleans itself", + "keywords": [ + "cache" + ], + "main": "dist/index.cjs.js", + "module": "dist/index.esm.js", + "types": "types/index.d.ts", + "files": [ + "dist", + "types" + ], + "engines": { + "node": "^12" + }, + "repository": { + "type": "git", + "url": "https://github.com/Conduitry/autocache.git" + }, + "author": "Conduitry", + "license": "MIT", + "bugs": { + "url": "https://github.com/Conduitry/autocache/issues" + }, + "devDependencies": { + "@types/node": "=12", + "rollup": "^2", + "rollup-plugin-cheap-ts": "Conduitry/rollup-plugin-cheap-ts#semver:^1", + "typescript": "^4" + }, + "scripts": { + "build": "rollup -c", + "dev": "rollup -cw", + "prepare": "npm run build" + } +} diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 0000000..7636b08 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,11 @@ +import cheap_ts from 'rollup-plugin-cheap-ts'; + +export default { + input: './src/index', + external: name => /^[a-z]/.test(name), + plugins: [cheap_ts()], + output: [ + { file: 'dist/index.cjs.js', format: 'cjs', sourcemap: true, interop: false, preferConst: true }, + { file: 'dist/index.esm.js', format: 'esm', sourcemap: true, preferConst: true }, + ], +}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..8e8771b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "noImplicitAny": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "removeComments": true, + "sourceMap": true, + "target": "esnext" + }, + "include": ["src"] +}