diff --git a/.gitignore b/.gitignore index 4ab2a7f..fc69c39 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,3 @@ module/ main/ node_modules/ .vscode/ -./src/version.js \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 8dd356b..770f395 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -11,16 +11,21 @@ const CJS_DEST = './main'; gulp.task("update-version-file", ()=>{ - const FILE_PATH = './src/version.js'; + const fileName = 'version.js'; const VERSION = pkg.version; - const CODE = [ + const ESM_CODE = [ "// this file is auto generated", "// the current version is:", "export default \"" + VERSION + "\";", ].join('\n'); - + const CJS_CODE = [ + "// this file is auto generated", + "// the current version is:", + "module.exports = \"" + VERSION + "\";", + ].join('\n'); return new Promise((res) => { - fs.writeFileSync(path.resolve(__dirname, FILE_PATH), CODE); + fs.writeFileSync(path.resolve(ESM_DEST, fileName), ESM_CODE); + fs.writeFileSync(path.resolve(CJS_DEST, fileName), CJS_CODE); res('version file updated!'); }); @@ -56,8 +61,7 @@ gulp.task("clean", ()=>{ }); gulp.task("build", gulp.series([ - 'update-version-file', - 'clean', - gulp.parallel(['build:cjs', 'build:esm']), - ]) -); + 'clean', + 'update-version-file', + gulp.parallel(['build:cjs', 'build:esm']), +])); diff --git a/package-lock.json b/package-lock.json index 31ba6c0..5a4d81d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rakam", - "version": "0.1.0", + "version": "1.0.0-0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2ad5114..5e1bce7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rakam", - "version": "0.1.0", + "version": "1.0.0-0", "description": "Intense math library. God willing, we won't stop developing it, we will be so happy when you contribute to make this library eligible for all needs and uses.", "main": "main", "module": "module", @@ -19,13 +19,12 @@ "homepage": "https://github.com/scicave/rakam#readme", "scripts": { "build": "gulp build && rollup -c", - "prod": "npm run prepare && npm run build", + "prod": "npm run lint && npm run build && npm run test", "prepare": "npm run lint && npm run test", "lint": "eslint src/ --fix", "test": "jest", "test:watch": "jest --watch", - "preversion": "npm run prepare", - "postversion": "npm run build" + "preversion": "npm run prod" }, "jest": { "verbose": true, diff --git a/src/geometry/angles/angles-extend.js b/src/geometry/angles/angles-extend.js index 40704d4..dcd4adc 100644 --- a/src/geometry/angles/angles-extend.js +++ b/src/geometry/angles/angles-extend.js @@ -1,4 +1,4 @@ -import { trunc } from "../../../core/index.js"; +import trunc from "../../core/trunc.js"; export const angleTypes = { RAD: 'rad', diff --git a/src/version.js b/src/version.js index edc5327..a677b84 100644 --- a/src/version.js +++ b/src/version.js @@ -1,3 +1,2 @@ -// this file is auto generated -// the current version is: -export default "0.1.0"; \ No newline at end of file +// this file will be auto filled by gulp "genrate-version-file" task. +export default "ourversion"; // this is just a placeholder \ No newline at end of file