typescript(option): chore: initial setup
Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
commit
052584b09a
3
typescript/option/.gitignore
vendored
Normal file
3
typescript/option/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
node_modules
|
||||
dist
|
||||
sandbox
|
5
typescript/option/.prettierrc
Normal file
5
typescript/option/.prettierrc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"semi": false,
|
||||
"tabWidth": 4,
|
||||
"singleQuote": true
|
||||
}
|
39
typescript/option/LICENSE
Normal file
39
typescript/option/LICENSE
Normal file
|
@ -0,0 +1,39 @@
|
|||
The Prosperity Public License 2.0.0
|
||||
|
||||
Contributor: Matei Adriel
|
||||
|
||||
Source Code: https://github.com/Mateiadrielrafael/ecs
|
||||
|
||||
This license lets you use and share this software for free,
|
||||
with a trial-length time limit on commercial use. Specifically:
|
||||
|
||||
If you follow the rules below, you may do everything with this
|
||||
software that would otherwise infringe either the contributor's
|
||||
copyright in it, any patent claim the contributor can license
|
||||
that covers this software as of the contributor's latest
|
||||
contribution, or both.
|
||||
|
||||
1. You must limit use of this software in any manner primarily
|
||||
intended for or directed toward commercial advantage or
|
||||
private monetary compensation to a trial period of 32
|
||||
consecutive calendar days. This limit does not apply to use in
|
||||
developing feedback, modifications, or extensions that you
|
||||
contribute back to those giving this license.
|
||||
|
||||
2. Ensure everyone who gets a copy of this software from you, in
|
||||
source code or any other form, gets the text of this license
|
||||
and the contributor and source code lines above.
|
||||
|
||||
3. Do not make any legal claim against anyone for infringing any
|
||||
patent claim they would infringe by using this software alone,
|
||||
accusing this software, with or without changes, alone or as
|
||||
part of a larger application.
|
||||
|
||||
You are excused for unknowingly breaking rule 1 if you stop
|
||||
doing anything requiring this license within 30 days of
|
||||
learning you broke the rule.
|
||||
|
||||
**This software comes as is, without any warranty at all. As far
|
||||
as the law allows, the contributor will not be liable for any
|
||||
damages related to this software or this license, for any kind of
|
||||
legal claim.**
|
36
typescript/option/package.json
Normal file
36
typescript/option/package.json
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"name": "@adrielus/option",
|
||||
"version": "0.0.0-development",
|
||||
"description": "Typescript version of fsharps Option module",
|
||||
"main": "dist/bundle.cjs.js",
|
||||
"module": "dist/bundle.esm.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"prebuild": "rimraf dist",
|
||||
"build": "rollup -c rollup.config.ts"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"keywords": [
|
||||
"typescript",
|
||||
"fsharp",
|
||||
"option",
|
||||
"maybe",
|
||||
"nullable"
|
||||
],
|
||||
"dependencies": {},
|
||||
"sideEffects": false,
|
||||
"devDependencies": {
|
||||
"rimraf": "^3.0.0",
|
||||
"rollup": "^1.27.5",
|
||||
"rollup-plugin-commonjs": "^10.1.0",
|
||||
"rollup-plugin-dts": "^1.1.12",
|
||||
"rollup-plugin-node-resolve": "^5.2.0",
|
||||
"rollup-plugin-terser": "^5.1.2",
|
||||
"rollup-plugin-typescript2": "^0.25.2",
|
||||
"typescript": "^3.7.2"
|
||||
},
|
||||
"author": "Matei Adriel",
|
||||
"license": "SEE LICENSE IN LICENSE"
|
||||
}
|
54
typescript/option/rollup.config.ts
Normal file
54
typescript/option/rollup.config.ts
Normal file
|
@ -0,0 +1,54 @@
|
|||
import commonjs from 'rollup-plugin-commonjs'
|
||||
import nodeResolve from 'rollup-plugin-node-resolve'
|
||||
import dts from 'rollup-plugin-dts'
|
||||
import typescript from 'rollup-plugin-typescript2'
|
||||
import { terser } from 'rollup-plugin-terser'
|
||||
import { resolve } from 'path'
|
||||
|
||||
const outputDirectory = resolve(__dirname, 'dist')
|
||||
const inputFile = resolve(__dirname, 'src/index.ts')
|
||||
|
||||
const npmConfig = require(resolve(__dirname, `package.json`))
|
||||
|
||||
const external = Object.keys(npmConfig.dependencies || {})
|
||||
const dev = Boolean(process.env.ROLLUP_WATCH)
|
||||
|
||||
export default [
|
||||
{
|
||||
input: inputFile,
|
||||
external,
|
||||
output: [
|
||||
{
|
||||
file: `${outputDirectory}/bundle.cjs.js`,
|
||||
format: 'cjs',
|
||||
sourcemap: true
|
||||
},
|
||||
{
|
||||
file: `${outputDirectory}/bundle.esm.js`,
|
||||
format: 'esm',
|
||||
sourcemap: true
|
||||
},
|
||||
{
|
||||
file: `${outputDirectory}/bundle.amd.js`,
|
||||
sourcemap: true,
|
||||
format: 'amd',
|
||||
name: 'Loopover'
|
||||
}
|
||||
],
|
||||
plugins: [
|
||||
nodeResolve({
|
||||
extensions: ['.ts']
|
||||
}),
|
||||
commonjs(),
|
||||
typescript({
|
||||
tsconfig: resolve(__dirname, 'tsconfig.json')
|
||||
}),
|
||||
!dev && terser()
|
||||
]
|
||||
},
|
||||
{
|
||||
input: inputFile,
|
||||
output: [{ file: `${outputDirectory}/index.d.ts`, format: 'es' }],
|
||||
plugins: [dts()]
|
||||
}
|
||||
]
|
0
typescript/option/src/index.ts
Normal file
0
typescript/option/src/index.ts
Normal file
11
typescript/option/tsconfig.json
Normal file
11
typescript/option/tsconfig.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"lib": ["esnext", "dom", "es2015.iterable"],
|
||||
"moduleResolution": "node",
|
||||
"strictNullChecks": true,
|
||||
"sourceMap": true,
|
||||
"downlevelIteration": true,
|
||||
"target": "es6"
|
||||
},
|
||||
"include": ["src", "sandbox"]
|
||||
}
|
Loading…
Reference in a new issue