Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tsconfig/bases
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b02260d1a0e4228dc659c7294789e73afa02f43b
Choose a base ref
...
head repository: tsconfig/bases
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: be6b3bb160889347b8614e8d18e1e88c40f8ecc9
Choose a head ref
  • 9 commits
  • 3 files changed
  • 2 contributors

Commits on Mar 25, 2024

  1. Drop display field

    yinm committed Mar 25, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    7fa77da View commit details
  2. Copy the full SHA
    caec0fe View commit details
  3. Fix error that 'readLines' does not exist

    Use a version that is same version at `deploy-changed-npm-packages.ts`
    yinm committed Mar 25, 2024
    Copy the full SHA
    a4353d8 View commit details
  4. deno run --allow-read --allow-run --allow-env --allow-write --allow-n…

    …et scripts/generate-recommend.ts
    yinm committed Mar 25, 2024
    Copy the full SHA
    8264879 View commit details
  5. Copy the full SHA
    2b4aacf View commit details
  6. deno run --allow-read --allow-run --allow-env --allow-write --allow-n…

    …et scripts/generate-recommend.ts
    yinm committed Mar 25, 2024
    Copy the full SHA
    7ca1d5c View commit details

Commits on Mar 26, 2024

  1. Remove unnecessary override

    yinm committed Mar 26, 2024
    Copy the full SHA
    11277a3 View commit details
  2. deno run --allow-read --allow-run --allow-env --allow-write --allow-n…

    …et scripts/generate-recommend.ts
    yinm committed Mar 26, 2024
    Copy the full SHA
    15ede8e View commit details

Commits on Mar 27, 2024

  1. Merge pull request #258 from yinm/remove-display-field

    Drop `display` field
    orta authored Mar 27, 2024
    Copy the full SHA
    be6b3bb View commit details
Showing with 12 additions and 9 deletions.
  1. +5 −5 bases/recommended.json
  2. +4 −1 scripts/create-npm-packages.ts
  3. +3 −3 scripts/generate-recommend.ts
10 changes: 5 additions & 5 deletions bases/recommended.json
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
},
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Recommended"
"display": "Recommended",
"$schema": "https://json.schemastore.org/tsconfig"
}
5 changes: 4 additions & 1 deletion scripts/create-npm-packages.ts
Original file line number Diff line number Diff line change
@@ -26,6 +26,9 @@ for await (const tsconfigEntry of Deno.readDir("bases")) {
const tsconfigText = await Deno.readTextFile(newPackageTSConfigPath)
const tsconfigJSON = JSON.parse(stripJsonComments(tsconfigText))

// Drop `display` field in tsconfig.json for npm package
await Deno.writeTextFile(newPackageTSConfigPath, tsconfigText.replace(/\s*"display.*/,''))

// Edit the package.json
const packageText = await Deno.readTextFile(path.join(packagePath, "package.json"))
const packageJSON = JSON.parse(packageText)
@@ -44,7 +47,7 @@ for await (const tsconfigEntry of Deno.readDir("bases")) {
let packageText = await Deno.readTextFile(fileToEdit)
packageText = packageText.replace(/\[filename\]/g, name)
.replace(/\[display_title\]/g, title)
.replace(/\[tsconfig\]/g, Deno.readTextFileSync(tsconfigFilePath))
.replace(/\[tsconfig\]/g, Deno.readTextFileSync(newPackageTSConfigPath))

// Inject readme-extra if any
try {
6 changes: 3 additions & 3 deletions scripts/generate-recommend.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import stripJsonComments from "https://esm.sh/strip-json-comments";
import * as bufio from "https://deno.land/std/io/buffer.ts";
import * as bufio from "https://deno.land/std@0.164.0/io/buffer.ts";
import * as path from "https://deno.land/std/path/mod.ts";

const tsconfigStorage = await Deno.makeTempDir({ prefix: "tsconfig" });
@@ -14,9 +14,9 @@ let packageText = await Deno.readTextFile(path.join(tsconfigStorage, "tsconfig.j
// This will strip comments
const parsed = JSON.parse(stripJsonComments(packageText));

parsed["$schema"] = "https://json.schemastore.org/tsconfig";
// `display` field will be dropped at generating npm package, so prevent the order from being last in the JSON file
parsed.display = "Recommended";
parsed.compilerOptions.target = "ES2015";
parsed["$schema"] = "https://json.schemastore.org/tsconfig";

const result = JSON.stringify(parsed, null, " ");