Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
chore(build): fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandru committed Aug 20, 2017
1 parent 4acf973 commit 0ebad3b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"scripts": {
"lint": "flow check && tslint --type-check --project tsconfig.json -e **/node_modules/** -e **/dist/** -t codeFrame src/**/*.ts",
"prebuild": "rimraf dist",
"copy-flow": "node tools/copy-flow.js",
"copy-flow": "ts-node tools/copy-flow.ts",
"doc": "typedoc --mode modules --theme minimal --listInvalidSymbolLinks --excludeNotExported --excludePrivate --out dist/docs --target es6 --name Funfix --readme rootdoc.md src",
"build": "tsc && rollup -c && npm run doc && yarn run copy-flow",
"start": "tsc-watch --onSuccess 'rollup -c'",
Expand Down
2 changes: 1 addition & 1 deletion rootdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const email: string | null =
## Features Overview

The code is organized in ES2015 modules, but all types, classes and
functions are exported by the [root module]{@link "funfix"}.
functions are exported by the [root module]{@link "index"}.

**["core"]{@link "core/index"}** defines core
data types and universal interfaces:
Expand Down
12 changes: 6 additions & 6 deletions tools/copy-flow.js → tools/copy-flow.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env node
#!/usr/bin/env ts-node
/*
* Copyright (c) 2017 by The Funfix Project Developers.
* Some rights reserved.
Expand All @@ -16,15 +16,15 @@
* limitations under the License.
*/

const { exec } = require("shelljs")
const fs = require("fs")
const path = require("path")
import { exec } from "shelljs"
import * as fs from "fs"
import * as path from "path"

const currentDir = path.resolve(path.join(path.dirname(process.argv[1]), ".."))
const srcDir = path.join(currentDir, "src")
const destDir = path.join(currentDir, "dist")

function listDir(dir) {
function listDir(dir: string): Promise<string[]> {
return new Promise((resolve, reject) => {
fs. readdir(dir, function (err, items) {
if (err) reject(err); else {
Expand Down Expand Up @@ -62,7 +62,7 @@ async function main() {
exec(`cp -f "${file}" "${dPath}"`)
}

const pkg = JSON.parse(fs.readFileSync(path.join(currentDir, "package.json")))
const pkg = JSON.parse(fs.readFileSync(path.join(currentDir, "package.json")) as any)
exec(`cp -f "${destDir}/index.js.flow" "${currentDir}/${pkg.main}.flow"`)
}

Expand Down

0 comments on commit 0ebad3b

Please sign in to comment.