-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
158 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
{ | ||
"tasks": { | ||
"fetch": "deno run -A scripts/fetch-databases.ts", | ||
"format": "deno fmt", | ||
"fetch-data": "deno run -A scripts/fetch-databases.ts && deno fmt -q ./src/providers && deno lint" | ||
}, | ||
"fmt": { | ||
"options": { | ||
"indentWidth": 2, | ||
"lineWidth": 100, | ||
"singleQuote": false, | ||
"useTabs": false, | ||
"proseWrap": "preserve" | ||
"tasks": { | ||
"fetch": "deno run -A scripts/fetch-databases.ts", | ||
"format": "deno fmt", | ||
"lint": "deno lint ./src/", | ||
"fetch-data": "deno run -A scripts/fetch-databases.ts && deno fmt -q ./src/providers && deno lint", | ||
"npm": "deno run -A ./scripts/build-npm.ts" | ||
}, | ||
"files": { | ||
"exclude": [] | ||
"fmt": { | ||
"options": { | ||
"indentWidth": 2, | ||
"lineWidth": 100, | ||
"singleQuote": false, | ||
"useTabs": false, | ||
"proseWrap": "preserve" | ||
}, | ||
"exclude": [] | ||
}, | ||
"lint": { | ||
"rules": { | ||
"include": [ | ||
"ban-untagged-todo", | ||
"explicit-function-return-type" | ||
] | ||
}, | ||
"exclude": [ | ||
"npm/" | ||
] | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { render } from "https://deno.land/x/[email protected]/mod.ts"; | ||
export { build, emptyDir } from "https://deno.land/x/[email protected]/mod.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { SpecifierMappings } from "https://deno.land/x/[email protected]/transform.ts"; | ||
import { build, emptyDir } from "../dev_deps.ts"; | ||
import { getLatestVersion } from "./fetch-databases.ts"; | ||
|
||
const cleanupTypes = async (dir: string) => { | ||
for await (const dirEntry of Deno.readDir(dir)) { | ||
const entryPath = `${dir}/${dirEntry.name}`; | ||
if (dirEntry.isDirectory) { | ||
await cleanupTypes(entryPath); | ||
} else { | ||
const file = await Deno.readTextFile(entryPath); | ||
const newFile = file.replaceAll('.js"', '"'); | ||
await Deno.writeTextFile(entryPath, newFile); | ||
} | ||
} | ||
}; | ||
|
||
await emptyDir("./npm"); | ||
|
||
const latestVersion = await getLatestVersion(); | ||
|
||
if (!latestVersion) { | ||
console.log("Error fetching latest version, aborting"); | ||
Deno.exit(1); | ||
} | ||
|
||
const mappings: SpecifierMappings = {}; | ||
mappings[`https://deno.land/x/soda@${latestVersion}/mod.ts`] = { | ||
name: "soda-query", | ||
version: `^${latestVersion}`, | ||
}; | ||
|
||
console.log("Building npm package"); | ||
console.log(mappings); | ||
|
||
await build({ | ||
entryPoints: ["./src/mod.ts"], | ||
outDir: "./npm", | ||
mappings, | ||
declaration: "separate", | ||
skipSourceOutput: true, | ||
// scriptModule: false, | ||
shims: {}, | ||
test: false, | ||
typeCheck: false, | ||
compilerOptions: { | ||
importHelpers: true, | ||
target: "ES2021", | ||
lib: ["ESNext"], | ||
}, | ||
package: { | ||
// package.json properties | ||
name: "rdw-data", | ||
version: Deno.args[0] || "1.0.0", | ||
description: "Get RDW data from the RDW Open Data API", | ||
license: "MIT", | ||
publishConfiig: { | ||
access: "public", | ||
}, | ||
keywords: [ | ||
"soda", | ||
"socrata", | ||
"open data", | ||
"api", | ||
"rdw", | ||
"kenteken", | ||
"parking", | ||
"voertuig", | ||
"deno", | ||
"typescript", | ||
], | ||
author: { | ||
name: "J.W. Lagendijk", | ||
email: "[email protected]", | ||
}, | ||
repository: { | ||
type: "git", | ||
url: "git+https://github.com/j3lte/rdw-data.git", | ||
}, | ||
bugs: { | ||
url: "https://github.com/j3lte/rdw-data/issues", | ||
}, | ||
}, | ||
async postBuild(): Promise<void> { | ||
// steps to run after building and before running the tests | ||
await Deno.copyFile("./LICENSE", "npm/LICENSE"); | ||
await Deno.copyFile("./README.md", "npm/README.md"); | ||
await cleanupTypes("./npm/types"); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ export { | |
Where, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
|
||
|
||
export * as AsGegevensEegUitvoering from "./AsGegevensEegUitvoering.ts"; | ||
export * as BasisgegevensEegUitvoering from "./BasisgegevensEegUitvoering.ts"; | ||
export * as BrandstoffenOpPc4 from "./BrandstoffenOpPc4.ts"; | ||
|