repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
0b71265
parent
234f865
author
Eric Bower
date
2023-05-21 19:49:55 +0000 UTC
chore: npm build tweaks
2 files changed,  +83, -97
M npm.ts
M README.md
+1, -2
1@@ -15,5 +15,4 @@ Supercharged async flow control library.
2 
3 ## usage
4 
5-Please see [examples/basic](./examples/basic) and [tests](./test) to understand
6-how it works.
7+Please see [examples repo](https://github.com/neurosnap/starfx-examples).
M npm.ts
+82, -95
  1@@ -1,105 +1,92 @@
  2 import { assert, build, emptyDir } from "./test.ts";
  3 
  4-await emptyDir("./npm");
  5+main().then(console.log).catch(console.error);
  6 
  7-const version = Deno.env.get("NPM_VERSION");
  8-assert(version, "NPM_VERSION is required to build npm package");
  9+async function main() {
 10+  await emptyDir("./npm");
 11 
 12-await build({
 13-  entryPoints: [{
 14-    name: ".",
 15-    path: "index.ts",
 16-  }, {
 17-    name: "./react",
 18-    path: "react.ts",
 19-  }, {
 20-    name: "./redux",
 21-    path: "redux/index.ts",
 22-  }, {
 23-    name: "./query",
 24-    path: "./query/index.ts",
 25-  }],
 26-  mappings: {
 27-    "https://deno.land/x/effection@3.0.0-alpha.7/mod.ts": {
 28-      name: "effection",
 29-      version: "3.0.0-alpha.7",
 30-    },
 31-    "https://esm.sh/react@18.2.0": {
 32-      name: "react",
 33-      version: "^18.2.0",
 34-      peerDependency: true,
 35-    },
 36-    "https://esm.sh/robodux@15.0.1?pin=v122": {
 37-      name: "robodux",
 38-      version: "^15.0.1",
 39-    },
 40-    "https://esm.sh/@reduxjs/toolkit@1.9.5?pin=v122": {
 41-      name: "@reduxjs/toolkit",
 42-      version: "^1.9.5",
 43+  const version = Deno.env.get("NPM_VERSION");
 44+  assert(version, "NPM_VERSION is required to build npm package");
 45+
 46+  await build({
 47+    entryPoints: [
 48+      {
 49+        name: ".",
 50+        path: "index.ts",
 51+      },
 52+      {
 53+        name: "./react",
 54+        path: "react.ts",
 55+      },
 56+      {
 57+        name: "./redux",
 58+        path: "redux/index.ts",
 59+      },
 60+      {
 61+        name: "./query",
 62+        path: "./query/index.ts",
 63+      },
 64+    ],
 65+    mappings: {
 66+      "https://deno.land/x/effection@3.0.0-alpha.7/mod.ts": {
 67+        name: "effection",
 68+        version: "3.0.0-alpha.7",
 69+      },
 70+      "https://esm.sh/react@18.2.0": {
 71+        name: "react",
 72+        version: "^18.2.0",
 73+        peerDependency: true,
 74+      },
 75+      "https://esm.sh/robodux@15.0.1?pin=v122": {
 76+        name: "robodux",
 77+        version: "^15.0.1",
 78+      },
 79+      "https://esm.sh/@reduxjs/toolkit@1.9.5?pin=v122": {
 80+        name: "@reduxjs/toolkit",
 81+        version: "^1.9.5",
 82+      },
 83+      "https://esm.sh/redux-batched-actions@0.5.0?pin=v122": {
 84+        name: "redux-batched-actions",
 85+        version: "^0.5.0",
 86+      },
 87+      "https://esm.sh/react-redux@8.0.5?pin=v122": {
 88+        name: "react-redux",
 89+        version: "^8.0.5",
 90+        peerDependency: true,
 91+      },
 92     },
 93-    "https://esm.sh/redux-batched-actions@0.5.0?pin=v122": {
 94-      name: "redux-batched-actions",
 95-      version: "^0.5.0",
 96+    outDir: "./npm",
 97+    shims: {
 98+      deno: false,
 99     },
100-    "https://esm.sh/react-redux@8.0.5?pin=v122": {
101-      name: "react-redux",
102-      version: "^8.0.5",
103+    test: false,
104+    typeCheck: true,
105+    compilerOptions: {
106+      target: "ES2020",
107+      sourceMap: true,
108+      lib: ["dom", "dom.iterable", "esnext"],
109     },
110-  },
111-  outDir: "./npm",
112-  shims: {
113-    deno: false,
114-    custom: [{
115-      package: {
116-        name: "node-fetch",
117-        version: "~3.3.1",
118+    package: {
119+      name: "starfx",
120+      version,
121+      description: "Supercharged async flow control library",
122+      license: "MIT",
123+      repository: {
124+        author: "me@erock.io",
125+        type: "git",
126+        url: "git+https://github.com/neurosnap/starfx.git",
127       },
128-      globalNames: [{
129-        name: "RequestInit",
130-        typeOnly: true,
131-      }, {
132-        name: "HeadersInit",
133-        typeOnly: true,
134-      }, {
135-        name: "URL",
136-        typeOnly: true,
137-      }, {
138-        name: "Response",
139-        typeOnly: true,
140-      }, {
141-        name: "Request",
142-        typeOnly: true,
143-      }],
144-    }],
145-  },
146-  test: false,
147-  typeCheck: false,
148-  compilerOptions: {
149-    target: "ES2020",
150-    sourceMap: true,
151-  },
152-  package: {
153-    name: "starfx",
154-    version,
155-    description: "Supercharged async flow control library",
156-    license: "MIT",
157-    repository: {
158-      author: "me@erock.io",
159-      type: "git",
160-      url: "git+https://github.com/neurosnap/starfx.git",
161-    },
162-    bugs: {
163-      url: "https://github.com/neurosnap/starfx/issues",
164+      bugs: {
165+        url: "https://github.com/neurosnap/starfx/issues",
166+      },
167+      engines: {
168+        node: ">= 18",
169+      },
170+      sideEffects: false,
171     },
172-    engines: {
173-      node: ">= 18",
174+    postBuild() {
175+      Deno.copyFileSync("LICENSE.md", "npm/LICENSE.md");
176+      Deno.copyFileSync("README.md", "npm/README.md");
177     },
178-    sideEffects: false,
179-  },
180-  postBuild() {
181-    Deno.copyFileSync("LICENSE.md", "npm/LICENSE.md");
182-    Deno.copyFileSync("README.md", "npm/README.md");
183-  },
184-});
185-
186-await Deno.copyFile("README.md", "npm/README.md");
187+  });
188+}