Skip to content

Commit

Permalink
bump deps and set importsNotUsedAsValues
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Jul 24, 2021
1 parent 3bec16f commit a618a56
Show file tree
Hide file tree
Showing 33 changed files with 101 additions and 94 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: mymindstorm/setup-emsdk@v7
- uses: mymindstorm/setup-emsdk@v10
with:
version: '2.0.12'
version: '2.0.24'
actions-cache-folder: 'emsdk-cache'
- uses: actions/setup-node@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
"dtsRollup": {
"enabled": true,

"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts"
"untrimmedFilePath": "",

// "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",

// "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts",
"publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts"

// "omitTrimmingComments": true
},
Expand Down
4 changes: 4 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env node

if (process.env.NODE) {
process.env.EM_NODE_JS = process.env.NODE
}

const fs = require('fs')
const path = require('path')
const { spawn } = require('@tybys/cgen/bin/util/spawn.js')
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tybys/wz",
"version": "1.3.0",
"version": "1.4.0",
"description": "MapleStory wz reader.",
"typings": "./lib/cjs-modern/index.d.ts",
"module": "./lib/esm-modern/index.js",
Expand Down Expand Up @@ -37,25 +37,24 @@
"access": "public"
},
"devDependencies": {
"@tybys/cgen": "^0.5.4",
"@tybys/tsgo": "^0.9.1",
"@tybys/cgen": "^0.7.1",
"@tybys/tsgo": "^0.12.0",
"@types/crypto-js": "^4.0.1",
"@types/node": "^14.14.28",
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1",
"@typescript-eslint/eslint-plugin": "^4.28.4",
"@typescript-eslint/parser": "^4.28.4",
"copy-webpack-plugin": "^6.3.2",
"eslint": "^7.20.0",
"eslint-config-standard-with-typescript": "^19.0.1",
"eslint-plugin-import": "^2.22.1",
"eslint": "^7.31.0",
"eslint-config-standard-with-typescript": "^20.0.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^5.0.0",
"typescript": "4.1.3",
"eslint-plugin-promise": "^5.1.0",
"typescript": "4.3.5",
"webpack": "^4.46.0"
},
"dependencies": {
"@tybys/binreader": "^0.1.7",
"@tybys/native-require": "^3.0.1",
"@tybys/binreader": "^0.3.0",
"@tybys/native-require": "^3.0.3",
"jimp": "^0.16.1"
}
}
2 changes: 1 addition & 1 deletion src/IPropertyContainer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WzImageProperty } from './WzImageProperty'
import type { WzImageProperty } from './WzImageProperty'

/**
* @public
Expand Down
13 changes: 8 additions & 5 deletions src/WzDirectory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WzBinaryReader } from './util/WzBinaryReader'
import { WzFile } from './WzFile'
import type { WzBinaryReader } from './util/WzBinaryReader'
import type { WzFile } from './WzFile'
import { WzImage } from './WzImage'
import { WzObject } from './WzObject'
import { WzObjectType } from './WzObjectType'
Expand Down Expand Up @@ -176,9 +176,9 @@ export class WzDirectory extends WzObject {
for (let i = 0; i < entryCount; i++) {
let type = await reader.readUInt8()
let fname = ''
var fsize: number
var checksum: number
var offset: number
let fsize: number
let checksum: number
let offset: number
let rememberPos = 0
switch (type) {
case 1: {
Expand All @@ -204,8 +204,11 @@ export class WzDirectory extends WzObject {
default: break
}
reader.pos = rememberPos
// eslint-disable-next-line prefer-const
fsize = await reader.readWzInt()
// eslint-disable-next-line prefer-const
checksum = await reader.readWzInt()
// eslint-disable-next-line prefer-const
offset = await reader.readWzOffset()
if (type === 3) {
const subDir = new WzDirectory(reader, fname, this.hash, this.wzIv, this.wzFile)
Expand Down
12 changes: 6 additions & 6 deletions src/WzFile.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { path } from './util/node'
import { WzCanvasProperty } from './properties/WzCanvasProperty'
import { WzConvexProperty } from './properties/WzConvexProperty'
import { WzSubProperty } from './properties/WzSubProperty'
import { WzVectorProperty } from './properties/WzVectorProperty'
import type { WzCanvasProperty } from './properties/WzCanvasProperty'
import type { WzConvexProperty } from './properties/WzConvexProperty'
import type { WzSubProperty } from './properties/WzSubProperty'
import type { WzVectorProperty } from './properties/WzVectorProperty'
import { BinaryReader } from '@tybys/binreader'
import { ErrorLevel, ErrorLogger } from './util/ErrorLogger'
import { WzBinaryReader } from './util/WzBinaryReader'
import { WzKeyGenerator } from './util/WzKeyGenerator'
import { WzTool } from './util/WzTool'
import { WzDirectory } from './WzDirectory'
import { WzHeader } from './WzHeader'
import { WzImage } from './WzImage'
import { WzImageProperty } from './WzImageProperty'
import type { WzImage } from './WzImage'
import type { WzImageProperty } from './WzImageProperty'
import { WzMapleVersion } from './WzMapleVersion'
import { WzObject } from './WzObject'
import { WzObjectType } from './WzObjectType'
Expand Down
6 changes: 3 additions & 3 deletions src/WzImage.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IPropertyContainer } from './IPropertyContainer'
import type { IPropertyContainer } from './IPropertyContainer'
import { ErrorLevel, ErrorLogger } from './util/ErrorLogger'
import { WzBinaryReader } from './util/WzBinaryReader'
import { WzFile } from './WzFile'
import type { WzBinaryReader } from './util/WzBinaryReader'
import type { WzFile } from './WzFile'
import { WzImageProperty } from './WzImageProperty'
import { WzObject } from './WzObject'
import { WzObjectType } from './WzObjectType'
Expand Down
10 changes: 5 additions & 5 deletions src/WzImageProperty.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { WzExtended } from './WzExtended'
import { WzLuaProperty } from './properties/WzLuaProperty'
import type { WzExtended } from './WzExtended'
import type { WzLuaProperty } from './properties/WzLuaProperty'
import { NotImplementedError } from './util/NotImplementedError'
import { WzBinaryReader } from './util/WzBinaryReader'
import { WzFile } from './WzFile'
import type { WzBinaryReader } from './util/WzBinaryReader'
import type { WzFile } from './WzFile'
import { WzImage } from './WzImage'
import { WzObject } from './WzObject'
import { WzObjectType } from './WzObjectType'
import { WzPropertyType } from './WzPropertyType'
import type { WzPropertyType } from './WzPropertyType'

/**
* @public
Expand Down
8 changes: 4 additions & 4 deletions src/WzObject.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Canvas } from './util/Canvas'
import { IDisposable } from './util/IDisposable'
import type { Canvas } from './util/Canvas'
import type { IDisposable } from './util/IDisposable'
import { NotImplementedError } from './util/NotImplementedError'
import { WzFile } from './WzFile'
import { WzObjectType } from './WzObjectType'
import type { WzFile } from './WzFile'
import type { WzObjectType } from './WzObjectType'
import { path } from './util/node'

/**
Expand Down
4 changes: 2 additions & 2 deletions src/properties/WzBinaryProperty.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { WzBinaryReader } from '../util/WzBinaryReader'
import type { WzBinaryReader } from '../util/WzBinaryReader'
import { WzExtended } from '../WzExtended'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzPropertyType } from '../WzPropertyType'
import { fs, path } from '../util/node'

Expand Down
10 changes: 5 additions & 5 deletions src/properties/WzCanvasProperty.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzExtended } from '../WzExtended'
import { IPropertyContainer } from '../IPropertyContainer'
import type { IPropertyContainer } from '../IPropertyContainer'
import { WzImageProperty } from '../WzImageProperty'
import { WzPngProperty } from './WzPngProperty'
import { WzStringProperty } from './WzStringProperty'
import type { WzPngProperty } from './WzPngProperty'
import type { WzStringProperty } from './WzStringProperty'
import { WzImage } from '../WzImage'
import { WzDirectory } from '../WzDirectory'
import { Canvas } from '../util/Canvas'
import type { Canvas } from '../util/Canvas'

/**
* @public
Expand Down
6 changes: 3 additions & 3 deletions src/properties/WzConvexProperty.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzExtended } from '../WzExtended'
import { IPropertyContainer } from '../IPropertyContainer'
import { WzImageProperty } from '../WzImageProperty'
import type { IPropertyContainer } from '../IPropertyContainer'
import type { WzImageProperty } from '../WzImageProperty'
import { NotImplementedError } from '../util/NotImplementedError'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/properties/WzDoubleProperty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzImageProperty } from '../WzImageProperty'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/properties/WzFloatProperty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzImageProperty } from '../WzImageProperty'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/properties/WzIntProperty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzImageProperty } from '../WzImageProperty'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/properties/WzLongProperty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzImageProperty } from '../WzImageProperty'

/**
Expand Down
4 changes: 2 additions & 2 deletions src/properties/WzLuaProperty.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { WzKeyGenerator } from '../util/WzKeyGenerator'
import { WzMutableKey } from '../util/WzMutableKey'
import type { WzMutableKey } from '../util/WzMutableKey'
import { WzImageProperty } from '../WzImageProperty'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzPropertyType } from '../WzPropertyType'
import { asciiTextDecoder } from '../util/node'

Expand Down
2 changes: 1 addition & 1 deletion src/properties/WzNullProperty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { NotImplementedError } from '../util/NotImplementedError'
import { WzImageProperty } from '../WzImageProperty'

Expand Down
12 changes: 6 additions & 6 deletions src/properties/WzPngProperty.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzExtended } from '../WzExtended'
import { WzBinaryReader } from '../util/WzBinaryReader'
import type { WzBinaryReader } from '../util/WzBinaryReader'
import { BinaryReader } from '@tybys/binreader'
import { Color } from '../util/Color'
import { ErrorLevel, ErrorLogger } from '../util/ErrorLogger'
Expand Down Expand Up @@ -536,8 +536,8 @@ function inflate (data: Uint8Array, len: number): Promise<Uint8Array> {
async function inflateWasm (data: Uint8Array, len: number): Promise<Uint8Array> {
if (wasmInflate === null) {
const wzWasm = await import('../util/wz')
const mod = await wzWasm.default()
wasmInflate = mod.inflate
const { Module } = await wzWasm.default()
wasmInflate = Module.inflate
}
const buf = wasmInflate(data, len)
return buf
Expand All @@ -550,7 +550,7 @@ function rgb565ToColor (val: number): Color {
const r = (val & rgb565maskR) >> 11
const g = (val & rgb565maskG) >> 5
const b = (val & rgb565maskB)
var c = Color.fromRgb(
const c = Color.fromRgb(
(r << 3) | (r >> 2),
(g << 2) | (g >> 4),
(b << 3) | (b >> 2))
Expand Down Expand Up @@ -609,7 +609,7 @@ function argb1555ToColor (val: number): Color {
const r = (val & maskR) >> 10
const g = (val & maskG) >> 5
const b = (val & maskB)
var c = Color.fromArgb(
const c = Color.fromArgb(
a,
(r << 3) | (r >> 2),
(g << 3) | (g >> 2),
Expand Down
2 changes: 1 addition & 1 deletion src/properties/WzShortProperty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzImageProperty } from '../WzImageProperty'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/properties/WzStringProperty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzImageProperty } from '../WzImageProperty'

/**
Expand Down
6 changes: 3 additions & 3 deletions src/properties/WzSubProperty.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzExtended } from '../WzExtended'
import { IPropertyContainer } from '../IPropertyContainer'
import { WzImageProperty } from '../WzImageProperty'
import type { IPropertyContainer } from '../IPropertyContainer'
import type { WzImageProperty } from '../WzImageProperty'
import { NotImplementedError } from '../util/NotImplementedError'

/**
Expand Down
4 changes: 2 additions & 2 deletions src/properties/WzUOLProperty.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzExtended } from '../WzExtended'
import { WzImageProperty } from '../WzImageProperty'
import { WzImage } from '../WzImage'
import { WzDirectory } from '../WzDirectory'
import { ErrorLevel, ErrorLogger } from '../util/ErrorLogger'
import { Canvas } from '../util/Canvas'
import type { Canvas } from '../util/Canvas'

/**
* @public
Expand Down
2 changes: 1 addition & 1 deletion src/properties/WzVectorProperty.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WzPropertyType } from '../WzPropertyType'
import { WzObject } from '../WzObject'
import type { WzObject } from '../WzObject'
import { WzExtended } from '../WzExtended'
import { WzIntProperty } from './WzIntProperty'

Expand Down
4 changes: 2 additions & 2 deletions src/util/WzBinaryReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { WzHeader } from '../WzHeader'
import { AsyncBinaryReader } from '@tybys/binreader'
import { MapleCryptoConstants } from './MapleCryptoConstants'
import { WzKeyGenerator } from './WzKeyGenerator'
import { WzMutableKey } from './WzMutableKey'
import type { WzMutableKey } from './WzMutableKey'
import { WzTool } from './WzTool'
import { IDisposable } from './IDisposable'
import type { IDisposable } from './IDisposable'
import { asciiTextDecoder, utf16leTextDecoder } from './node'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/util/WzKeyGenerator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BinaryReader } from '@tybys/binreader'
import type { BinaryReader } from '@tybys/binreader'
import { MapleCryptoConstants } from './MapleCryptoConstants'
import { WzMutableKey } from './WzMutableKey'

Expand Down
2 changes: 1 addition & 1 deletion src/util/wz.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ declare namespace mod {
export function aesEnc (data: Uint8Array, key: Uint8Array): Uint8Array
}

declare function init (): Promise<typeof mod>
declare function init (): Promise<{ Module: typeof mod }>

export declare const inflate: typeof mod.inflate
export declare const aesEnc: typeof mod.aesEnc
Expand Down
Loading

0 comments on commit a618a56

Please sign in to comment.