Browse Source

build: add build_npm script

tags/v0.10.0
Muthu Kumar 2 years ago
parent
commit
e85077acc4
Failed to extract signature
  1. 2
      .gitignore
  2. 26
      build_npm.ts
  3. 30
      package.json.old
  4. 2
      test.ts

2
.gitignore

@ -1 +1 @@
node_modules
npm

26
build_npm.ts

@ -0,0 +1,26 @@
// ex. scripts/build_npm.ts
import { build, emptyDir } from "https://deno.land/x/dnt@0.33.1/mod.ts";
await emptyDir("./npm");
await build({
entryPoints: ["./index.ts"],
outDir: "./npm",
shims: { deno: { test: true } },
package: {
name: "promise.object",
version: Deno.args[0],
description: "Deep resolve promises in objects.",
keywords: ["Promise", "A+", "objects", "deep resolve"],
author: "Muthu Kumar <@MKRhere> (https://mkr.pw)",
contributors: ["Thomas Rory Gummerson <@TRGWII> (https://rory.no)"],
repository: { type: "git", url: "git+https://github.com/codefeathers/Promise.object.git" },
bugs: { url: "https://github.com/codefeathers/Promise.object/issues" },
homepage: "https://github.com/codefeathers/Promise.object#readme",
license: "MIT",
},
});
// post build steps
Deno.copyFileSync("LICENSE", "npm/LICENSE");
Deno.copyFileSync("README.md", "npm/README.md");

30
package.json.old

@ -1,30 +0,0 @@
{
"name": "@codefeathers/promise.object",
"version": "0.9.5",
"description": "Deep resolve promises in objects.",
"main": "es5/index.min.js",
"scripts": {
"test": "jasmine",
"build": "./build.sh"
},
"keywords": [
"Promise",
"A+",
"objects",
"deep resolve"
],
"author": "Muthu Kumar <@MKRhere> (https://mkr.pw)",
"contributors": [
"Thomas Rory Gummerson <@TRGWII> (https://rory.no)"
],
"repository": {
"type": "git",
"url": "git+https://github.com/codefeathers/Promise.object.git"
},
"bugs": {
"url": "https://github.com/codefeathers/Promise.object/issues"
},
"homepage": "https://github.com/codefeathers/Promise.object#readme",
"license": "MIT",
"devDependencies": {}
}

2
test.ts

@ -43,6 +43,6 @@ Deno.test("Should resolve cyclic objects", async () => {
assertEquals(await promiseObject(nested.test), nested.resolved);
});
Deno.test("Should resolve deeply cyclic objects", async () => {
Deno.test("Should resolve deeply cyclic promises", async () => {
assertEquals(await promiseObject(deeplyNested.test), deeplyNested.resolved);
});

Loading…
Cancel
Save