Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update season-1 branch #260

Closed
wants to merge 57 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
85a8f42
fix depositType (#189)
justjavac Dec 7, 2020
861f38f
Update Creep.build (#186)
justjavac Dec 7, 2020
d798c56
Misc. updates, prep for 3.2.2
pyrodogg Feb 27, 2021
dbcabfb
Update changelog, 3.2.2 prep
pyrodogg Feb 27, 2021
fea3f44
Version 3.2.2
pyrodogg Mar 14, 2021
74ca8c8
Changelog 3.2.2
pyrodogg Mar 14, 2021
3fe9e23
Add support for type predicates (#199)
IotaBlack Aug 4, 2021
b267448
Fix typo in docstring (#198)
dbgb Aug 4, 2021
6c7569f
Prepare changelog, prep 3.2.3
pyrodogg Aug 9, 2021
ea97839
Add explicit `undefined` for optional properties
pyrodogg Aug 9, 2021
8f992a2
Fixing function documentation. 10k per pixel (#200)
DollarAkshay Aug 10, 2021
7f0b1e3
Recompile after merging #200
pyrodogg Aug 10, 2021
eeaafd6
Game.GetObjectById support for union of Id's (#201)
IotaBlack Aug 18, 2021
ee19994
Release 3.2.4
pyrodogg Aug 21, 2021
9fc0a79
Fix links in changelog
pyrodogg Aug 21, 2021
b2b476c
mineral: make ticksToRegeneration optional (#204)
matheusvellone Oct 25, 2021
a8f68e6
An unpowered factory has undefined for level (#205)
f4hy Mar 27, 2022
a6c047e
Update changelog #204,#205
pyrodogg Mar 27, 2022
172fbcb
Stricter Id type (#207)
Jomik Apr 10, 2022
e630ac7
Add #207 to changelog
pyrodogg Apr 10, 2022
a1ed661
Update TypeScript version to 4.6
pyrodogg Apr 16, 2022
9e928fa
Additional Prettier fixes
pyrodogg Apr 16, 2022
a776b21
Finish updating Husky
pyrodogg Apr 16, 2022
2b10396
Update version 3.3.0
pyrodogg Apr 18, 2022
06ab538
update with a map of concrete structures (#209)
Jomik May 16, 2022
926712d
Update package version in package-lock.json
pyrodogg May 16, 2022
1ef2196
Game.structures contains only the structures owned by the player (#211)
madrang Jul 7, 2022
696f777
Added missing MARKET_FEE (#213)
madrang Jul 7, 2022
c6b3abf
Small changes to allow easier reuse of Commodities types (#212)
madrang Jul 7, 2022
ae85cfd
Update changelog
pyrodogg Jul 7, 2022
916d00b
Add type inference for params in filter callbacks (#221)
DiamondMofeng Feb 12, 2023
6ac75a9
Changed `LOOK_STRUCTURES` return type (#217)
rougeayrn Feb 12, 2023
3969653
An instance of CostMatrix cannot be used with new. (#214)
madrang Feb 12, 2023
57e7178
Recompile and update changelog
pyrodogg Feb 12, 2023
c09486e
Setup CI using github action (#232)
DiamondMofeng Feb 26, 2023
56b7cd2
Update changelog and add Mofeng to maintainers (#228)
DiamondMofeng Feb 26, 2023
87f2086
Chore: MarkoSulamagi resigns from DT side maintainers (#239)
DiamondMofeng Apr 3, 2023
1c78130
Mark Spawning.directions as optional (#244)
tiennou Aug 16, 2023
8c974bf
Refactor: Decoupling `FilterOption` and `FindConstant` and Improve `F…
DiamondMofeng Aug 21, 2023
4c6dc6d
Docs: update changelog
DiamondMofeng Aug 21, 2023
71265a9
Fix: Room.getEventLog() may return string (#245)
WyattSL Sep 13, 2023
bd7e6fc
Fix: Unlimited stores have no notion of free capacity (#208)
arsdragonfly Sep 13, 2023
ae52290
Chore: Bump minimatch from 3.0.4 to 3.1.2 (#233)
dependabot[bot] Sep 13, 2023
2f426c0
Fix: `RoomObject.effects` can be undefined
DiamondMofeng Sep 15, 2023
1e39c4f
Fix: Update invader core-related constants to their actual values (#249)
tiennou Dec 2, 2023
9d727de
feat: add RoomTerrain.getRawBuffer() (#247)
admon84 Dec 2, 2023
12cfd11
Fix #252: lookForAtArea matrix result type. (#253)
zyzyzyryxy Jan 6, 2024
8957b7b
Feat: Setting the Order type to ORDER_BUY | ORDER_SELL instead of str…
DollarAkshay Feb 3, 2024
1911145
Game.map.describeExits returns null for non-existent rooms (#250)
tiennou Feb 3, 2024
79884ad
Update Game.market.deal documentation (#256)
MatthewGlancy Mar 31, 2024
5a93dc1
Fix a transferEnergy type error where it suggested a creep. (#258)
InfinityDevTech Jul 17, 2024
89807e5
Update dependencies, replace tslint with eslint, migrate to pnpm (#259)
DiamondMofeng Jul 20, 2024
cac3c75
Update changelog.
DiamondMofeng Jul 20, 2024
3c1b1b2
Adapt to new DefinitelyTyped layout
DiamondMofeng Jul 20, 2024
199337c
Merge branch 'master' into season-1
admon84 Aug 11, 2024
28d8a8c
remove outdated package-lock
admon84 Aug 11, 2024
5c03fbf
update pnpm-lock
admon84 Aug 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
- [ ] Test passed
- [ ] Coding style (indentation, etc)
- [ ] Edits have been made to `src/` files not `index.d.ts`
- [ ] Run `npm run dtslint` to update `index.d.ts`
- [ ] Run `npm run compile` to update `index.d.ts`
34 changes: 34 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
pull_request:
push:
branches: ["master"]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install dependencies
run: pnpm i

- name: Lint
run: pnpm lint
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
npm run pre-commit

2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ node_modules/
.editorconfig
.gitattributes
tsconfig.json
tslint.json
eslint.config.*

src/
dist/screeps.ts
Expand Down
6 changes: 0 additions & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
"trailingComma": "none"
}
},
{
"files": ".travis.yml",
"options": {
"tabWidth": 2
}
},
{
"files": "*.md",
"options": {
Expand Down
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"recommendations": ["ms-vscode.vscode-typescript-tslint-plugin", "EditorConfig.EditorConfig", "esbenp.prettier-vscode"]
"recommendations": [
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.rulers": [140],
Expand Down
93 changes: 92 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,93 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- Add type inference for params in filter callbacks ([#221](https://github.com/screepers/typed-screeps/pull/221))
- Add missing `MARKET_FEE` constant ([#213](https://github.com/screepers/typed-screeps/pull/213))
- Add `CommodityTypes` type and `CommidityEntry` interface ([#212](https://github.com/screepers/typed-screeps/pull/212))
- Add RoomTerrain.getRawBuffer() ([#247](https://github.com/screepers/typed-screeps/pull/247))
- Feat: Setting the Order type to ORDER_BUY | ORDER_SELL instead of string ([#255](https://github.com/screepers/typed-screeps/pull/255))

### Updated

- Update `PathFinder.CostMatrix` to be `CostMatrixConstructor` to separate static methods from `CostMatrix`. ([#214](https://github.com/screepers/typed-screeps/pull/214))
- Update `LOOK_STRUCTURES` return type to `AnyStructure` ([#217](https://github.com/screepers/typed-screeps/pull/217))
- Update `Game.structures` type to `OwnedStructure` ([#211](https://github.com/screepers/typed-screeps/pull/211))
- Refactor: Decoupling `FilterOption` and `FindConstant` and improve `FilterOption` ([#238](https://github.com/screepers/typed-screeps/pull/238))
- Fix: Mark `Spawning.directions` as optional ([#244](https://github.com/screepers/typed-screeps/pull/244))
- Fix: Unlimited stores have no notion of free capacity ([#208](https://github.com/screepers/typed-screeps/pull/208))
- Fix: `Room.getEventLog()` may return string ([#245](https://github.com/screepers/typed-screeps/pull/245))
- FIx: Mark `RoomObject.effects` as optional
- Fix: Update invader core-related constants to their actual values ([#249](https://github.com/screepers/typed-screeps/pull/249))
- Game.map.describeExits returns null for non-existent rooms ([#250](https://github.com/screepers/typed-screeps/pull/250))
- Fix: lookForAtArea matrix result type. ([#253](https://github.com/screepers/typed-screeps/pull/253))
- Update Game.market.deal documentation ([#256](https://github.com/screepers/typed-screeps/pull/256))
- Fix a transferEnergy type error where it suggested a creep. ([#258](https://github.com/screepers/typed-screeps/pull/258))

### Removed

- Removes deprecated `Game.getObjectById(id: string)` function. Use version with `Id<T>` typed ids. ([#207](https://github.com/screepers/typed-screeps/pull/207))

## 3.3.2 to 3.3.8

These versions were pushed by DefinitelyTyped maintainers, has no effect on type definitions

- MarkoSulamagi resigns from DT side maintainers

## [3.3.1] - 2023-02-16

### Updated

- Update `ConcreteStructure` syntax to use map instead of conditional chain ([#209](https://github.com/screepers/typed-screeps/pull/209))

### Fixed

- Fix: brings removed `Game.getObjectById(id: string)` back to avoid breaking changes. ([#226](https://github.com/screepers/typed-screeps/pull/226))

## [3.3.0] - 2022-04-18

### Updated

- Updates `ticksToRegeneration` to be optional in `Minerals` ([#204](https://github.com/screepers/typed-screeps/pull/204))
- Updates `level` to be optional in `StructureFactory` ([#205](https://github.com/screepers/typed-screeps/pull/205))
- Updates `Id` type to only be used on types with an `id` property ([#207](https://github.com/screepers/typed-screeps/pull/207))

### Removed

- Removes deprecated `Game.getObjectById(id: string)` function. Use version with `Id<T>` typed ids. ([#207](https://github.com/screepers/typed-screeps/pull/207))

## [3.2.4] - 2021-08-21

### Added

- Add `Game.GetObjectById` support for union of Id's ([#201](https://github.com/screepers/typed-screeps/pull/201))
- Add support for type predicates in `room.find` and similar functions ([#199](https://github.com/screepers/typed-screeps/pull/199))
- Add explicit `| undefined` to undefined types that may exist with an undefined value.

### Fixed

- Fix typo in docstring in `Flag` interface ([#198](https://github.com/screepers/typed-screeps/pull/198))
- Fix function documentation. 10k per pixel ([#200](https://github.com/screepers/typed-screeps/pull/200))

## 3.2.3

This version was pushed by DefinitelyTyped maintainers, not present in this repository.

## [3.2.2] - 2021-03-14

### Added

- Added `StructureInvaderCore.Spawning` ([d798c56](https://github.com/screepers/typed-screeps/commit/d798c56f2724c21910b5b66e06a9b129e98020a7))

### Updated

- Updated `PIXEL_CPU_COST` constant to 10000 ([d798c56](https://github.com/screepers/typed-screeps/commit/d798c56f2724c21910b5b66e06a9b129e98020a7))
- MarketResourceConstant as argument for Game.market.getHistory ([#184](https://github.com/screepers/typed-screeps/pull/184))
- Updated `Deposit.depositType` documentation ([#189](https://github.com/screepers/typed-screeps/pull/189))
- Updated `Creep.build` documentation ([#186](https://github.com/screepers/typed-screeps/pull/186))
- Adds `import` and `export` to `RoomVisual` and `MapVisual` ([#181](https://github.com/screepers/typed-screeps/pull/181))

## [3.2.1] - 2020-09-24

### Added
Expand Down Expand Up @@ -324,7 +411,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Initial public `npm` release.

[unreleased]: https://github.com/screepers/typed-screeps/compare/v3.2.1...HEAD
[unreleased]: https://github.com/screepers/typed-screeps/compare/v3.3.1...HEAD
[3.3.1]: https://github.com/screepers/typed-screeps/compare/v3.3.0...v3.3.1
[3.3.0]: https://github.com/screepers/typed-screeps/compare/v3.2.4...v3.3.0
[3.2.4]: https://github.com/screepers/typed-screeps/compare/v3.2.2...v3.2.4
[3.2.2]: https://github.com/screepers/typed-screeps/compare/v3.2.1...v3.2.2
[3.2.1]: https://github.com/screepers/typed-screeps/compare/v3.2.0...v3.2.1
[3.2.0]: https://github.com/screepers/typed-screeps/compare/v3.1.3...v3.2.0
[3.1.3]: https://github.com/screepers/typed-screeps/compare/v3.1.2...v3.1.3
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# typed-screeps

> Strong TypeScript declarations for the game Screeps.
> Strong TypeScript declarations for the game Screeps: World.

[![Travis](https://img.shields.io/travis/screepers/typed-screeps.svg)](https://travis-ci.org/screepers/typed-screeps) [![npm](https://img.shields.io/npm/v/@types/screeps)](https://www.npmjs.com/package/@types/screeps)
[![Github action](https://github.com/screepers/typed-screeps/actions/workflows/CI.yml/badge.svg)](https://github.com/screepers/typed-screeps/actions/workflows/CI.yml) [![npm](https://img.shields.io/npm/v/@types/screeps)](https://www.npmjs.com/package/@types/screeps)

## Installation

Expand All @@ -14,6 +14,9 @@ npm install @types/screeps

# yarn
yarn add @types/screeps

# pnpm
pnpm add @types/screeps
```

## Differences from **[Screeps-Typescript-Declarations](https://github.com/screepers/Screeps-Typescript-Declarations)**
Expand Down
19 changes: 11 additions & 8 deletions build/concat.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
const concat = require("concat-files");
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);
});

concat(files, path.join(__dirname, "..", "dist", "index.d.ts"), function(err) {
if (err) {
console.dir(err);
}
});
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.

8 changes: 8 additions & 0 deletions dist/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rules": {
"@definitelytyped/no-any-union": "off",
"@definitelytyped/no-unnecessary-generics": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-misused-new": "off"
}
}
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
Loading
Loading