Skip to content

Commit 2ab59d2

Browse files
author
ROOT\jesusarockias
committed
config(EJ2-6101): review changes
1 parent 42d87c4 commit 2ab59d2

File tree

3 files changed

+18
-139
lines changed

3 files changed

+18
-139
lines changed

ReadMe.md

Lines changed: 13 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,33 @@
1-
# TypeScript Sample Browser
21

3-
Repository for typescript sample browser.
42

5-
## Adding New Sample
3+
## Installing
64

7-
Create your new folder in 'src' location and name the folder as control name for example “button” it is control name.
8-
9-
Add your sample order in the `src/common/sampleOrder.json` with corresponding category.
10-
11-
Note: Do not use whitespace at any cause in folder’s name. Use “-” instead of space.
12-
13-
[Refer here](https://bitbucket.org/syncfusion/ej2-sample-browser/src/7740ab838973c7ebb3e970acb5246ff4c89ccd67/src/?at=master)
14-
15-
### Configure the folder and sample
16-
17-
Create the “sample.json” file inside of your control folder. Create your sample html and ts file in same folder also name the html and ts files with same name.
18-
19-
Note: Do not use whitespace at any cause in file’s name. Use “-” instead of space.
20-
21-
[Refer here](https://bitbucket.org/syncfusion/ej2-sample-browser/src/7740ab838973c7ebb3e970acb5246ff4c89ccd67/src/button/?at=master)
22-
23-
### Configure Sample JSON
24-
25-
Configure your sample json file as like below code snippet.
5+
To install all dependent packages, use the below command
266

277
```
28-
{
29-
"name": "Button",
30-
"directory": "button",
31-
"category":"Editors",
32-
"samples" : [
33-
{"url":"default", "name": "Default Functionalities", "category":"Button"},
34-
{"url":"api", "name": "API", "category":"Button"},
35-
{"url":"repeatbutton", "name": "Repeat Button", "category":"Button", hideOnDevice:true },
36-
{"url":"events", "name": "Events", "category":"Button"},
37-
{"url":"rtl", "name": "RTL", "category":"Button"}
38-
]
39-
}
40-
8+
npm install
419
```
42-
*Note: To exculde a sample in the device you need to set **hideOnDevice** as true for the sample json file.*
43-
44-
**Fields Description:**
45-
46-
_name :_ Its can be any string that you want show as a control name.
47-
48-
_directory :_ Specifies that your sample directory name.
49-
50-
_category :_ Specify that your sample comes under which category.
51-
52-
_samples :_ Specify array of samples are in your control.
53-
54-
_samples.url :_ specifies the file name without extension.
55-
56-
_samples.name :_ Its can be any string that you want show as a sample name.
57-
58-
_samples.category :_ Specify that your sample comes under which category.
59-
60-
## Configure your dependency
6110

62-
Add your dependency in “package.json” file inside the dependencies.
11+
## Building
6312

64-
Note: Here, `'*'` Specifies that install the latest published package form the online. `'*'` is recommended for Syncfusion packages.
13+
To compile the source files, use the below command
6514

6615
```
67-
"dependencies": {
68-
"@syncfusion/ej2-base": "*",
69-
"@syncfusion/ej2-buttons": "*",
70-
"@syncfusion/ej2-lists": "*",
71-
"@syncfusion/ej2-grids": "*",
72-
"bootstrap": "^3.3.6",
73-
"crossroads": "^0.12.2",
74-
"hasher": "^1.2.0"
75-
},
76-
16+
npm run build
7717
```
7818

79-
## Run the sample browser
19+
## Testing
8020

81-
We can run the sample browser with two commands
82-
83-
1. **gulp _serve_** – run the sample browser alone.
84-
2. **gulp _watch_** – run the sample browser and monitor typescript as well. This will help at development time. If any changes detect means it will automatically compile and browser will reloaded.
21+
To test the source files, use the below command
8522

8623
```
87-
D:\dev\typescript\source\ej2-sample-browser>gulp serve
24+
npm run test
8825
```
8926

27+
## Running
9028

91-
**Access URLs:**
92-
93-
Local URL is works only in your machine.
94-
95-
```
96-
http://localhost:3000
97-
```
98-
99-
External URL is works in all locally connected LAN. (You can use to see sample browser in mobile).
29+
To run the samples, use the below command
10030

10131
```
102-
http://your-ip-address:3000
103-
```
104-
105-
Note: Here, The mentioned IP is your local machine IP Address.
106-
107-
# Plunker Guidelines
108-
109-
1. In import statements in html file for a sample the package subdirectory shouldn’t be mentioned. Please refer the link given below.
110-
111-
https://gitlab.syncfusion.com/essential-studio/ej2-samples/blob/development/src/grid/events.ts#L3
112-
113-
2. In Base component dom and util are not available in the customer end. So, please don’t use the same. Please refer the link below.
114-
115-
https://gitlab.syncfusion.com/essential-studio/ej2-samples/blob/development/src/grid/events.ts#L3
116-
117-
3. To add any icon in the samples use base64 font and don’t use any font files like ttf, woff, or svg externally. Please refer the link given below.
118-
119-
https://gitlab.syncfusion.com/essential-studio/ej2-samples/blob/development/src/toolbar/default.html#L5
120-
121-
For example:
122-
```
123-
<style>
124-
@font-face {
125-
font-family: 'temp1';
126-
src:url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMj0gSIMAAAEoAAAAVmNtYXDnEOdVAAABiAAAADZnbHlmazsA9wAAAcgAAAAcaGVhZA3qwqgAAADQAAAANmhoZWEHmQNrAAAArAAAACRobXR4B+gAAAAAAYAAAAAIbG9jYQAOAAAAAAHAAAAABm1heHABDQAPAAABCAAAACBuYW1lv7gVOQAAAeQAAAINcG9zdD4ZCQ8AAAP0AAAANgABAAADUv9qAFoEAAAA//4D6gABAAAAAAAAAAAAAAAAAAAAAgABAAAAAQAAThBvMl8PPPUACwPoAAAAANVxP0wAAAAA1XE/TAAAAAAD6gMrAAAACAACAAAAAAAAAAEAAAACAAMAAQAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQP0AZAABQAAAnoCvAAAAIwCegK8AAAB4AAxAQIAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA5wDnAANS/2oAWgNSAJYAAAABAAAAAAAABAAAAAPoAAAAAAACAAAAAwAAABQAAwABAAAAFAAEACIAAAAEAAQAAQAA5wD//wAA5wD//wAAAAEABAAAAAEAAAAAAAAADgAAAAEAAAAAA+oDKwACAAA3IQECA+j+DMICaQAAAAAAABIA3gABAAAAAAAAAAEAAAABAAAAAAABAAUAAQABAAAAAAACAAcABgABAAAAAAADAAUADQABAAAAAAAEAAUAEgABAAAAAAAFAAsAFwABAAAAAAAGAAUAIgABAAAAAAAKACwAJwABAAAAAAALABIAUwADAAEECQAAAAIAZQADAAEECQABAAoAZwADAAEECQACAA4AcQADAAEECQADAAoAfwADAAEECQAEAAoAiQADAAEECQAFABYAkwADAAEECQAGAAoAqQADAAEECQAKAFgAswADAAEECQALACQBCyB0ZW1wMVJlZ3VsYXJ0ZW1wMXRlbXAxVmVyc2lvbiAxLjB0ZW1wMUZvbnQgZ2VuZXJhdGVkIHVzaW5nIFN5bmNmdXNpb24gTWV0cm8gU3R1ZGlvd3d3LnN5bmNmdXNpb24uY29tACAAdABlAG0AcAAxAFIAZQBnAHUAbABhAHIAdABlAG0AcAAxAHQAZQBtAHAAMQBWAGUAcgBzAGkAbwBuACAAMQAuADAAdABlAG0AcAAxAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAHUAcwBpAG4AZwAgAFMAeQBuAGMAZgB1AHMAaQBvAG4AIABNAGUAdAByAG8AIABTAHQAdQBkAGkAbwB3AHcAdwAuAHMAeQBuAGMAZgB1AHMAaQBvAG4ALgBjAG8AbQAAAAACAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBAgEDAAxhcnJvd2hlYWQtMDEAAAAA) format('truetype');
127-
font-weight: normal;
128-
font-style: normal;
129-
}
130-
#font::after {
131-
content: "\e700";
132-
font-size: large
133-
}
134-
.icon {
135-
font-family: temp1;
136-
}
137-
</style>
138-
<div id="font" class="icon"></div>
139-
```
140-
141-
4. For loading json files in the sample use import statements instead of require. Please refer the link given below.
142-
143-
https://gitlab.syncfusion.com/essential-studio/ej2-samples/blob/development/src/calendar/internationalization.ts#L9
144-
145-
( For example: import * as testJson from '../common/cldr-data/supplemental/numberingSystems.json'; )
146-
147-
5. If a New Component is added to TypeScript Sample Browser it’s package dependency should be added to the config in src/sys.js file.
148-
149-
( For example: https://gitlab.syncfusion.com/essential-studio/ej2-samples/blob/development/src/sys.js#L19 )
32+
npm run serve
33+
```

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ gulp.task('test', function(done) {
6969
new karma.Server({
7070
configFile: __dirname + '/karma.conf.js',
7171
singleRun: true,
72-
browsers: ['Chrome'],
72+
browsers: ['ChromeHeadless'],
7373
browserNoActivityTimeout: 30000
7474
}, function(e) {
7575
done(e === 0 ? null : 'karma exited with status ' + e);

package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@syncfusion/ej2-samples",
3-
"version": "0.0.1",
3+
"version": "16.1.24",
44
"description": "Samples for Syncfusion Essential JS 2",
55
"author": "Syncfusion Inc.",
66
"license": "SEE LICENSE IN license",
@@ -46,13 +46,8 @@
4646
"webpack-stream": "^3.2.0"
4747
},
4848
"scripts": {
49-
"test": "gulp sample-test",
50-
"ci-publish": "gulp publish-samples"
51-
},
52-
"config": {
53-
"ghooks": {
54-
"pre-commit": "gulp test",
55-
"commit-msg": "gulp commit-message"
56-
}
49+
"build": "gulp build",
50+
"serve": "gulp serve",
51+
"test": "gulp test"
5752
}
5853
}

0 commit comments

Comments
 (0)