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

Vite build migration #304

Merged
merged 2 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 0 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
Expand Down
8 changes: 6 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## 1.0.0-alpha
* Migrated the code to typescript
## 1.1.0
* Vite build migration

## 1.0.0
* Typescript migration
* Performance improvements

## 0.2
* TypeScript definitions added
Expand Down
45 changes: 13 additions & 32 deletions HelloWorld.js → HelloWorld.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
/*
* MIT License
* Copyright (c) 2019 Erin Catto
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* Copyright (c) Erin Catto, Ali Shakiba
*/

/*
Expand All @@ -31,19 +13,19 @@
* To run this example simply run `node HelloWorld.js` from command line.
*/

var planck = require('./dist/planck')

var Vec2 = planck.Vec2;
import { Box, World, } from "./src";

// Define the gravity vector.
var gravity = Vec2(0.0, -10.0);
var gravity = {x: 0.0, y: -10.0};

// Construct a world object, which will hold and simulate the rigid bodies.
var world = planck.World(gravity);
var world = new World({
gravity: gravity
});

// Define the ground body.
var groundBodyDef = {
position: Vec2(0.0, -10.0)
position: {x: 0.0, y: -10.0}
};

// Call the body factory which allocates memory for the ground body
Expand All @@ -53,20 +35,19 @@ var groundBody = world.createBody(groundBodyDef);

// Define the ground box shape.
// The extents are the half-widths of the box.
var groundBox = planck.Box(50.0, 10.0);
var groundBox = new Box(50.0, 10.0);

// Add the ground fixture to the ground body.
groundBody.createFixture(groundBox, 0.0);

// Define the dynamic body. We set its position and call the body factory.
var bodyDef = {
type: 'dynamic',
position: Vec2(0.0, 4.0),
}
var body = world.createBody(bodyDef);
var body = world.createBody({
type: "dynamic",
position: {x:0.0, y: 4.0},
});

// Define another box shape for our dynamic body.
var dynamicBox = planck.Box(1.0, 1.0);
var dynamicBox = new Box(1.0, 1.0);

// Define the dynamic body fixture.
var fixtureDef = {
Expand Down
157 changes: 0 additions & 157 deletions build-utils/declarationTransformer.js

This file was deleted.

25 changes: 0 additions & 25 deletions build-utils/license.js

This file was deleted.

Loading