Skip to content

Commit

Permalink
chore: various updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Oct 19, 2021
1 parent 3c662cc commit d1433f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: npm build
run: deno run --allow-read --allow-write=./npm --allow-net --allow-run --no-check ./scripts/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
run: deno run -A --no-check ./scripts/build_npm.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
- name: npm publish
if: startsWith(github.ref, 'refs/tags/')
env:
Expand Down
14 changes: 6 additions & 8 deletions mod_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { createFromBuffer, createStreaming, Formatter, GlobalConfiguration } fro

Deno.test("it should create streaming", async () => {
const formatter = await createStreaming(
fetch("https://plugins.dprint.dev/json-0.12.0.wasm"),
fetch("https://plugins.dprint.dev/json-0.13.0.wasm"),
);
runGeneralJsonFormatterTests(formatter);
});

Deno.test("it should create from buffer", async () => {
const buffer = await fetch("https://plugins.dprint.dev/json-0.12.0.wasm")
const buffer = await fetch("https://plugins.dprint.dev/json-0.13.0.wasm")
.then((r) => r.arrayBuffer());
const formatter = createFromBuffer(buffer);
runGeneralJsonFormatterTests(formatter);
Expand All @@ -27,23 +27,21 @@ function runGeneralJsonFormatterTests(formatter: Formatter) {
assertEquals(formatter.getLicenseText().includes("MIT"), true);
assertEquals(formatter.getPluginInfo(), {
name: "dprint-plugin-json",
version: "0.12.0",
version: "0.13.0",
configKey: "json",
fileExtensions: ["json", "jsonc"],
fileNames: [],
helpUrl: "https://dprint.dev/plugins/json",
configSchemaUrl: "",
configSchemaUrl: "https://plugins.dprint.dev/schemas/json-0.13.0.json",
});
assertEquals(formatter.getResolvedConfig(), {
// todo(dsherret): this is incorrect in the plugin (should be "array.preferSingleLine")
arrayPreferSingleLine: true,
"array.preferSingleLine": true,
"commentLine.forceSpaceAfterSlashes": true,
ignoreNodeCommentText: "dprint-ignore",
indentWidth: 4,
lineWidth: 30,
newLineKind: "lf",
// todo(dsherret): this is incorrect in the plugin
objectPreferSingleLine: true,
"object.preferSingleLine": true,
useTabs: false,
});
assertEquals(
Expand Down
7 changes: 4 additions & 3 deletions scripts/build_npm.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { build } from "https://deno.land/x/[email protected].9/mod.ts";
import { build } from "https://deno.land/x/[email protected].11/mod.ts";

await build({
entryPoint: "mod.ts",
entryPoints: ["mod.ts"],
typeCheck: true,
test: false,
outDir: "./npm",
package: {
name: "@dprint/formatter",
version: Deno.args[0] ?? "0.0.0",
version: Deno.args[0],
description: "Wasm formatter for dprint plugins.",
repository: {
type: "git",
Expand Down

0 comments on commit d1433f8

Please sign in to comment.