@progress/kendo-typescript-tasks 10.0.13-ng12.34 → 10.0.14-cdn-bundle-v18.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,14 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [10.0.14](https://github.com/telerik/kendo-build-tasks/compare/@progress/kendo-typescript-tasks@10.0.13...@progress/kendo-typescript-tasks@10.0.14) (2021-10-08)
7
-
8
- **Note:** Version bump only for package @progress/kendo-typescript-tasks
9
-
10
-
11
-
12
-
13
-
14
6
  ## [10.0.13](https://github.com/telerik/kendo-build-tasks/compare/@progress/kendo-typescript-tasks@10.0.12...@progress/kendo-typescript-tasks@10.0.13) (2021-09-28)
15
7
 
16
8
 
package/api.config.js CHANGED
@@ -1,8 +1,22 @@
1
+ const os = require('os');
1
2
  const path = require('path');
2
3
 
3
- const jsonPath = path.resolve('./api.json');
4
+ const jsonPath = path.join(os.tmpdir(), `api-${process.pid}.json`);
4
5
  const typedoc = {
5
- excludeExternals: true
6
+ // TypeScript options
7
+ module: 'commonjs',
8
+ target: 'es6',
9
+ types: [],
10
+ experimentalDecorators: true,
11
+ jsx: 'react', // support for tsx files
12
+
13
+ // Output options
14
+ json: jsonPath,
15
+
16
+ // Typedoc options
17
+ excludeExternals: true,
18
+ ignoreCompilerErrors: false,
19
+ includeDeclarations: true
6
20
  };
7
21
 
8
22
  module.exports = {
package/api.js CHANGED
@@ -2,40 +2,21 @@
2
2
 
3
3
  const execSync = require('child_process').execSync;
4
4
  const path = require('path');
5
- const typedoc = require('typedoc');
6
- const deepAssign = require('lodash.merge');
7
- const glob = require('glob');
5
+ const typedoc = require('gulp-typedoc');
6
+ const { merge } = require('lodash');
8
7
 
9
8
  const api = require('./src/api/generator.js');
10
9
  const apiConfig = require('./api.config.js');
11
10
 
12
11
  module.exports = (gulp, userConfig) => {
13
12
  const series = gulp.series;
14
- const config = deepAssign({}, apiConfig, userConfig);
15
-
16
- gulp.task('api-json', async (done) => {
17
- const entryPoints = [
18
- ...glob.sync("src/**/*.{ts,tsx}"),
19
- ...(config.externalApi || [])
20
- ];
21
-
22
- const app = new typedoc.Application();
23
- app.options.addReader(new typedoc.TSConfigReader());
24
- app.bootstrap({ ...config.typedoc, entryPoints });
25
-
26
- const project = app.convert();
27
- if (!project) {
28
- done(new Error('Unable to initialize TypeDoc.'));
29
- return;
30
- }
31
-
32
- await app.generateJson(project, apiConfig.jsonPath);
33
- if (app.logger.hasErrors()) {
34
- done(new Error('Unable to generate API reference, see messages above.'));
35
- return;
36
- }
37
13
 
38
- done();
14
+ const config = merge({}, apiConfig, userConfig);
15
+ const DECLARATIONS = ["typings/index.d.ts", "node_modules/@types/core-js/index.d.ts"];
16
+
17
+ gulp.task('api-json', () => {
18
+ return gulp.src(["src/**/*.{ts,tsx}", ...DECLARATIONS, ...(config.externalApi || [])], { "allowEmpty": true })
19
+ .pipe(typedoc(config.typedoc));
39
20
  });
40
21
 
41
22
  gulp.task('api-clean', (done) => {
package/gulp-tasks.js CHANGED
@@ -3,10 +3,11 @@
3
3
  const del = require('del');
4
4
  const childProcess = require('child_process');
5
5
  const path = require('path');
6
+ const gulpTsLint = require('gulp-tslint');
7
+ const tslint = require('tslint');
6
8
 
7
9
  const apiTasks = require('./api.js');
8
10
  const commonTasks = require('@progress/kendo-common-tasks');
9
- const linter = require('./src/linter');
10
11
 
11
12
  const webpackConfig = require('./webpack.config.js');
12
13
  const tscPath = path.join(process.cwd(), 'node_modules', '.bin', 'tsc');
@@ -36,15 +37,29 @@ module.exports = (gulp, libraryName, compilerPath, options, webpackConfigPath) =
36
37
  done()
37
38
  });
38
39
 
39
- gulp.task('lint', series(
40
- 'check-compilation',
41
- linter([ 'src/**/*.{ts,tsx}', 'test/**/*.{ts,tsx}', 'e2e/**/*.{ts,tsx}' ])
42
- ));
40
+ gulp.task('lint', series('check-compilation', (done) => {
41
+ const program = tslint.Linter.createProgram('./tsconfig.json', '.');
43
42
 
44
- gulp.task('lint-docs', linter([ 'docs/examples/**/*.{ts,tsx}' ], {
45
- overrideConfigFile: '.eslintrc.docs.json'
43
+ return gulp.src([ 'src/**/*.{ts,tsx}', 'test/**/*.{ts,tsx}', 'e2e/**/*.{ts,tsx}' ])
44
+ .pipe(gulpTsLint({
45
+ program: program,
46
+ formatter: 'verbose'
47
+ }))
48
+ .pipe(gulpTsLint.report());
46
49
  }));
47
50
 
51
+ gulp.task('lint-docs', () => {
52
+ const program = tslint.Linter.createProgram('./tsconfig.docs.json', '.');
53
+
54
+ return gulp.src([ 'docs/examples/**/*.{ts,tsx}'])
55
+ .pipe(gulpTsLint({
56
+ formatter: 'prose',
57
+ program: program,
58
+ configuration: './tslint.docs.json'
59
+ }))
60
+ .pipe(gulpTsLint.report());
61
+ });
62
+
48
63
  gulp.task('start', (done) => {
49
64
  const webpackPort = 8888;
50
65
  const host = listenAddress;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@progress/kendo-typescript-tasks",
3
3
  "description": "Kendo UI TypeScript package gulp tasks",
4
4
  "main": "gulp-tasks.js",
5
- "version": "10.0.13-ng12.34+fc3a9d7",
5
+ "version": "10.0.14-cdn-bundle-v18.5+4b783cf",
6
6
  "author": "Telerik",
7
7
  "license": "Apache-2.0",
8
8
  "scripts": {
@@ -15,31 +15,29 @@
15
15
  "API Generation"
16
16
  ],
17
17
  "peerDependencies": {
18
- "typescript": "^4.3.4"
18
+ "typescript": "^3.4.5"
19
19
  },
20
20
  "dependencies": {
21
- "@progress/kendo-common-tasks": "ng12",
22
- "@typescript-eslint/eslint-plugin": "4.28.2",
23
- "@typescript-eslint/parser": "4.28.2",
24
- "core-js": "^3.18.0",
21
+ "@progress/kendo-common-tasks": "7.7.2-cdn-bundle-v18.5+4b783cf",
22
+ "core-js": "^2.2.2",
25
23
  "del": "2.2.2",
26
- "eslint": "7.32.0",
27
- "eslint-plugin-import": "2.25.2",
28
- "eslint-plugin-rxjs": "3.3.7",
29
- "glob": "^7.2.0",
30
24
  "gulp": "^4.0.0",
31
25
  "gulp-add-src": "^1.0.0",
26
+ "gulp-tslint": "^8.0.0",
27
+ "gulp-typedoc": "~2.2.2",
32
28
  "handlebars": "^4.0.5",
33
29
  "highlight.js": "9.14.2",
34
- "lodash.merge": "^4.6.0",
30
+ "lodash": "^4.6.0",
35
31
  "mkdirp": "^0.5.0",
36
32
  "source-map-loader": "^0.1.5",
37
33
  "ts-loader": "4.1.0",
38
- "typedoc": "~0.22.5"
34
+ "tslint": "^5.0.0",
35
+ "tslint-defocus": "^2.0.6",
36
+ "typedoc": "0.15.0"
39
37
  },
40
38
  "devDependencies": {
41
39
  "gulp-jasmine": "^2.4.2",
42
- "typescript": "~4.3.4"
40
+ "typescript": "~3.4.5"
43
41
  },
44
42
  "repository": {
45
43
  "type": "git",
@@ -48,5 +46,5 @@
48
46
  "publishConfig": {
49
47
  "access": "public"
50
48
  },
51
- "gitHead": "fc3a9d78eb6d2fbb953887cffdc5ed57daf5bc90"
49
+ "gitHead": "4b783cf3604d51e00635c5e088bf7d1c268f045c"
52
50
  }
@@ -22,7 +22,7 @@ const findDecorator = (decorators) => ((decorators || []).find(d =>
22
22
  const decoratorProp = (prop) => (decorators) => {
23
23
  const compDecorator = findDecorator(decorators);
24
24
 
25
- if (compDecorator) {
25
+ if (compDecorator) {
26
26
  const regExp = new RegExp(`${prop}:\\s?['"](.+?)['"]`);
27
27
  const match = compDecorator.arguments.obj.match(regExp);
28
28
 
@@ -112,11 +112,6 @@ const normalizeMembers = (members) => {
112
112
  }
113
113
  }
114
114
  }
115
-
116
- if (!element.comment && element.kindString === 'Accessor') {
117
- const accessor = element.getSignature || element.setSignature || [];
118
- element.comment = accessor[0].comment;
119
- }
120
115
  });
121
116
  }
122
117
 
@@ -155,7 +150,7 @@ const extractMembers = (packageName, modules, config) => {
155
150
 
156
151
  const models = nonEmptyModules.map(module => module
157
152
  .children
158
- .filter(child => child.kindString !== "Reference")
153
+ .filter(child => child.flags.isExported)
159
154
  .filter(child => child.name !== 'core')
160
155
  .map(child => {
161
156
  const fullName = moduleFullName(module.name, packageName, rootModules);
@@ -202,6 +197,7 @@ const namespacesAsModules = data => {
202
197
  const modules = [];
203
198
  data.filter(moduleFilter).forEach(module => module
204
199
  .children
200
+ .filter(child => child.flags.isExported)
205
201
  .filter(child => child.name !== 'core')
206
202
  .forEach(child => {
207
203
  if (child.kindString === 'Module' && child.children) {
@@ -9,13 +9,8 @@ const utils = require('./utils');
9
9
  const isConstructor = (prop) =>
10
10
  prop.kindString && prop.kindString === 'Constructor' && isPublic(prop);
11
11
 
12
- const mapConstructors = (member) => {
13
- if (member.decorators && member.decorators.find(d => d.name === 'NgModule')) {
14
- // Ignore NgModule constructors
15
- return [];
16
- }
17
-
18
- return utils.flatten(member.children.filter(isConstructor).map(ctr => {
12
+ const mapConstructors = (member) =>
13
+ utils.flatten(member.children.filter(isConstructor).map(ctr => {
19
14
  const name = ctr.name;
20
15
  const source = `${member.name}.constructor`;
21
16
 
@@ -26,7 +21,6 @@ const mapConstructors = (member) => {
26
21
  params: types.params(signature, source)
27
22
  }));
28
23
  }));
29
- };
30
24
 
31
25
  module.exports = mapConstructors;
32
26
 
@@ -5,7 +5,7 @@ const comment = require('./comment');
5
5
  const unionTypes = (member) =>
6
6
  member.type.types.map(type => {
7
7
  switch (type.type) {
8
- case 'literal':
8
+ case 'stringLiteral':
9
9
  return `"${type.value}"`;
10
10
  default:
11
11
  return typeString({ type });
package/webpack.config.js CHANGED
@@ -1,5 +1,6 @@
1
- const commonTasks = require('@progress/kendo-common-tasks');
2
1
  const path = require('path');
2
+ const commonTasks = require('@progress/kendo-common-tasks');
3
+ const { umdExternals } = require('@progress/kendo-common-tasks/umd-externals');
3
4
 
4
5
  const sourceExtensions = [ '.ts' ];
5
6
  const nodeModulesPath = path.join(__dirname, 'node_modules');
@@ -8,36 +9,9 @@ const resolve = commonTasks.resolveConfig(sourceExtensions, nodeModulesPath);
8
9
 
9
10
  const packageInfo = require(path.join(process.cwd(), 'package.json'));
10
11
  const packageKeys = (key) => Object.keys(packageInfo[key] || {});
11
-
12
+ const peerDependencies = packageKeys('peerDependencies');
13
+ const allDependencies = packageKeys('dependencies').concat(peerDependencies);
12
14
  const matchStartsWith = (key) => new RegExp(`^${key}`);
13
- const deps = packageKeys('dependencies').concat(packageKeys('peerDependencies'));
14
- const packageDependencies = deps.map(matchStartsWith);
15
-
16
- //list all Angular packages that should not appear in CDN bundles
17
- const angularPeers = [
18
- '@angular/animations'
19
- ];
20
-
21
- //list all packages that should not appear in CDN bundles
22
- const peers = [
23
- '@progress/kendo-angular-intl',
24
- '@progress/kendo-angular-l10n',
25
- '@progress/kendo-drawing'
26
- ];
27
- const internal = dep => dep.match(/@progress|@telerik/);
28
- const isPeer = dep => peers.find(pkg => pkg === dep);
29
- const isException = dep => dep.match(/tslib/);
30
-
31
- const prebuilt = [
32
- /jszip[\/\\]dist[\/\\]jszip.js/,
33
- /pako[\/\\]dist[\/\\]pako_deflate.js/
34
- ];
35
-
36
- const cdnExternals = deps
37
- .filter((dep) => ((!internal(dep) || isPeer(dep)) && !isException(dep)))
38
- .concat(angularPeers)
39
- .map(matchStartsWith);
40
-
41
15
 
42
16
  const tsLoader = (compilerOptions) => ({
43
17
  test: /\.ts?$/,
@@ -48,8 +22,21 @@ const tsLoader = (compilerOptions) => ({
48
22
  }
49
23
  });
50
24
 
25
+ const cdn = commonTasks.webpackCommonConfig({
26
+ resolve,
27
+ stats: { assets: false },
28
+ output: { libraryTarget: 'umd' },
29
+ plugins: [],
30
+ optimization: {
31
+ minimize: true
32
+ },
33
+ module: {
34
+ rules: [ tsLoader({ declaration: false }) ]
35
+ }
36
+ });
51
37
 
52
38
  module.exports = {
39
+ // dist/npm
53
40
  npmPackage: commonTasks.webpackCommonConfig({
54
41
  resolve,
55
42
 
@@ -58,7 +45,7 @@ module.exports = {
58
45
  externals: [
59
46
  /^\.\//,
60
47
  /^\.\.\//
61
- ].concat(packageDependencies),
48
+ ].concat(allDependencies.map(matchStartsWith)),
62
49
 
63
50
  module: {
64
51
  rules: [ tsLoader({ sourceMap: true }) ]
@@ -67,33 +54,25 @@ module.exports = {
67
54
  devtool: 'source-map'
68
55
  }),
69
56
 
70
- CDN: commonTasks.webpackCommonConfig({
71
- resolve,
57
+ // dist/cdn/js/<package-name>.js
58
+ CDN: {
59
+ ...cdn,
60
+ externals: umdExternals(peerDependencies)
61
+ },
72
62
 
73
- stats: { assets: false },
74
-
75
- output: { libraryTarget: 'umd' },
76
-
77
- plugins: [
78
- ],
79
- optimization: {
80
- minimize: true
81
- },
82
- externals: cdnExternals,
83
-
84
- module: {
85
- rules: [ tsLoader({ declaration: false }) ],
86
- noParse: prebuilt
87
- }
88
- }),
63
+ // dist/cdn/main.js
64
+ umdPackage: {
65
+ ...cdn,
66
+ externals: umdExternals(allDependencies)
67
+ },
89
68
 
90
69
  dev: commonTasks.webpackDevConfig({
91
70
  resolve,
92
71
  rules: [ tsLoader({ sourceMap: true }) ],
93
- noParse: prebuilt,
94
72
  entries: 'examples/**/*.ts'
95
73
  }),
96
74
 
75
+ // dist/systemjs/<package-name>.js
97
76
  systemjs: commonTasks.webpackCommonConfig({
98
77
  resolve,
99
78
 
@@ -102,25 +81,5 @@ module.exports = {
102
81
  module: {
103
82
  rules: [ tsLoader({ declaration: false }) ]
104
83
  }
105
- }),
106
-
107
- umdPackage: commonTasks.webpackCommonConfig({
108
- resolve,
109
-
110
- stats: { assets: false },
111
-
112
- output: { libraryTarget: 'umd' },
113
-
114
- externals: packageDependencies,
115
-
116
- plugins: [
117
- ],
118
- optimization: {
119
- minimize: true
120
- },
121
- module: {
122
- rules: [ tsLoader({ declaration: false }) ],
123
- noParse: prebuilt
124
- }
125
84
  })
126
85
  };