Skip to content

Commit ee778a3

Browse files
committed
delete js and add ts
2 parents 8e6a185 + 31d21e0 commit ee778a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+19210
-539
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# <p align="center"><img width="20px" src="https://media1.giphy.com/media/ln7z2eWriiQAllfVcn/giphy.gif?cid=790b76115cd5f2f3ebd0a1aeb3ae5c75cbf7bc3c9a1bd77b&rid=giphy.gif&ct=s" /> Functionality.js (beta) <img width="20px" src="https://media1.giphy.com/media/ln7z2eWriiQAllfVcn/giphy.gif?cid=790b76115cd5f2f3ebd0a1aeb3ae5c75cbf7bc3c9a1bd77b&rid=giphy.gif&ct=s"/></p>
1+
# <p align="center">Functionality.js (beta) 🔥</p>
22

33
<p float="right">
44
<!-- License -->
@@ -16,8 +16,8 @@
1616
## Installation ⬇️
1717

1818
- So To Get Started Using Functionalty.js Library,<br />
19-
You Have To Install It By Node.js
20-
```node
19+
You Have To Install It By npm
20+
```cmd
2121
Comming Soon
2222
```
2323
- Or You Can Install it By CDN In Your HTML File
@@ -51,12 +51,12 @@
5151
# <p align="center">Here Is What We Are Working On 🤞</p>
5252

5353
1. Adding Logo
54-
2. Converting functionality.js File Into TypeScript File
54+
2. ✔️ Converting Library Into TypeScript
5555
3. ✔️ Making File Supported By All Of Search Engines
5656
4. ✔️ Making File Compressed
5757
5. ✔️ Making File Light Weight
5858
6. ✔️ Testing The Library
59-
7. Handling Function Errors
59+
7. ✔️ Handling Function Errors
6060
8. Making A Documentation Website
6161
9. Adding Dark And White Theme In Website
6262
10. Adding New Functions
@@ -75,13 +75,13 @@
7575

7676
- Then Install Packages (node_modules)
7777

78-
```node
78+
```cmd
7979
npm install
8080
```
8181

8282
- Run Website In Your Locahost Server With Live Reload
8383

84-
```node
84+
```cmd
8585
gulp watch
8686
```
8787

babel.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["@babel/preset-env"]
2+
"presets": ["@babel/preset-env", "@babel/preset-typescript"]
33
}

dist/functionality.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

gulpfile.js

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ gulp.task("html", () => {
1717
require("./server.js");
1818
return gulp
1919
.src(["./project/html/*.pug", "./project/html/pages/*.pug"])
20-
.pipe(pug({ pretty: false }))
20+
.pipe(pug({pretty: false}))
2121
.pipe(gulp.dest("./website"))
2222
.pipe(livereload());
2323
});
@@ -36,14 +36,14 @@ gulp.task("styles", () => {
3636
.pipe(gulp.dest("./website/css"))
3737
.pipe(livereload());
3838
});
39-
4039
// JS Tasks
4140
gulp.task("scripts", () => {
4241
require("./server.js");
4342
return gulp
4443
.src([
4544
"./project/js/*.js",
4645
"./project/js/**/*.js",
46+
"!./project/js/functionality/*.ts",
4747
"!./project/js/functionality/*.js",
4848
])
4949
.pipe(sourcemaps.init())
@@ -60,19 +60,35 @@ gulp.task("scripts", () => {
6060
});
6161

6262
// Functionalty.js File Task
63+
// var ts = require("gulp-typescript");
64+
// var tsProject = ts.createProject("tsconfig.json");
65+
6366
gulp.task("functionality", () => {
67+
var browserify = require("browserify");
68+
var source = require("vinyl-source-stream");
69+
var tsify = require("tsify");
70+
var sourcemaps = require("gulp-sourcemaps");
71+
var buffer = require("vinyl-buffer");
72+
6473
livereload.listen();
6574
require("./server.js");
66-
return gulp
67-
.src("./project/js/functionality/*.js")
68-
.pipe(
69-
babel({
70-
presets: ["@babel/env"],
71-
})
72-
)
73-
.pipe(concat("functionality.min.js"))
75+
return browserify({
76+
basedir: ".",
77+
debug: true,
78+
entries: ["project/ts/functionality/main.ts"],
79+
cache: {},
80+
packageCache: {},
81+
})
82+
.plugin(tsify)
83+
.transform("babelify", {
84+
presets: ["es2015"],
85+
extensions: [".ts"],
86+
})
87+
.bundle()
88+
.pipe(source("functionality.min.js"))
89+
.pipe(buffer())
7490
.pipe(uglify())
75-
.pipe(gulp.dest("./dist"));
91+
.pipe(gulp.dest("dist"));
7692
});
7793

7894
// Compressing The Dist Folder For The User
@@ -99,5 +115,5 @@ gulp.task("watch", () => {
99115
gulp.series("scripts")
100116
);
101117

102-
gulp.watch("./project/js/functionality/*.js", gulp.series("functionality"));
118+
gulp.watch("./project/ts/functionality/*.ts", gulp.series("functionality"));
103119
});

0 commit comments

Comments
 (0)