@wavemaker/rn-codegen 11.16.1-rc.270 → 11.16.2-rc.271
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/npm-shrinkwrap.json +289 -273
- package/package-lock.json +289 -273
- package/package.json +3 -3
- package/scripts/check-deps-compat.js +554 -0
- package/src/app.generator.js +109 -70
- package/src/app.generator.js.map +1 -1
- package/src/pipeline/build-pipeline.js +19 -2
- package/src/pipeline/build-pipeline.js.map +1 -1
- package/src/pipeline/generation-store.js +43 -22
- package/src/pipeline/generation-store.js.map +1 -1
- package/src/pipeline/shared-node-modules.js +172 -13
- package/src/pipeline/shared-node-modules.js.map +1 -1
- package/src/templates/app.template +20 -0
- package/src/templates/bootstrap.template +2 -1
- package/src/templates/foundation-theme/build/android/wavemaker/components/input/epoch/date.less +8 -1
- package/src/templates/foundation-theme/build/android/wavemaker/components/input/epoch/datetime.less +8 -1
- package/src/templates/foundation-theme/build/android/wavemaker/components/input/epoch/time.less +8 -1
- package/src/templates/foundation-theme/build/android/wavemaker/components/input/number.less +14 -0
- package/src/templates/foundation-theme/build/android/wavemaker/design-tokens/basic/button.less +2 -2
- package/src/templates/foundation-theme/build/android/wavemaker/design-tokens/input/checkboxset.less +1 -0
- package/src/templates/foundation-theme/build/android/wavemaker/design-tokens/input/chips.less +12 -0
- package/src/templates/foundation-theme/build/android/wavemaker/design-tokens/input/radioset.less +1 -1
- package/src/templates/foundation-theme/build/android/wavemaker/design-tokens/studio/input/currency.less +6 -2
- package/src/templates/foundation-theme/build/android/wavemaker/design-tokens/tokens.light.css +3 -2
- package/src/templates/foundation-theme/build/android/wavemaker/design-tokens/variables/button.variant.less +2 -2
- package/src/templates/foundation-theme/build/ios/wavemaker/components/input/epoch/date.less +8 -1
- package/src/templates/foundation-theme/build/ios/wavemaker/components/input/epoch/datetime.less +8 -1
- package/src/templates/foundation-theme/build/ios/wavemaker/components/input/epoch/time.less +8 -1
- package/src/templates/foundation-theme/build/ios/wavemaker/components/input/number.less +14 -0
- package/src/templates/foundation-theme/build/ios/wavemaker/design-tokens/basic/button.less +2 -2
- package/src/templates/foundation-theme/build/ios/wavemaker/design-tokens/input/checkboxset.less +1 -0
- package/src/templates/foundation-theme/build/ios/wavemaker/design-tokens/input/chips.less +12 -0
- package/src/templates/foundation-theme/build/ios/wavemaker/design-tokens/input/radioset.less +1 -1
- package/src/templates/foundation-theme/build/ios/wavemaker/design-tokens/studio/input/currency.less +6 -2
- package/src/templates/foundation-theme/build/ios/wavemaker/design-tokens/tokens.light.css +3 -2
- package/src/templates/foundation-theme/build/ios/wavemaker/design-tokens/variables/button.variant.less +2 -2
- package/src/templates/foundation-theme/dist/android/style.css +5 -4
- package/src/templates/foundation-theme/dist/android/style.js +22 -9
- package/src/templates/foundation-theme/dist/android/tokens.js +3 -2
- package/src/templates/foundation-theme/dist/ios/style.css +5 -4
- package/src/templates/foundation-theme/dist/ios/style.js +22 -9
- package/src/templates/foundation-theme/dist/ios/tokens.js +3 -2
- package/src/templates/foundation-theme/wavemaker/components/input/epoch/date.less +8 -1
- package/src/templates/foundation-theme/wavemaker/components/input/epoch/datetime.less +8 -1
- package/src/templates/foundation-theme/wavemaker/components/input/epoch/time.less +8 -1
- package/src/templates/foundation-theme/wavemaker/components/input/number.less +14 -0
- package/src/templates/foundation-theme/wavemaker/design-tokens/basic/button.less +2 -2
- package/src/templates/foundation-theme/wavemaker/design-tokens/input/checkboxset.less +1 -0
- package/src/templates/foundation-theme/wavemaker/design-tokens/input/chips.less +12 -0
- package/src/templates/foundation-theme/wavemaker/design-tokens/input/radioset.less +1 -1
- package/src/templates/foundation-theme/wavemaker/design-tokens/studio/input/currency.less +6 -2
- package/src/templates/foundation-theme/wavemaker/design-tokens/tokens.light.css +3 -2
- package/src/templates/foundation-theme/wavemaker/design-tokens/variables/button.variant.less +2 -2
- package/src/templates/package.web.json +10 -5
- package/src/templates/project/metro/metro.script.js +19 -2
- package/src/templates/project/metro/vendor-cache.js +1 -1
- package/src/templates/project/metro/wm-boundary.js +40 -28
- package/src/templates/project/metro/wm-crawl-override.js +16 -2
- package/src/templates/project/metro/wm-prebuilt.js +31 -0
- package/src/templates/project/package-lock.json +13214 -0
- package/src/templates/project/package.json +10 -5
- package/src/templates/project/wavepulse/rn2css.json +5 -0
- package/src/theme/components/input/epoch/datetime.styledef.js +5 -0
- package/src/theme/components/input/epoch/datetime.styledef.js.map +1 -1
- package/src/theme/components/input/number.styledef.js +10 -0
- package/src/theme/components/input/number.styledef.js.map +1 -1
- package/src/transpile/bind.ex.transformer.js +109 -5
- package/src/transpile/bind.ex.transformer.js.map +1 -1
- package/src/transpile/components/data/form/form-field.transformer.js +25 -1
- package/src/transpile/components/data/form/form-field.transformer.js.map +1 -1
- package/test/pipeline/build-leftovers.test.js +172 -0
- package/test/pipeline/build-leftovers.test.js.map +1 -0
- package/test/pipeline/chmod-tree.test.js +54 -0
- package/test/pipeline/chmod-tree.test.js.map +1 -0
- package/test/pipeline/crawl-override.test.js +53 -0
- package/test/pipeline/crawl-override.test.js.map +1 -0
package/src/app.generator.js
CHANGED
|
@@ -44,6 +44,7 @@ const execa_1 = __importDefault(require("execa"));
|
|
|
44
44
|
const semver_1 = __importDefault(require("semver"));
|
|
45
45
|
const path_2 = __importDefault(require("path"));
|
|
46
46
|
const transpile_1 = require("./transpile/transpile");
|
|
47
|
+
const wm_namespace_1 = require("./wm-namespace");
|
|
47
48
|
const variable_transformer_1 = __importDefault(require("./variables/variable.transformer"));
|
|
48
49
|
const utils_1 = require("./utils");
|
|
49
50
|
const bind_ex_transformer_1 = __importDefault(require("./transpile/bind.ex.transformer"));
|
|
@@ -53,6 +54,8 @@ const app_override_css_generator_1 = require("./theme/app-override-css.generator
|
|
|
53
54
|
const command_1 = require("../command");
|
|
54
55
|
const web_preview_templates_1 = require("./pipeline/web-preview-templates");
|
|
55
56
|
const working_set_1 = require("./pipeline/working-set");
|
|
57
|
+
// Shared with the CLI and the release build (scripts/build.js copies it next to post-build.js).
|
|
58
|
+
const depsCompat = require(path_2.default.join(__dirname, '..', 'scripts', 'check-deps-compat.js'));
|
|
56
59
|
const APP_TEMPLATE = (0, utils_1.loadTemplate)(__dirname + '/templates/app.template');
|
|
57
60
|
const APP_THEME_TEMPLATE = (0, utils_1.loadTemplate)(__dirname + '/templates/app.theme.template');
|
|
58
61
|
const BABEL_CONFIG_TEMPLATE = (0, utils_1.loadTemplate)(__dirname + '/templates/babel.config.js.template');
|
|
@@ -579,6 +582,14 @@ class AppGenerator {
|
|
|
579
582
|
var _a, _b;
|
|
580
583
|
(_b = (_a = appConfigOverride === null || appConfigOverride === void 0 ? void 0 : appConfigOverride.expo) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.forEach((plugin) => {
|
|
581
584
|
var _a, _b;
|
|
585
|
+
// Expo's web export loads every config plugin; a missing local one fails the preview.
|
|
586
|
+
const pluginName = Array.isArray(plugin) ? plugin[0] : plugin;
|
|
587
|
+
if (this.isWebPreview && typeof pluginName === 'string' && /^\.\.?\//.test(pluginName)
|
|
588
|
+
&& !['', '.js', '.ts', '/index.js', '/index.ts', '/app.plugin.js']
|
|
589
|
+
.some(ext => fs_extra_1.default.existsSync(path_2.default.resolve(this.projectPath, pluginName + ext)))) {
|
|
590
|
+
console.warn(`Skipping config plugin ${pluginName} in web preview: no such file in the project.`);
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
582
593
|
if ((_a = appConfig === null || appConfig === void 0 ? void 0 : appConfig.expo) === null || _a === void 0 ? void 0 : _a.plugins) {
|
|
583
594
|
const presentInIndex = appConfig.expo.plugins.findIndex((item) => item[0] === plugin[0]);
|
|
584
595
|
if (presentInIndex > -1 && Array.isArray(appConfig.expo.plugins[presentInIndex])) {
|
|
@@ -1306,7 +1317,7 @@ class AppGenerator {
|
|
|
1306
1317
|
if (stat.isDirectory()) {
|
|
1307
1318
|
scanDirectory(fullPath);
|
|
1308
1319
|
}
|
|
1309
|
-
else if (file.endsWith('.js') || file.endsWith('.ts') || file.endsWith('.tsx')) {
|
|
1320
|
+
else if (file.endsWith('.js') || file.endsWith('.jsx') || file.endsWith('.ts') || file.endsWith('.tsx')) {
|
|
1310
1321
|
try {
|
|
1311
1322
|
// Ignore checking for package imports in ignore list file names
|
|
1312
1323
|
if (scanFileIgnoreList.includes(file)) {
|
|
@@ -1339,6 +1350,8 @@ class AppGenerator {
|
|
|
1339
1350
|
const scanPaths = [
|
|
1340
1351
|
`${this.projectPath}/src`,
|
|
1341
1352
|
`${this.projectPath}/assets/resources`,
|
|
1353
|
+
// wmx components (compiled to .jsx) import their own packages, e.g. the barcode scanner's expo-camera.
|
|
1354
|
+
`${this.projectPath}/wmx-components/src`,
|
|
1342
1355
|
// Stubbed pages have no generated script; scan their sources so their packages are kept.
|
|
1343
1356
|
...(this.isWebPreview && (0, working_set_1.workingSetEnabled)(this.projectService.path) ? [`${this.projectService.path}/pages`] : []),
|
|
1344
1357
|
];
|
|
@@ -1569,6 +1582,36 @@ class AppGenerator {
|
|
|
1569
1582
|
(0, utils_1.writeFile)(`${this.projectPath}/app.json`, JSON.stringify(appJson, null, 4));
|
|
1570
1583
|
}
|
|
1571
1584
|
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Packages the project adds itself: wm_rn_config.json plugins, prefab npm:// scripts and wmx component
|
|
1587
|
+
* dependencies. Only WaveMaker's own packages are pruned, so these stay even when the template also ships
|
|
1588
|
+
* them (e.g. expo-camera needed by a custom plugin), and npm keeps whatever they depend on.
|
|
1589
|
+
*/
|
|
1590
|
+
async getProjectAddedPackages() {
|
|
1591
|
+
var _a, _b, _c;
|
|
1592
|
+
const names = new Set();
|
|
1593
|
+
const config = fs_extra_1.default.readJsonSync(`${this.projectPath}/wm_rn_config.json`, { throws: false });
|
|
1594
|
+
[...((config === null || config === void 0 ? void 0 : config.plugins) || []), ...((config === null || config === void 0 ? void 0 : config.customPlugins) || [])]
|
|
1595
|
+
.forEach((p) => (p === null || p === void 0 ? void 0 : p.name) && names.add(p.name));
|
|
1596
|
+
const wmxDependencies = (_a = fs_extra_1.default.readJsonSync(`${this.projectPath}/wmx-components/package.json`, { throws: false })) === null || _a === void 0 ? void 0 : _a.dependencies;
|
|
1597
|
+
Object.keys(wmxDependencies || {}).forEach((name) => names.add(name));
|
|
1598
|
+
for (const prefab of Object.keys(this.transpiledComponents.prefabs || {})) {
|
|
1599
|
+
try {
|
|
1600
|
+
const info = await this.projectService.getPrefabInfo(prefab);
|
|
1601
|
+
(((_c = (_b = info === null || info === void 0 ? void 0 : info.config) === null || _b === void 0 ? void 0 : _b.resources) === null || _c === void 0 ? void 0 : _c.scripts) || []).forEach((script) => {
|
|
1602
|
+
var _a;
|
|
1603
|
+
const name = script.includes('npm://') && ((_a = script.match(/[\/]+(.*?)@\d/)) === null || _a === void 0 ? void 0 : _a[1]);
|
|
1604
|
+
if (name) {
|
|
1605
|
+
names.add(name);
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
catch (e) {
|
|
1610
|
+
console.warn(`Could not read prefab ${prefab} config: ${e.message}`);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
return names;
|
|
1614
|
+
}
|
|
1572
1615
|
/**
|
|
1573
1616
|
* remove unused dependencies from package.json
|
|
1574
1617
|
* @param packageJsonData
|
|
@@ -1581,6 +1624,7 @@ class AppGenerator {
|
|
|
1581
1624
|
let removedPackages = [];
|
|
1582
1625
|
try {
|
|
1583
1626
|
const dependencies = (0, lodash_1.cloneDeep)(this.projectPackageDependencies);
|
|
1627
|
+
const projectAddedPackages = await this.getProjectAddedPackages();
|
|
1584
1628
|
const listOfPackagesUsed = await this.getListOfPackagesUsedInGeneratedApp();
|
|
1585
1629
|
const operationsUsed = Object.entries(listOfPackagesUsed)
|
|
1586
1630
|
.map(([key, value]) => {
|
|
@@ -1619,6 +1663,10 @@ class AppGenerator {
|
|
|
1619
1663
|
if (isPackageUsedByOtherOperation) {
|
|
1620
1664
|
return;
|
|
1621
1665
|
}
|
|
1666
|
+
if (projectAddedPackages.has(p)) {
|
|
1667
|
+
console.log(`Keeping package ${p}: added by the project (plugin, prefab or wmx component)`);
|
|
1668
|
+
return;
|
|
1669
|
+
}
|
|
1622
1670
|
delete updatedPackageJson.dependencies[p];
|
|
1623
1671
|
if (!removedPackages.includes(p)) {
|
|
1624
1672
|
removedPackages.push(p);
|
|
@@ -1659,15 +1707,28 @@ class AppGenerator {
|
|
|
1659
1707
|
await (0, command_1.npmInstall)(`${this.projectPath}`);
|
|
1660
1708
|
}
|
|
1661
1709
|
}
|
|
1710
|
+
// Report only; "dependencyCheck": false in wm_rn_config.json turns it off.
|
|
1711
|
+
reportCustomDependencies() {
|
|
1712
|
+
if (this.rnConfig.dependencyCheck === false) {
|
|
1713
|
+
return Promise.resolve();
|
|
1714
|
+
}
|
|
1715
|
+
return depsCompat.reportCustomDependencies(this.projectPath, {
|
|
1716
|
+
baseDir: profile_1.default.packageLockFilePath ? path_2.default.dirname(profile_1.default.packageLockFilePath) : `${__dirname}/templates/project`,
|
|
1717
|
+
ownScope: wm_namespace_1.WM_NPM_SCOPE,
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1662
1720
|
async copyPackageLockJson() {
|
|
1663
|
-
|
|
1721
|
+
const hadLock = fs_extra_1.default.existsSync(`${this.projectPath}/package-lock.json`);
|
|
1722
|
+
if (!depsCompat.syncBaseLock(this.projectPath, profile_1.default.packageLockFilePath)) {
|
|
1664
1723
|
return;
|
|
1665
1724
|
}
|
|
1666
1725
|
if (this.incBuilder) {
|
|
1667
1726
|
console.log(`Copying package-lock.json .`);
|
|
1668
1727
|
}
|
|
1669
|
-
if (
|
|
1670
|
-
|
|
1728
|
+
if (hadLock) {
|
|
1729
|
+
// A replaced lock no longer lists the custom packages, so the next install must run to add them back
|
|
1730
|
+
// (it otherwise only runs when package.json changes).
|
|
1731
|
+
fs_extra_1.default.removeSync(`${this.projectPath}/dependencies.info`);
|
|
1671
1732
|
}
|
|
1672
1733
|
if (profile_1.default.yarnLockFilePath && fs_extra_1.default.existsSync(profile_1.default.yarnLockFilePath)) {
|
|
1673
1734
|
fs_extra_1.default.copySync(profile_1.default.yarnLockFilePath, `${this.projectPath}/yarn.json`);
|
|
@@ -1793,70 +1854,44 @@ class AppGenerator {
|
|
|
1793
1854
|
let plugins = config.plugins;
|
|
1794
1855
|
let data = fs_extra_1.default.readFileSync(`${this.projectPath}/package.json`, 'utf-8');
|
|
1795
1856
|
const jsonData = JSON.parse(data);
|
|
1796
|
-
|
|
1797
|
-
const
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
});
|
|
1816
|
-
plugins.forEach((p) => {
|
|
1817
|
-
if (p.spec) {
|
|
1818
|
-
if (p.spec.includes('tgz')) {
|
|
1819
|
-
jsonData['dependencies'][p.name] = 'file:' + p.spec;
|
|
1820
|
-
shouldNpmInstall = true;
|
|
1821
|
-
}
|
|
1822
|
-
else if (semver_1.default.valid(p.spec) && !semver_1.default.lt(p.spec, jsonData['dependencies'][p.name] || '0.0.0')) {
|
|
1823
|
-
jsonData['dependencies'][p.name] = p.spec;
|
|
1824
|
-
shouldNpmInstall = true;
|
|
1825
|
-
}
|
|
1826
|
-
else if (!semver_1.default.valid(p.spec)) {
|
|
1827
|
-
jsonData['dependencies'][p.name] = p.spec;
|
|
1828
|
-
shouldNpmInstall = true;
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
});
|
|
1832
|
-
if (shouldNpmInstall) {
|
|
1833
|
-
this.shouldNpmInstall = true;
|
|
1834
|
-
}
|
|
1835
|
-
fs_extra_1.default.writeFileSync(`${this.projectPath}/package.json`, JSON.stringify(jsonData, null, 4));
|
|
1836
|
-
});
|
|
1837
|
-
}
|
|
1838
|
-
else {
|
|
1839
|
-
plugins.forEach((p) => {
|
|
1840
|
-
if (p.spec) {
|
|
1841
|
-
if (p.spec.includes('tgz')) {
|
|
1842
|
-
jsonData['dependencies'][p.name] = 'file:' + p.spec;
|
|
1843
|
-
shouldNpmInstall = true;
|
|
1844
|
-
}
|
|
1845
|
-
else if (semver_1.default.valid(p.spec) && !semver_1.default.lt(p.spec, jsonData['dependencies'][p.name] || '0.0.0')) {
|
|
1846
|
-
jsonData['dependencies'][p.name] = p.spec;
|
|
1847
|
-
shouldNpmInstall = true;
|
|
1848
|
-
}
|
|
1849
|
-
else if (!semver_1.default.valid(p.spec)) {
|
|
1850
|
-
jsonData['dependencies'][p.name] = p.spec;
|
|
1851
|
-
shouldNpmInstall = true;
|
|
1852
|
-
}
|
|
1857
|
+
// Plugins added by an earlier build and since removed from wm_rn_config.json are dropped from package.json.
|
|
1858
|
+
const addedPluginsPath = `${this.projectPath}/.wm-config-plugins.json`;
|
|
1859
|
+
const configured = plugins.filter((p) => p.spec).map((p) => p.name);
|
|
1860
|
+
const templateDependencies = fs_extra_1.default.readJSONSync(`${__dirname}/templates/project/package.json`).dependencies;
|
|
1861
|
+
// Only a record of earlier builds: an unreadable one just means nothing is removed this time.
|
|
1862
|
+
(fs_extra_1.default.readJSONSync(addedPluginsPath, { throws: false }) || [])
|
|
1863
|
+
.filter((name) => !configured.includes(name) && !templateDependencies[name] && jsonData.dependencies[name])
|
|
1864
|
+
.forEach((name) => {
|
|
1865
|
+
console.log(`Removing plugin ${name}: no longer in wm_rn_config.json`);
|
|
1866
|
+
delete jsonData.dependencies[name];
|
|
1867
|
+
this.shouldNpmInstall = true;
|
|
1868
|
+
});
|
|
1869
|
+
fs_extra_1.default.writeJSONSync(addedPluginsPath, configured);
|
|
1870
|
+
// Every prefab's npm:// package is in package.json before the compatibility check runs.
|
|
1871
|
+
await Promise.all(Object.keys(this.transpiledComponents.prefabs || {}).map((prefab) => this.projectService.getPrefabInfo(prefab).then(info => {
|
|
1872
|
+
var _a;
|
|
1873
|
+
(_a = info.config["resources"]["scripts"]) === null || _a === void 0 ? void 0 : _a.forEach((script) => {
|
|
1874
|
+
if (script.includes('npm://')) {
|
|
1875
|
+
jsonData['dependencies'][script.match(/[\/]+(.*?)@\d/)[1]] = script.match('.*@(.*?)$')[1];
|
|
1853
1876
|
}
|
|
1854
1877
|
});
|
|
1855
|
-
|
|
1856
|
-
|
|
1878
|
+
})));
|
|
1879
|
+
plugins.forEach((p) => {
|
|
1880
|
+
if (!p.spec) {
|
|
1881
|
+
return;
|
|
1857
1882
|
}
|
|
1858
|
-
|
|
1859
|
-
|
|
1883
|
+
if (p.spec.includes('tgz')) {
|
|
1884
|
+
jsonData['dependencies'][p.name] = 'file:' + p.spec;
|
|
1885
|
+
}
|
|
1886
|
+
else if (!semver_1.default.valid(p.spec) || !semver_1.default.lt(p.spec, semver_1.default.valid(jsonData['dependencies'][p.name]) || '0.0.0')) {
|
|
1887
|
+
jsonData['dependencies'][p.name] = p.spec;
|
|
1888
|
+
}
|
|
1889
|
+
else {
|
|
1890
|
+
return;
|
|
1891
|
+
}
|
|
1892
|
+
this.shouldNpmInstall = true;
|
|
1893
|
+
});
|
|
1894
|
+
fs_extra_1.default.writeFileSync(`${this.projectPath}/package.json`, JSON.stringify(jsonData, null, 4));
|
|
1860
1895
|
}
|
|
1861
1896
|
async generateFoundationTheme() {
|
|
1862
1897
|
await new app_override_css_generator_1.AppOverrideCSSGenerator(this.projectService.path).generate();
|
|
@@ -1970,6 +2005,7 @@ class AppGenerator {
|
|
|
1970
2005
|
}
|
|
1971
2006
|
async generateApp() {
|
|
1972
2007
|
this.rnConfig = await this.projectService.getRNConfig().then(data => JSON.parse(data));
|
|
2008
|
+
const customPackagesChanged = !this.incBuilder || this.incBuilder.isConfigModified() || this.incBuilder.isPrefabModified();
|
|
1973
2009
|
// templates/project/metro/ (the split-bundle build) is only needed by
|
|
1974
2010
|
// the web-preview profile; every other profile skips it.
|
|
1975
2011
|
const templatesRoot = __dirname + '/templates/project';
|
|
@@ -1978,10 +2014,15 @@ class AppGenerator {
|
|
|
1978
2014
|
}
|
|
1979
2015
|
this.incBuilder || this.timed('copy templates', () => fs_extra_1.default.copySync(templatesRoot, this.projectPath, {
|
|
1980
2016
|
filter: (src) => {
|
|
2017
|
+
const rel = path_2.default.relative(templatesRoot, src);
|
|
2018
|
+
// The template lock is input for the rn-app package, not a project file: copying it
|
|
2019
|
+
// would make copyPackageLockJson skip the rn-app lock the profile points at.
|
|
2020
|
+
if (rel === 'package-lock.json') {
|
|
2021
|
+
return false;
|
|
2022
|
+
}
|
|
1981
2023
|
if (this.isWebPreview) {
|
|
1982
2024
|
return true;
|
|
1983
2025
|
}
|
|
1984
|
-
const rel = path_2.default.relative(templatesRoot, src);
|
|
1985
2026
|
return rel !== 'metro' && !rel.startsWith(`metro${path_1.sep}`);
|
|
1986
2027
|
}
|
|
1987
2028
|
}));
|
|
@@ -2032,12 +2073,10 @@ class AppGenerator {
|
|
|
2032
2073
|
}
|
|
2033
2074
|
}).then(() => !this.incBuilder)
|
|
2034
2075
|
.then((build) => (this.prepareDeviceOperationLoader()))
|
|
2035
|
-
.then(() =>
|
|
2036
|
-
|| this.incBuilder.isConfigModified()
|
|
2037
|
-
|| this.incBuilder.isPrefabModified())
|
|
2038
|
-
.then((build) => (build && this.addCustomPluginsToPackageJson()))
|
|
2076
|
+
.then(() => customPackagesChanged ? this.addCustomPluginsToPackageJson() : undefined)
|
|
2039
2077
|
.then(() => this.timed('package.json merge (incl. wmx-component npm install+build)', () => this.mergePackageJson()))
|
|
2040
2078
|
.then(() => this.copyPackageLockJson())
|
|
2079
|
+
.then(() => customPackagesChanged ? this.timed('custom package report', () => this.reportCustomDependencies()) : undefined)
|
|
2041
2080
|
.then(() => this.checkWidgetUsageInComponentFiles())
|
|
2042
2081
|
.then(() => this.checkPackageUsageInJSFiles())
|
|
2043
2082
|
// Web preview: mergePackageJson re-adds the project's package.json override every build, which brings
|