@superdesk/build-tools 1.0.19 → 1.1.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdesk/build-tools",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"gettext-extractor": "3.5.3",
|
|
15
15
|
"gettext.js": "0.9.0",
|
|
16
16
|
"glob": "7.1.7",
|
|
17
|
-
"lodash": "4.17.19",
|
|
18
17
|
"rimraf": "3.0.2"
|
|
19
18
|
}
|
|
20
19
|
}
|
|
@@ -110,7 +110,7 @@ function getExtensionDirectoriesSync(clientPath) {
|
|
|
110
110
|
.then((res) => res.default),
|
|
111
111
|
}
|
|
112
112
|
*/
|
|
113
|
-
var extensionRegistrationPattern = /id:\W*'(.*)',\W*load:\W*import\('(.+?)'/g;
|
|
113
|
+
var extensionRegistrationPattern = /id:\W*['"](.*)['"],\W*load:\W*import\(['"](.+?)['"]/g;
|
|
114
114
|
|
|
115
115
|
const matches = [];
|
|
116
116
|
|
|
@@ -83,6 +83,24 @@ module.exports = function installExtensions(clientDir) {
|
|
|
83
83
|
directories.forEach(({extensionRootPath, extensionSrcPath}) => {
|
|
84
84
|
// if src dir doesn't exist, assume that the extension is already built (e.g. when installed from npm)
|
|
85
85
|
if (fs.existsSync(extensionSrcPath)) {
|
|
86
|
+
const pkgPath = path.join(extensionRootPath, 'package.json');
|
|
87
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
88
|
+
|
|
89
|
+
// Extensions whose `main` points at TypeScript source are consumed
|
|
90
|
+
// directly by webpack's ts-loader. Skip compile and the legacy
|
|
91
|
+
// `correct*` fixups. Still install runtime `dependencies` so webpack
|
|
92
|
+
// can resolve them via the extension's nested node_modules walk.
|
|
93
|
+
// (When workspaces land, this per-extension install goes away.)
|
|
94
|
+
if (typeof pkg.main === 'string' && /\.(ts|tsx)$/.test(pkg.main)) {
|
|
95
|
+
if (pkg.dependencies && Object.keys(pkg.dependencies).length > 0) {
|
|
96
|
+
execSync(
|
|
97
|
+
'npm install --no-audit --omit=dev',
|
|
98
|
+
{stdio: 'inherit', cwd: extensionRootPath}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
86
104
|
correctApiDefinitionsPath(extensionRootPath, clientDir);
|
|
87
105
|
|
|
88
106
|
execSync(
|
package/src/po-to-json/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
var fs = require('fs');
|
|
2
2
|
var path = require('path');
|
|
3
3
|
var execSync = require('child_process').execSync;
|
|
4
|
-
var _ = require('lodash');
|
|
5
4
|
const {isDirectory} = require('../utils');
|
|
6
5
|
|
|
7
6
|
function getModuleDir(moduleName) {
|
|
@@ -90,7 +89,7 @@ function compileTranslationsPoToJson(translationsPoDir, translationsJsonDir) {
|
|
|
90
89
|
return;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
if (
|
|
92
|
+
if (filename.endsWith('.po') !== true) {
|
|
94
93
|
return;
|
|
95
94
|
}
|
|
96
95
|
|