Skip to content

Commit

Permalink
Adapt to new DefinitelyTyped layout
Browse files Browse the repository at this point in the history
* No longer needed to prepend header and descriptions
  • Loading branch information
DiamondMofeng committed Aug 3, 2024
1 parent cac3c75 commit 3c1b1b2
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 73 deletions.
20 changes: 11 additions & 9 deletions build/concat.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
const fs = require("fs");
const path = require("path");

fs.readdir(path.join(__dirname, "..", "src"), function(err, files) {
files = files.map(function(value) {
fs.readdir(path.join(__dirname, "..", "src"), function (err, files) {
files = files.map(function (value) {
return path.join("src", value);
});

Promise.all(files.map((name)=>fs.promises.readFile(name))).then(
(fileContents)=>{
fs.writeFileSync(path.join(__dirname, "..", "dist", "index.d.ts"),
Buffer.concat(fileContents));
}, (reason)=>{
console.log(reason);
});
Promise.all(files.map((name) => fs.promises.readFile(name)))
.then((fileContents) => {
fs.writeFileSync(
path.join(__dirname, "..", "dist", "index.d.ts"),
Buffer.concat(fileContents)
);
}, (reason) => {
console.log(reason);
});
});
13 changes: 0 additions & 13 deletions build/header.txt

This file was deleted.

18 changes: 0 additions & 18 deletions build/prependDescription.js

This file was deleted.

12 changes: 0 additions & 12 deletions build/prependHeader.js

This file was deleted.

5 changes: 5 additions & 0 deletions dist/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!**/*.d.ts
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
15 changes: 0 additions & 15 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
// Type definitions for Screeps 3.3.3
// Project: https://github.com/screeps/screeps
// Definitions by: Nhan Ho <https://github.com/NhanHo>
// Bryan <https://github.com/bryanbecker>
// Resi Respati <https://github.com/resir014>
// Adam Laycock <https://github.com/Arcath>
// Dominic Marcuse <https://github.com/dmarcuse>
// Skyler Kehren <https://github.com/pyrodogg>
// Kieran Carnegie <https://github.com/kotarou>
// Mofeng <https://github.com/DiamondMofeng>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 5.5

// Please contribute types to https://github.com/screepers/typed-screeps

// Game Constants

declare const OK: OK;
Expand Down
45 changes: 45 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"private": true,
"name": "@types/screeps",
"version": "3.3.9999",
"projects": [
"https://github.com/screeps/screeps"
],
"devDependencies": {
"@types/screeps": "workspace:."
},
"owners": [
{
"name": "Nhan Ho",
"githubUsername": "NhanHo"
},
{
"name": "Bryan",
"githubUsername": "bryanbecker"
},
{
"name": "Resi Respati",
"githubUsername": "resir014"
},
{
"name": "Adam Laycock",
"githubUsername": "Arcath"
},
{
"name": "Dominic Marcuse",
"githubUsername": "dmarcuse"
},
{
"name": "Skyler Kehren",
"githubUsername": "pyrodogg"
},
{
"name": "Kieran Carnegie",
"githubUsername": "kotarou"
},
{
"name": "Mofeng",
"githubUsername": "DiamondMofeng"
}
]
}
4 changes: 0 additions & 4 deletions dist/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dist/index.d.ts"
],
"scripts": {
"compile": "node ./build/concat.js && node ./build/prependHeader.js && node ./build/prependDescription.js",
"compile": "node ./build/concat.js",
"format": "npm run format:build && npm run format:src",
"format:build": "prettier --write 'build/**/*.js'",
"format:src": "prettier --write 'src/**/*.ts'",
Expand All @@ -31,7 +31,6 @@
"eslint-plugin-expect-type": "^0.4.0",
"husky": "^7.0.4",
"lint-staged": "^12.3.8",
"prepend": "^1.0.2",
"prettier": "^2.6.2",
"typescript": "^5.5.0",
"typescript-eslint": "^7.16.1"
Expand Down

0 comments on commit 3c1b1b2

Please sign in to comment.