@eui/tools 4.15.14 → 4.16.0

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.
Files changed (36) hide show
  1. package/.version.properties +1 -1
  2. package/CHANGELOG.md +17 -0
  3. package/bin/eui-scripts.js +0 -4
  4. package/global.test.js +1 -4
  5. package/package.json +6 -6
  6. package/sandbox.js +10 -3
  7. package/scripts/csdr/config/packages.js +28 -0
  8. package/scripts/csdr/init/init-utils.js +37 -0
  9. package/scripts/csdr/init/init.js +6 -0
  10. package/scripts/csdr/init/resources/13.x/resolutions.json +15 -0
  11. package/scripts/csdr/install/build-package.js +0 -84
  12. package/scripts/csdr/install/common.js +0 -16
  13. package/scripts/csdr/metadata/app.js +3 -3
  14. package/scripts/csdr/release/package/backend.js +26 -0
  15. package/scripts/csdr/release/package/common.js +1 -1
  16. package/scripts/csdr/release/package/release-package.js +4 -0
  17. package/scripts/csdr/release/package/ui.js +83 -1
  18. package/scripts/csdr/sync/sync-utils.js +7 -4
  19. package/scripts/csdr/version/package.js +2 -1
  20. package/scripts/utils/build/app/build-app-utils.js +2 -2
  21. package/scripts/utils/build/package/element.js +2 -2
  22. package/scripts/utils/notification/common.js +5 -0
  23. package/scripts/utils/notification/mail-utils.js +3 -0
  24. package/scripts/utils/notification/mailstack.js +3 -5
  25. package/scripts/utils/notification/package.js +0 -2
  26. package/scripts/utils/notification/slack-utils.js +6 -7
  27. package/scripts/utils/pre-build/injection/config.js +29 -30
  28. package/scripts/utils/pre-build/injection/externals.js +6 -0
  29. package/scripts/utils/serve/app.js +6 -3
  30. package/scripts/utils/tools.js +362 -304
  31. package/bin/scripts/csdr-jira-update.js +0 -12
  32. package/bin/scripts/csdr-migrate-package.js +0 -17
  33. package/bin/scripts/e2e-app.js +0 -62
  34. package/scripts/csdr/init/resources/yarn-eui13.lock +0 -15857
  35. package/scripts/migration/eui8-migration.js +0 -94
  36. package/scripts/migration/migrate-utils.js +0 -191
@@ -1,94 +0,0 @@
1
- 'use strict';
2
-
3
- const tools = require('../utils/tools');
4
- const path = require('path');
5
- const fs = require('fs');
6
- const glob = require('glob');
7
- const eol = require('eol');
8
-
9
- const sourcePath = path.join(process.cwd(), 'packages', 'eui', 'packages');
10
-
11
- const migrateFilesWithExtensions = () => {
12
- return Promise.resolve()
13
- .then(() => {
14
- return new Promise((resolve, reject) => {
15
- glob(sourcePath + "/**/*.eui8",
16
- function (err, files) {
17
- if (err) {
18
- return reject(err);
19
- } else {
20
- var processed = 0;
21
- files.forEach(function (file) {
22
- const dir = path.dirname(file);
23
- const filename = path.basename(file);
24
- tools.logInfo('replacing eUI8 file : ' + filename + ' in ' + dir);
25
- const filenameUpdate = filename.substr(0, filename.indexOf('.eui8'));
26
- fs.renameSync(file, dir + "/" + filenameUpdate);
27
- processed++;
28
- });
29
- console.log(processed + " files processed");
30
- resolve();
31
- }
32
- });
33
- })
34
- })
35
- .catch((e) => {
36
- throw e;
37
- })
38
- }
39
-
40
-
41
- const migrateFilesWithComments = () => {
42
- return new Promise((resolve, reject) => {
43
- glob('**/*.ts', { cwd: sourcePath, nodir: true, follow: true, dot: true }, (err, files) => {
44
- if (err) reject(err);
45
- files.forEach(file => {
46
- const inFile = path.join(sourcePath, file);
47
-
48
- return Promise.resolve()
49
- .then(() => {
50
- return fs.readFileSync(inFile, { encoding: 'utf8' });
51
- })
52
- .then((content) => {
53
- if (content.indexOf('EUI8-REMOVE') === -1) {
54
- return;
55
- }
56
- return Promise.resolve()
57
- .then(() => {
58
- content = eol.lf(content.toString());
59
- return content.replace(/^.*EUI8-REMOVE.*$/mg, '// EUI8-REPLACE\n// tslint:disable-next-line');
60
- })
61
- .then((content) => {
62
- return content.replace(/\/\* EUI8-KEEP\n((?:.*\n)*)(?: *\*\/)/gm, '$1\n// tslint:disable-next-line');
63
- })
64
- .then((content) => {
65
- console.log('..processing ' + inFile);
66
- return fs.writeFileSync(inFile, content);
67
- })
68
- .catch((e) => {
69
- throw e;
70
- })
71
- })
72
- .catch((e) => {
73
- throw e;
74
- })
75
- });
76
- resolve();
77
- })
78
- });
79
- }
80
-
81
-
82
- return Promise.resolve()
83
- .then(() => {
84
- return migrateFilesWithComments();
85
- })
86
- .then(() => {
87
- return migrateFilesWithExtensions();
88
- })
89
- .catch((e) => {
90
- console.log(e);
91
- process.exit(1);
92
- })
93
-
94
-
@@ -1,191 +0,0 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
- const replace = require('replace-in-file');
5
- const glob = require('glob');
6
- const semver = require('semver');
7
- const fs = require('fs');
8
-
9
- const tools = require('./tools');
10
- const configUtils = require('../config/config-utils');
11
-
12
-
13
-
14
-
15
- const migratePackage = (pkgName) => {
16
-
17
- const pkg = configUtils.packages.getPackage(pkgName);
18
-
19
- console.log(pkg);
20
-
21
- tools.logTitle(`Migrating package ${pkg.name}`);
22
-
23
- const sourcePath = path.join(process.cwd(), 'packages', pkg.name);
24
- const targetPath = path.join(process.cwd(), 'packages', pkg.name + '_7')
25
- const samplePath = path.join(process.cwd(), 'packages/eui/tools/migration/sample-package');
26
-
27
- return Promise.resolve()
28
- .then(() => {
29
- console.log(pkg);
30
- console.log(sourcePath);
31
- console.log(targetPath);
32
- console.log(samplePath);
33
- })
34
- .then(() => {
35
- return tools.copydir(samplePath, targetPath);
36
- })
37
- .then(() => {
38
- const pkgVersion = require(path.join(sourcePath, 'package.json')).version;
39
- const newVersion = semver.inc(pkgVersion, 'major');
40
- console.log('NEW VERSION : ' + newVersion);
41
- return replace({
42
- files: [targetPath + '/**/*.*'], from: /%VERSION%/g, to: newVersion
43
- })
44
- })
45
- .then(() => {
46
- return tools.copy(path.join(sourcePath, 'src/lib', 'index.ts'), path.join(targetPath, 'src', 'index.ts'));
47
- })
48
- .then(() => {
49
- return tools.copy(path.join(sourcePath, 'tslint.json.eui7'), path.join(targetPath, 'tslint.json'));
50
- })
51
- .then(() => {
52
- return tools.copy(path.join(sourcePath, 'CHANGELOG.md'), path.join(targetPath, 'CHANGELOG.md'));
53
- })
54
- .then(() => {
55
- return tools.copydir(path.join(sourcePath, 'src/lib/src'), path.join(targetPath, 'src/lib'));
56
- })
57
- .then(() => {
58
- return tools.copydir(path.join(sourcePath, 'assets'), path.join(targetPath, 'assets'));
59
- })
60
- .then(() => {
61
- return replace({
62
- files: [targetPath + '/**/*.*'], from: /%PACKAGE_NAME%/g, to: pkg.name
63
- })
64
- })
65
- .then(() => {
66
- return replace({
67
- files: [targetPath + '/**/*.*'], from: /%NAME%/g, to: pkg.npmPkgName
68
- })
69
- })
70
- .then(() => {
71
- return replace({
72
- files: [targetPath + '/**/*.*'], from: /%SCOPE%/g, to: pkg.npmPkgScope.substr(1)
73
- })
74
- })
75
- .then(() => {
76
- return replace({
77
- files: [targetPath + '/**/*.*'], from: /@eui\/ux-core/g, to: '@eui/core'
78
- })
79
- })
80
- .then(() => {
81
- return replace({
82
- files: [targetPath + '/**/*.*'], from: /@eui\/ux-commons/g, to: '@eui/core'
83
- })
84
- })
85
- .then(() => {
86
- return replace({
87
- files: [targetPath + '/**/*.*'], from: /angular2-moment/g, to: 'ngx-moment'
88
- })
89
- })
90
-
91
-
92
- // KNOWN COMMON MIGRATION rxjs / ngRx
93
- .then(() => {
94
- return replace({
95
- files: [targetPath + '/**/*.*'], from: /new ErrorObservable\(/g, to: 'Observable.throwError('
96
- })
97
- })
98
- .then(() => {
99
- return replace({
100
- files: [targetPath + '/**/*.*'], from: /ErrorObservable {/g, to: 'Observable<any> {'
101
- })
102
- })
103
- // .then(() => {
104
- // return replace({
105
- // files: [targetPath + '/**/*.*'],from: / } from \'@ngrx\/effects\'/g,to: ', ofType } from \'@ngrx/effects\''})
106
- // })
107
-
108
- .then(() => {
109
- return replace({
110
- files: [path.join(targetPath, 'src', 'index.ts')], from: /.\/src/g, to: './lib'
111
- })
112
- })
113
-
114
- .then(() => {
115
- return tools.rmdirFull(sourcePath, false);
116
- })
117
- .then(() => {
118
- return tools.rimraf(path.join(sourcePath,'src'));
119
- })
120
- .then(() => {
121
- return tools.rimraf(path.join(sourcePath,'assets'));
122
- })
123
- .then(() => {
124
- return tools.rimraf(path.join(sourcePath,'.scannerwork'));
125
- })
126
- .then(() => {
127
- return tools.copydir(targetPath, sourcePath);
128
- })
129
- .then(() => {
130
- return tools.rimraf(targetPath);
131
- })
132
- .then(() => {
133
- return new Promise((resolve, reject) => {
134
- glob(sourcePath + "/**/*.eui7",
135
- function (err, files) {
136
- if (err) {
137
- return reject(err);
138
- } else {
139
- var processed = 0;
140
- files.forEach(function (file) {
141
- const dir = path.dirname(file);
142
- const filename = path.basename(file);
143
- tools.logInfo('replacing eUI7 file : ' + filename + ' in ' + dir);
144
- const filenameUpdate = filename.substr(0, filename.indexOf('.eui7'));
145
- fs.renameSync(file, dir + "/" + filenameUpdate);
146
- processed++;
147
- });
148
- console.log(processed + " files processed");
149
- resolve();
150
- }
151
- });
152
- })
153
- })
154
-
155
- .then(() => {
156
- tools.logSuccess('OK => package migrated');
157
- })
158
-
159
- .catch((e) => {
160
- throw e;
161
- })
162
- }
163
-
164
-
165
- module.exports.migratePackages = () => {
166
- tools.logTitle('Migrating packages');
167
-
168
- const packages = configUtils.packages.getPackages();
169
-
170
- return Promise.resolve()
171
- .then(() => Promise.resolve().then(() => {
172
- return packages.reduce((promise, pkg) => {
173
- return promise.then(() => (
174
- migratePackage(pkg)
175
- ));
176
- }, Promise.resolve());
177
- }))
178
-
179
- .then(() => {
180
- tools.logSuccess('OK => all packages successfully migrated');
181
- })
182
-
183
- .catch((e) => {
184
- throw e;
185
- })
186
- }
187
-
188
-
189
- // EXPORTS
190
-
191
- module.exports.migratePackage = migratePackage;