Browse Source

Adding fp-ts

bodicsek 7 years ago
parent
commit
029788c0b4
5 changed files with 14 additions and 2 deletions
  1. 5 0
      package-lock.json
  2. 2 1
      package.json
  3. 3 0
      src/app.ts
  4. 3 0
      src/systemjs.config.ts
  5. 1 1
      tsconfig.json

+ 5 - 0
package-lock.json

@@ -578,6 +578,11 @@
         "pinkie-promise": "2.0.1"
       }
     },
+    "fp-ts": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.4.1.tgz",
+      "integrity": "sha512-+quy9y6X7F4F5Zb9ooMapeAcIbgcKGcyQPMNMCgi7fhHxhUMEIrOH9yPvkWRc83rUtL+AKaa3NTZa49KL/d4OQ=="
+    },
     "fs.realpath": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",

+ 2 - 1
package.json

@@ -11,7 +11,7 @@
     "build:amd": "tsc -p src/amd",
     "copy": "npm run copy:assets && npm run copy:libs",
     "copy:assets": "cpy '**/*.html' '../build/' --cwd=src --parents",
-    "copy:libs": "cpy 'systemjs/dist/*' '../build/libs/' --cwd=node_modules --parents",
+    "copy:libs": "cpy 'systemjs/dist/*' '../build/libs/' --cwd=node_modules --parents && cpy 'fp-ts/lib/*' '../build/libs/' --cwd=node_modules --parents",
     "dist": "rimraf dist && node systemjs.build.js && cpy '**/*.html' '../dist/' --cwd=build --parents && cpy 'libs/systemjs/dist/*' '../dist/' --cwd=build --parents && cpy 'systemjs.config.js' '../dist/' --cwd=build --parents",
     "serve:dev": "http-server -p 9090 build/",
     "serve:dist": "http-server -p 9091 dist/"
@@ -30,6 +30,7 @@
     "typescript": "^2.7.2"
   },
   "dependencies": {
+    "fp-ts": "^1.4.1",
     "systemjs": "^0.21.0"
   }
 }

+ 3 - 0
src/app.ts

@@ -2,6 +2,7 @@ import { ICounter } from "./common/interfaces";
 import { CommonJsCounter } from "./commonjs/module1";
 import { AmdCounter } from "./amd/module2";
 import { SystemJsCounter } from "./systemjs/module3";
+import { some } from "fp-ts/lib/Option";
 
 const testCounter = (counter: ICounter) => {
     counter.incr();
@@ -13,3 +14,5 @@ const testCounter = (counter: ICounter) => {
 testCounter(new CommonJsCounter(5));
 testCounter(new AmdCounter(10));
 testCounter(new SystemJsCounter(15));
+
+console.log(JSON.stringify(some(5).map(x => x + 1)));

+ 3 - 0
src/systemjs.config.ts

@@ -2,5 +2,8 @@ SystemJS.config({
     packages: {
         ".": {
         }
+    },
+    map: {
+        "fp-ts": "libs/fp-ts"
     }
   });

+ 1 - 1
tsconfig.json

@@ -31,7 +31,7 @@
     // "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */
     // "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */
     /* Module Resolution Options */
-    // "moduleResolution": "node",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
+    "moduleResolution": "node",               /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
     // "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */
     // "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
     // "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */