Skip to content

Commit

Permalink
Changed from javascript to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
ZotyDev committed Mar 3, 2024
1 parent 0363c2c commit 11cc118
Show file tree
Hide file tree
Showing 22 changed files with 7,641 additions and 679 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/module
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

## Version 1.0.0
> This library was part of [OIF](https://foundryvtt.com/packages/object-interaction-fx), all of the changes here are relative to that module.
- *License* - Updated `LICENSE`
- *Internal* - Converted the complex system selector to an abstract class that requires its children to implement the abstract methods.
- *Internal* - Item creation is now requested from another user that is capable in case the current one is not.
- *Internal* - Hook information extraction does not extract `Tags` anymore.
- *Internal* - Changed indentation from `4` spaces to `2` spaces.
- *Internal* - Changed the language from `javascrtip` to `typescript`.
- *Workspace* - Now the module gets compiled to `/module` with minified files.
- *Worksapce* - Added `nodejs` to the project.
- *Workspace* - Added `gulp` to the project.
- *API* - Exposed only the current `Bridge` as the `API`, which is set based on the current system being used.
- *Bridge* - Added [DnD5e](https://foundryvtt.com/packages/dnd5e).

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Zoty
Copyright (c) 2024 RPG Made Simple

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
83 changes: 83 additions & 0 deletions gulpfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { src, series, dest, parallel } from 'gulp';

const fs = require('fs');
const sourcemaps = require('gulp-sourcemaps');
const jsonMinify = require('gulp-json-minify');
const browserify = require('browserify');
const source = require('vinyl-source-stream');
const tsify = require('tsify');
const uglify = require('gulp-uglify');
const buffer = require('vinyl-buffer');

const scriptSource = './src';
const langSource = './lang'

const packageDir = './module';
const langDir = packageDir.concat('/lang');

function clean() {
// Clean package dir
if (fs.existsSync(packageDir)) {
try {
fs.rmSync(packageDir, { recursive: true, force: true });
} catch (error) {
return Promise.reject(error);
}
}

return Promise.resolve('Successfully cleaned');
}


function tsBundle() {
return browserify({
baseDir: scriptSource,
debug: true,
entries: [scriptSource.concat('/module.ts')],
})
.plugin(tsify)
.bundle()
.pipe(source('module.min.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(uglify())
.pipe(dest(packageDir));
}

function langBundle() {
return src(langSource.concat('/*.json'))
.pipe(jsonMinify())
.pipe(dest(langDir));
}

function moduleJsonBundle() {
return src('./module.json')
.pipe(jsonMinify())
.pipe(dest(packageDir));
}

function publish() {

}

const buildTask = process.env.NODE_ENV === 'production' ?
series(
parallel(
tsBundle,
langBundle,
moduleJsonBundle,
),
publish,
) :
series(
clean,
parallel(
tsBundle,
langBundle,
moduleJsonBundle,
),
);

exports.build = buildTask;
exports.clean = clean;
exports.default = buildTask;
File renamed without changes.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
]
},
"esmodules": [
"./module/scripts/module.js"
"./module/module.min.js"
]
}
39 changes: 0 additions & 39 deletions module/scripts/bifrost.js

This file was deleted.

170 changes: 0 additions & 170 deletions module/scripts/bridge.js

This file was deleted.

Loading

0 comments on commit 11cc118

Please sign in to comment.