Skip to content
This repository was archived by the owner on Jan 17, 2022. It is now read-only.

Commit d8e8795

Browse files
author
Antonio Marcos SS Jr
committed
Added Typescript on introjs.
- updated example in folder. - updated service, so that's possible to make chainable methods. - removed promises... it's better to call the callback instead; - removed deferList. - removed triggers from directive, it wasn't a clean solutions, now it's using the service directly,. - updated version and build - Update README.md - added ´ng-intro-disable-button´ a directive responsible to disable/enable buttons when the intro opens and when the directive is added to a DOM. - updated the example. - added wiki url; - fixed some typos. changed from js to typescript. added types. updated ignored files. fixed some build errors because of the tsc version. first build in a single file. - added introJS types. - re-written ngIntroService. - re-written some parts. - removed module, we'll need make a custom soon enough. updated typescript with the current version. updated somethings. updated directives. added the loaders. fixed some errors. updated npm starts so it install typings requirements as well. added typings on package. added global typings on travis. updated the post install as @mendhak provided, thanks :) removed the global dependency from travis. updated node version. - updated version - renamed angular-intro-typescript to proper name. - renamed to deprectable - fixed the example, that wasn't running. - changed grunt. - removed typings. - now we deply the declaration on build folder. - added types of intro.js onto npm. - fixed an error while running grunt. Update README.md updated grunt watch. - added tslint. - updated code, following the current rules. - removed jslint. updated min. fixed callbacks on typescript version.
1 parent e2365e7 commit d8e8795

14 files changed

+622
-29
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
bower_components/
22
.idea/
33
node_modules
4-
*.iml
4+
*.iml
5+
typings/
6+
*.map
7+
*.js
8+
src/*.js
9+
.tscache/

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ install:
1515
- npm install
1616
- node_modules/.bin/bower install
1717

18-
1918
script:
2019
# Just run the default task and make sure it builds, there aren't any tests :(
2120
- node_modules/.bin/grunt

Gruntfile.js

+33-13
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,59 @@
1-
module.exports = function(grunt) {
1+
module.exports = function (grunt) {
22

33
grunt.loadNpmTasks('grunt-contrib-connect');
4+
grunt.loadNpmTasks("grunt-tslint");
5+
grunt.loadNpmTasks('grunt-ts');
46

57
// Project configuration.
68
grunt.initConfig({
79
connect: {
810
server: {
911
options: {
10-
port: 8000,
11-
base: '.',
12-
keepalive: true
12+
port: 8000,
13+
base: '.',
14+
keepalive: true
1315
}
1416
}
1517
},
1618
pkg: grunt.file.readJSON('package.json'),
19+
ts: {
20+
default: {
21+
src: ["src/**/*.ts", "!node_modules/**"],
22+
options: {
23+
module: "amd",
24+
moduleResolution: "node",
25+
declaration: true,
26+
compiler: './node_modules/typescript/bin/tsc'
27+
},
28+
tsconfig: 'tsconfig.json',
29+
}
30+
},
1731
uglify: {
1832
options: {
1933
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n',
2034
sourceMap: true
2135
},
2236
build: {
23-
src: 'src/angular-intro.js',
37+
src: ['src/ng-intro.component.js'],
2438
dest: 'build/angular-intro.min.js'
2539
}
2640
},
27-
jshint: {
28-
lib: {
29-
options: {},
30-
src: ['src/*.js']
41+
tslint: {
42+
options: {
43+
configuration: "tslint.json",
44+
force: false,
45+
fix: false
46+
},
47+
files: {
48+
src: [
49+
"src/ng-intro.component.ts"
50+
]
3151
}
3252
},
3353
watch: {
3454
scripts: {
35-
files: 'src/*.js',
36-
tasks: ['jshint', 'uglify'],
55+
files: 'src/*.ts',
56+
tasks: ['ts', 'tslint', 'uglify'],
3757
options: {
3858
interrupt: true
3959
}
@@ -48,8 +68,8 @@ module.exports = function(grunt) {
4868
require('load-grunt-tasks')(grunt);
4969

5070
// Default task(s).
51-
grunt.registerTask('default', ['jshint', 'uglify']);
71+
grunt.registerTask('default', ['ts', 'tslint', 'uglify']);
5272

5373
// Test
54-
grunt.registerTask('test', ['jshint']);
74+
grunt.registerTask('test', ['tslint']);
5575
};

README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,14 @@ alternatively as Service, [as shown here](http://plnkr.co/edit/4JdONL)
133133

134134
If you want to build or contribute, first, get the node modules needed (grunt, bower)
135135

136-
npm install
136+
npm install
137+
p.s.: this will run `bower install` after completes :)
137138

138-
Next, use bower to get the JS libraries needed
139139

140-
node_modules/.bin/bower install
140+
Then, get grunt to build the typescript into .js and the minified angular-intro.min.js
141141

142-
Then, whenever you make any changes, get grunt to build the minified angular-intro.min.js
143-
144-
node_modules/.bin/grunt
142+
node_modules/.bin/grunt watch
143+
p.s.: for faster build use `tsc --watch`, but you need run grunt after finish
145144

146145
Finally, view the demo page to make sure everything's working; start a web server:
147146

@@ -151,7 +150,6 @@ And browse to `http://localhost:8000/example/index.html`
151150

152151

153152

154-
155153
## License
156154

157155
Same as intro.js, this is [AGPL](LICENSE)

build/angular-intro.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)