Skip to content

Commit

Permalink
Added npm setup and remove old Makefile
Browse files Browse the repository at this point in the history
- automatically checkout submodule
- add missing browserify.js entry point

Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Jul 29, 2019
1 parent b04ec35 commit 3cfea84
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 54 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
src_gen
node_modules
54 changes: 0 additions & 54 deletions Makefile

This file was deleted.

12 changes: 12 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"jsx": "preserve"
},
"exclude": [
"node_modules",
"**/node_modules/*",
"build"
]
}
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "jssom",
"displayName": "JsSOM",
"version": "0.1.0",
"description": "A JavaScript implementation of the SOM (Simple Object Machine",
"repository": {
"type": "git",
"url": "https://github.com/SOM-st/JsSOM.git"
},
"author": {
"name": "Stefan Marr",
"email": "[email protected]"
},
"license": "MIT",
"devDependencies": {
"browserify": "^16.3.0",
"tinyify": "^2.5.1"
},
"scripts": {
"browserify": "mkdir -p build && npm run core-lib && npm run browserify:som-core && npm run browserify:main && npm run browserify:test",
"_re-add": "--plugin tinyify",
"browserify:test": "browserify tests/browserify.js -o build/test.js",
"browserify:main": "browserify src/node.js -o build/node.js",
"browserify:som-core": "./libs/jsify-core-lib.py core-lib > build/som.js",
"clean": "rm -Rf build/*.js",
"clobber": "rm -Rf build/",
"core-lib": "git submodule update --init --recursive",
}
}
2 changes: 2 additions & 0 deletions som.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
#!/bin/sh
git submodule update --init --recursive > /dev/null 2>&1

exec node src/node.js "$@"
12 changes: 12 additions & 0 deletions tests/browserify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const u = require('../src/som/vm/Universe');
const compileClassString = require('../src/som/compiler/SourcecodeCompiler').compileClassString;
const universe = u.universe;

if (document) {
document.u = u;
document.compileClassString = compileClassString;
}

universe.interpret(["-cp", "core-lib/Smalltalk", "core-lib/TestSuite/TestHarness.som "]);


0 comments on commit 3cfea84

Please sign in to comment.