Skip to content

Commit

Permalink
rename zlibwasm to wz
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Oct 18, 2020
1 parent d7ff8af commit 5dccca1
Show file tree
Hide file tree
Showing 275 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
node_modules
/typings
/test
/zlibwasm
/wasm
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ package-lock.json
/test/lib
/test/**/*.mp3
/Sound
/src/util/zlibwasm.js
/src/util/wz.js
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ tsgo.config*
/lib/**/*.map
/examples
.github
/zlibwasm
/wasm
4 changes: 2 additions & 2 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"${default}",
"C:\\Projects\\emsdk\\upstream\\emscripten\\system\\include",
"E:\\GitHub\\emsdk\\upstream\\emscripten\\system\\include",
"${workspaceFolder}/zlibwasm/deps/zlib",
"${workspaceFolder}/zlibwasm/cmake_build/deps/zlib"
"${workspaceFolder}/wasm/deps/zlib",
"${workspaceFolder}/wasm/cmake_build/deps/zlib"
],
"clPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\Hostx64\\x64\\cl.exe",
"gccPath": "/usr/bin/gcc",
Expand Down
2 changes: 1 addition & 1 deletion build.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off

cd .\zlibwasm
cd .\wasm
call .\cmakebuild
cd ..
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ if [ "$1" == "Debug" ]; then type="$1"; fi
shift
done

cd ./zlibwasm
cd ./wasm
cmakeoutdir="./cmake_build"
mkdir -p $cmakeoutdir
cd $cmakeoutdir
cmake -DCMAKE_TOOLCHAIN_FILE="$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" -DCMAKE_BUILD_TYPE="$type" -G "Unix Makefiles" ..
cmake --build .
cd ..

exename="zlibwasm"
exename="wz"

cp -rpf "$cmakeoutdir/$exename.js" "../src/util/$exename.js"
mkdir -p ../lib/cjs-modern/util
Expand Down
2 changes: 1 addition & 1 deletion src/init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { init as initWasm } from './util/zlibwasm'
import { init as initWasm } from './util/wz'

/**
* @public
Expand Down
4 changes: 2 additions & 2 deletions src/properties/WzPngProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ErrorLevel, ErrorLogger } from '../util/ErrorLogger'
import { NotImplementedError } from '../util/NotImplementedError'
import { _Buffer, zlib } from '../util/node'
import { Canvas } from '../util/Canvas'
import * as zlibwasm from '../util/zlibwasm'
import { init } from '../util/wz'

/**
* @public
Expand Down Expand Up @@ -478,7 +478,7 @@ function inflate (data: Uint8Array, len: number): Promise<Uint8Array> {
}

async function inflateWasm (data: Uint8Array, len: number): Promise<Uint8Array> {
const mod = await zlibwasm.init()
const mod = await init()
const buf = mod.inflate(data, len)
return buf
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { tryGetRequireFunction } from '@tybys/native-require'
import { mod } from './zlibwasm'
import { mod } from './wz'

const _require = tryGetRequireFunction()

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tsgo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
...config.plugins,
new CopyWebpackPlugin({
patterns: [
{ from: path.join(path.dirname(config.entry[Object.keys(config.entry)[0]][0]), 'util/zlibwasm.wasm'), to: path.join(config.output.path, 'zlibwasm.wasm') }
{ from: path.join(path.dirname(config.entry[Object.keys(config.entry)[0]][0]), 'util/wz.wasm'), to: path.join(config.output.path, 'wz.wasm') }
]
})
]
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions zlibwasm/CMakeLists.txt → wasm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.6)

project(zlibwasm)
project(wz)

set(EXE_NAME zlibwasm)
set(EXE_NAME wz)

set(LIB_SOURCE_FILES
src/main.cpp
Expand Down
2 changes: 1 addition & 1 deletion zlibwasm/cmakebuild.bat → wasm/cmakebuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cmake -DCMAKE_TOOLCHAIN_FILE=%EMSDK%\upstream\emscripten\cmake\Modules\Platform\
cmake --build .
cd ..

set exename=zlibwasm
set exename=wz

copy /Y %cmakeoutdir%\%exename%.js .\dist\%exename%.js
copy /Y %cmakeoutdir%\%exename%.js ..\src\util\%exename%.js
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion zlibwasm/pre.js → wasm/pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
try { Object.defineProperty(m, 'default', { enumerable: true, value: m }); } catch (_) { m['default'] = m; }
return m;
}
var name = 'zlibwasm';
var name = 'wzWasm';
if(typeof exports === 'object' && typeof module === 'object') {
module.exports = makeESModule(factory(require('@tybys/native-require').tryGetRequireFunction()));
} else if(typeof define === 'function' && define.amd) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion zlibwasm/src/main.cpp → wasm/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ emscripten::val js_aes_256_ecb(emscripten::val u8arr, emscripten::val key) {
return ret;
}

EMSCRIPTEN_BINDINGS(zlibwasm) {
EMSCRIPTEN_BINDINGS(wz) {
emscripten::function("inflate", js_inflate);
emscripten::function("aesEnc", js_aes_256_ecb);
}

0 comments on commit 5dccca1

Please sign in to comment.