Skip to content

Commit

Permalink
v1.1.0-alpha: vite build migration
Browse files Browse the repository at this point in the history
  • Loading branch information
shakiba authored Nov 23, 2024
1 parent 514a34b commit e5048fe
Show file tree
Hide file tree
Showing 285 changed files with 98,163 additions and 114,949 deletions.
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

0 comments on commit e5048fe

Please sign in to comment.