feat(smart-app): implement complete mobile app MVP

- App.tsx: full navigation (Auth stack + Main tabs with 5 screens)
- Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen
- HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors
- MapScreen: interactive map with layer toggles (6 layers)
- MarketplaceScreen: categories (6), products (5), search
- ChatScreen: AI chat with quick prompts (4), bot responses
- ProfileScreen: user info, stats, menu (9 items), logout
- AlertsScreen: alert list with severity, acknowledge
- SensorsScreen: sensor list with type filters (6 types), search
- ZonesScreen: zone cards with stats
- SettingsScreen: language picker (FR/EN/ES/DE), privacy, about
- Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n
- Hooks: useSensors, useAlerts, useNotifications, useLocation
- Components: Card, Button, LoadingSpinner, ErrorBoundary, Header
- Services: iotService, notificationService (with axios API client)
- Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN)
- Theme: colors.ts with full design system (Blue Ocean palette)
- Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
This commit is contained in:
Eric FELIXINE
2026-06-01 18:00:35 -04:00
parent 08ca495bde
commit e30ae8ed09
35578 changed files with 3703534 additions and 43 deletions

View File

@@ -0,0 +1,3 @@
export declare function getBunVersionIfAvailable(): string | null;
export declare function isProjectUsingBun(cwd: string): string | undefined;
//# sourceMappingURL=bun.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"bun.d.ts","sourceRoot":"","sources":["../../src/tools/bun.ts"],"names":[],"mappings":"AAKA,wBAAgB,wBAAwB,kBAsBvC;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,sBAE5C"}

View File

@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getBunVersionIfAvailable = getBunVersionIfAvailable;
exports.isProjectUsingBun = isProjectUsingBun;
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _child_process() {
const data = require("child_process");
_child_process = function () {
return data;
};
return data;
}
function _findUp() {
const data = _interopRequireDefault(require("find-up"));
_findUp = function () {
return data;
};
return data;
}
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getBunVersionIfAvailable() {
let bunVersion;
try {
bunVersion = ((0, _child_process().execSync)('bun --version', {
stdio: [0, 'pipe', 'ignore']
}).toString() || '').trim();
} catch (error) {
return null;
}
try {
if (_semver().default.gte(bunVersion, '1.0.0')) {
return bunVersion;
}
return null;
} catch (error) {
_cliTools().logger.error(`Cannot parse bun version: ${bunVersion}`);
return null;
}
}
function isProjectUsingBun(cwd) {
return _findUp().default.sync('bun.lockb', {
cwd
});
}
//# sourceMappingURL=bun.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getBunVersionIfAvailable","bunVersion","execSync","stdio","toString","trim","error","semver","gte","logger","isProjectUsingBun","cwd","findUp","sync"],"sources":["../../src/tools/bun.ts"],"sourcesContent":["import {logger} from '@react-native-community/cli-tools';\nimport {execSync} from 'child_process';\nimport findUp from 'find-up';\nimport semver from 'semver';\n\nexport function getBunVersionIfAvailable() {\n let bunVersion;\n\n try {\n bunVersion = (\n execSync('bun --version', {\n stdio: [0, 'pipe', 'ignore'],\n }).toString() || ''\n ).trim();\n } catch (error) {\n return null;\n }\n\n try {\n if (semver.gte(bunVersion, '1.0.0')) {\n return bunVersion;\n }\n return null;\n } catch (error) {\n logger.error(`Cannot parse bun version: ${bunVersion}`);\n return null;\n }\n}\n\nexport function isProjectUsingBun(cwd: string) {\n return findUp.sync('bun.lockb', {cwd});\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA4B;AAErB,SAASA,wBAAwB,GAAG;EACzC,IAAIC,UAAU;EAEd,IAAI;IACFA,UAAU,GAAG,CACX,IAAAC,yBAAQ,EAAC,eAAe,EAAE;MACxBC,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ;IAC7B,CAAC,CAAC,CAACC,QAAQ,EAAE,IAAI,EAAE,EACnBC,IAAI,EAAE;EACV,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAO,IAAI;EACb;EAEA,IAAI;IACF,IAAIC,iBAAM,CAACC,GAAG,CAACP,UAAU,EAAE,OAAO,CAAC,EAAE;MACnC,OAAOA,UAAU;IACnB;IACA,OAAO,IAAI;EACb,CAAC,CAAC,OAAOK,KAAK,EAAE;IACdG,kBAAM,CAACH,KAAK,CAAE,6BAA4BL,UAAW,EAAC,CAAC;IACvD,OAAO,IAAI;EACb;AACF;AAEO,SAASS,iBAAiB,CAACC,GAAW,EAAE;EAC7C,OAAOC,iBAAM,CAACC,IAAI,CAAC,WAAW,EAAE;IAACF;EAAG,CAAC,CAAC;AACxC"}

View File

@@ -0,0 +1,15 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
type Options = {
exclude?: Array<RegExp>;
};
/**
* Copy files (binary included) recursively.
*/
declare function copyFiles(srcPath: string, destPath: string, options?: Options): Promise<void[]>;
export default copyFiles;
//# sourceMappingURL=copyFiles.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"copyFiles.d.ts","sourceRoot":"","sources":["../../src/tools/copyFiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,KAAK,OAAO,GAAG;IACb,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,iBAAe,SAAS,CACtB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,OAAY,mBAetB;AAsDD,eAAe,SAAS,CAAC"}

View File

@@ -0,0 +1,97 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
var _walk = _interopRequireDefault(require("./walk"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Copy files (binary included) recursively.
*/
async function copyFiles(srcPath, destPath, options = {}) {
return Promise.all((0, _walk.default)(srcPath).map(async absoluteSrcFilePath => {
const exclude = options.exclude;
if (exclude && exclude.some(p => p.test(absoluteSrcFilePath))) {
return;
}
const relativeFilePath = _path().default.relative(srcPath, absoluteSrcFilePath);
await copyFile(absoluteSrcFilePath, _path().default.resolve(destPath, relativeFilePath));
}));
}
/**
* Copy a file to given destination.
*/
function copyFile(srcPath, destPath) {
if (_fs().default.lstatSync(srcPath).isDirectory()) {
if (!_fs().default.existsSync(destPath)) {
_fs().default.mkdirSync(destPath);
}
// Not recursive
return;
}
return new Promise((resolve, reject) => {
copyBinaryFile(srcPath, destPath, err => {
if (err) {
reject(err);
}
resolve(destPath);
});
});
}
/**
* Same as 'cp' on Unix. Don't do any replacements.
*/
function copyBinaryFile(srcPath, destPath, cb) {
let cbCalled = false;
const {
mode
} = _fs().default.statSync(srcPath);
const readStream = _fs().default.createReadStream(srcPath);
const writeStream = _fs().default.createWriteStream(destPath, {
mode
});
readStream.on('error', err => {
done(err);
});
writeStream.on('error', err => {
done(err);
});
readStream.on('close', () => {
done();
});
readStream.pipe(writeStream);
function done(err) {
if (!cbCalled) {
cb(err);
cbCalled = true;
}
}
}
var _default = copyFiles;
exports.default = _default;
//# sourceMappingURL=copyFiles.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["copyFiles","srcPath","destPath","options","Promise","all","walk","map","absoluteSrcFilePath","exclude","some","p","test","relativeFilePath","path","relative","copyFile","resolve","fs","lstatSync","isDirectory","existsSync","mkdirSync","reject","copyBinaryFile","err","cb","cbCalled","mode","statSync","readStream","createReadStream","writeStream","createWriteStream","on","done","pipe"],"sources":["../../src/tools/copyFiles.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport fs from 'fs';\nimport path from 'path';\nimport walk from './walk';\n\ntype Options = {\n exclude?: Array<RegExp>;\n};\n\n/**\n * Copy files (binary included) recursively.\n */\nasync function copyFiles(\n srcPath: string,\n destPath: string,\n options: Options = {},\n) {\n return Promise.all(\n walk(srcPath).map(async (absoluteSrcFilePath: string) => {\n const exclude = options.exclude;\n if (exclude && exclude.some((p) => p.test(absoluteSrcFilePath))) {\n return;\n }\n const relativeFilePath = path.relative(srcPath, absoluteSrcFilePath);\n await copyFile(\n absoluteSrcFilePath,\n path.resolve(destPath, relativeFilePath),\n );\n }),\n );\n}\n\n/**\n * Copy a file to given destination.\n */\nfunction copyFile(srcPath: string, destPath: string) {\n if (fs.lstatSync(srcPath).isDirectory()) {\n if (!fs.existsSync(destPath)) {\n fs.mkdirSync(destPath);\n }\n // Not recursive\n return;\n }\n\n return new Promise((resolve, reject) => {\n copyBinaryFile(srcPath, destPath, (err) => {\n if (err) {\n reject(err);\n }\n resolve(destPath);\n });\n });\n}\n\n/**\n * Same as 'cp' on Unix. Don't do any replacements.\n */\nfunction copyBinaryFile(\n srcPath: string,\n destPath: string,\n cb: (err?: Error) => void,\n) {\n let cbCalled = false;\n const {mode} = fs.statSync(srcPath);\n const readStream = fs.createReadStream(srcPath);\n const writeStream = fs.createWriteStream(destPath, {mode});\n readStream.on('error', (err) => {\n done(err);\n });\n writeStream.on('error', (err) => {\n done(err);\n });\n readStream.on('close', () => {\n done();\n });\n readStream.pipe(writeStream);\n function done(err?: Error) {\n if (!cbCalled) {\n cb(err);\n cbCalled = true;\n }\n }\n}\n\nexport default copyFiles;\n"],"mappings":";;;;;;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;AAA0B;AAT1B;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA,eAAeA,SAAS,CACtBC,OAAe,EACfC,QAAgB,EAChBC,OAAgB,GAAG,CAAC,CAAC,EACrB;EACA,OAAOC,OAAO,CAACC,GAAG,CAChB,IAAAC,aAAI,EAACL,OAAO,CAAC,CAACM,GAAG,CAAC,MAAOC,mBAA2B,IAAK;IACvD,MAAMC,OAAO,GAAGN,OAAO,CAACM,OAAO;IAC/B,IAAIA,OAAO,IAAIA,OAAO,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,CAACJ,mBAAmB,CAAC,CAAC,EAAE;MAC/D;IACF;IACA,MAAMK,gBAAgB,GAAGC,eAAI,CAACC,QAAQ,CAACd,OAAO,EAAEO,mBAAmB,CAAC;IACpE,MAAMQ,QAAQ,CACZR,mBAAmB,EACnBM,eAAI,CAACG,OAAO,CAACf,QAAQ,EAAEW,gBAAgB,CAAC,CACzC;EACH,CAAC,CAAC,CACH;AACH;;AAEA;AACA;AACA;AACA,SAASG,QAAQ,CAACf,OAAe,EAAEC,QAAgB,EAAE;EACnD,IAAIgB,aAAE,CAACC,SAAS,CAAClB,OAAO,CAAC,CAACmB,WAAW,EAAE,EAAE;IACvC,IAAI,CAACF,aAAE,CAACG,UAAU,CAACnB,QAAQ,CAAC,EAAE;MAC5BgB,aAAE,CAACI,SAAS,CAACpB,QAAQ,CAAC;IACxB;IACA;IACA;EACF;EAEA,OAAO,IAAIE,OAAO,CAAC,CAACa,OAAO,EAAEM,MAAM,KAAK;IACtCC,cAAc,CAACvB,OAAO,EAAEC,QAAQ,EAAGuB,GAAG,IAAK;MACzC,IAAIA,GAAG,EAAE;QACPF,MAAM,CAACE,GAAG,CAAC;MACb;MACAR,OAAO,CAACf,QAAQ,CAAC;IACnB,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA,SAASsB,cAAc,CACrBvB,OAAe,EACfC,QAAgB,EAChBwB,EAAyB,EACzB;EACA,IAAIC,QAAQ,GAAG,KAAK;EACpB,MAAM;IAACC;EAAI,CAAC,GAAGV,aAAE,CAACW,QAAQ,CAAC5B,OAAO,CAAC;EACnC,MAAM6B,UAAU,GAAGZ,aAAE,CAACa,gBAAgB,CAAC9B,OAAO,CAAC;EAC/C,MAAM+B,WAAW,GAAGd,aAAE,CAACe,iBAAiB,CAAC/B,QAAQ,EAAE;IAAC0B;EAAI,CAAC,CAAC;EAC1DE,UAAU,CAACI,EAAE,CAAC,OAAO,EAAGT,GAAG,IAAK;IAC9BU,IAAI,CAACV,GAAG,CAAC;EACX,CAAC,CAAC;EACFO,WAAW,CAACE,EAAE,CAAC,OAAO,EAAGT,GAAG,IAAK;IAC/BU,IAAI,CAACV,GAAG,CAAC;EACX,CAAC,CAAC;EACFK,UAAU,CAACI,EAAE,CAAC,OAAO,EAAE,MAAM;IAC3BC,IAAI,EAAE;EACR,CAAC,CAAC;EACFL,UAAU,CAACM,IAAI,CAACJ,WAAW,CAAC;EAC5B,SAASG,IAAI,CAACV,GAAW,EAAE;IACzB,IAAI,CAACE,QAAQ,EAAE;MACbD,EAAE,CAACD,GAAG,CAAC;MACPE,QAAQ,GAAG,IAAI;IACjB;EACF;AACF;AAAC,eAEc3B,SAAS;AAAA"}

View File

@@ -0,0 +1,6 @@
import execa from 'execa';
export declare function executeCommand(command: string, args: Array<string>, options: {
root: string;
silent?: boolean;
}): execa.ExecaChildProcess<string>;
//# sourceMappingURL=executeCommand.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"executeCommand.d.ts","sourceRoot":"","sources":["../../src/tools/executeCommand.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EACnB,OAAO,EAAE;IACP,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,mCAMF"}

View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.executeCommand = executeCommand;
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _execa() {
const data = _interopRequireDefault(require("execa"));
_execa = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function executeCommand(command, args, options) {
return (0, _execa().default)(command, args, {
stdio: options.silent && !_cliTools().logger.isVerbose() ? 'pipe' : 'inherit',
cwd: options.root
});
}
//# sourceMappingURL=executeCommand.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["executeCommand","command","args","options","execa","stdio","silent","logger","isVerbose","cwd","root"],"sources":["../../src/tools/executeCommand.ts"],"sourcesContent":["import {logger} from '@react-native-community/cli-tools';\nimport execa from 'execa';\n\nexport function executeCommand(\n command: string,\n args: Array<string>,\n options: {\n root: string;\n silent?: boolean;\n },\n) {\n return execa(command, args, {\n stdio: options.silent && !logger.isVerbose() ? 'pipe' : 'inherit',\n cwd: options.root,\n });\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA0B;AAEnB,SAASA,cAAc,CAC5BC,OAAe,EACfC,IAAmB,EACnBC,OAGC,EACD;EACA,OAAO,IAAAC,gBAAK,EAACH,OAAO,EAAEC,IAAI,EAAE;IAC1BG,KAAK,EAAEF,OAAO,CAACG,MAAM,IAAI,CAACC,kBAAM,CAACC,SAAS,EAAE,GAAG,MAAM,GAAG,SAAS;IACjEC,GAAG,EAAEN,OAAO,CAACO;EACf,CAAC,CAAC;AACJ"}

View File

@@ -0,0 +1,3 @@
import gracefulFs from 'graceful-fs';
export default gracefulFs;
//# sourceMappingURL=gracefulifyFs.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"gracefulifyFs.d.ts","sourceRoot":"","sources":["../../src/tools/gracefulifyFs.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,aAAa,CAAC;AAIrC,eAAe,UAAU,CAAC"}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _gracefulFs() {
const data = _interopRequireDefault(require("graceful-fs"));
_gracefulFs = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_gracefulFs().default.gracefulify(_fs().default);
var _default = _gracefulFs().default;
exports.default = _default;
//# sourceMappingURL=gracefulifyFs.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["gracefulFs","gracefulify","realFs"],"sources":["../../src/tools/gracefulifyFs.ts"],"sourcesContent":["import realFs from 'fs';\nimport gracefulFs from 'graceful-fs';\n\ngracefulFs.gracefulify(realFs);\n\nexport default gracefulFs;\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAqC;AAErCA,qBAAU,CAACC,WAAW,CAACC,aAAM,CAAC;AAAC,eAEhBF,qBAAU;AAAA"}

View File

@@ -0,0 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
export declare function getNpmVersionIfAvailable(): string | null;
export declare function isProjectUsingNpm(cwd: string): string | undefined;
//# sourceMappingURL=npm.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../src/tools/npm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,wBAAgB,wBAAwB,kBAcvC;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,sBAE5C"}

View File

@@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getNpmVersionIfAvailable = getNpmVersionIfAvailable;
exports.isProjectUsingNpm = isProjectUsingNpm;
function _child_process() {
const data = require("child_process");
_child_process = function () {
return data;
};
return data;
}
function _findUp() {
const data = _interopRequireDefault(require("find-up"));
_findUp = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
function getNpmVersionIfAvailable() {
let npmVersion;
try {
// execSync returns a Buffer -> convert to string
npmVersion = ((0, _child_process().execSync)('npm --version', {
stdio: [0, 'pipe', 'ignore']
}).toString() || '').trim();
return npmVersion;
} catch (error) {
return null;
}
}
function isProjectUsingNpm(cwd) {
return _findUp().default.sync('package-lock.json', {
cwd
});
}
//# sourceMappingURL=npm.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getNpmVersionIfAvailable","npmVersion","execSync","stdio","toString","trim","error","isProjectUsingNpm","cwd","findUp","sync"],"sources":["../../src/tools/npm.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport {execSync} from 'child_process';\nimport findUp from 'find-up';\n\nexport function getNpmVersionIfAvailable() {\n let npmVersion;\n try {\n // execSync returns a Buffer -> convert to string\n npmVersion = (\n execSync('npm --version', {\n stdio: [0, 'pipe', 'ignore'],\n }).toString() || ''\n ).trim();\n\n return npmVersion;\n } catch (error) {\n return null;\n }\n}\n\nexport function isProjectUsingNpm(cwd: string) {\n return findUp.sync('package-lock.json', {cwd});\n}\n"],"mappings":";;;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA6B;AAT7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,SAASA,wBAAwB,GAAG;EACzC,IAAIC,UAAU;EACd,IAAI;IACF;IACAA,UAAU,GAAG,CACX,IAAAC,yBAAQ,EAAC,eAAe,EAAE;MACxBC,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ;IAC7B,CAAC,CAAC,CAACC,QAAQ,EAAE,IAAI,EAAE,EACnBC,IAAI,EAAE;IAER,OAAOJ,UAAU;EACnB,CAAC,CAAC,OAAOK,KAAK,EAAE;IACd,OAAO,IAAI;EACb;AACF;AAEO,SAASC,iBAAiB,CAACC,GAAW,EAAE;EAC7C,OAAOC,iBAAM,CAACC,IAAI,CAAC,mBAAmB,EAAE;IAACF;EAAG,CAAC,CAAC;AAChD"}

View File

@@ -0,0 +1,39 @@
export type PackageManager = keyof typeof packageManagers;
type Options = {
packageManager: PackageManager;
silent?: boolean;
root: string;
};
declare const packageManagers: {
yarn: {
init: string[];
install: string[];
installDev: string[];
uninstall: string[];
installAll: string[];
};
npm: {
init: string[];
install: string[];
installDev: string[];
uninstall: string[];
installAll: string[];
};
bun: {
init: string[];
install: string[];
installDev: string[];
uninstall: string[];
installAll: string[];
};
};
export declare function shouldUseYarn(options: Options): string | null | undefined;
export declare function shouldUseBun(options: Options): string | null | undefined;
export declare function shouldUseNpm(options: Options): string | null | undefined;
export declare function init(options: Options): import("execa").ExecaChildProcess<string>;
export declare function install(packageNames: Array<string>, options: Options): import("execa").ExecaChildProcess<string>;
export declare function installDev(packageNames: Array<string>, options: Options): import("execa").ExecaChildProcess<string>;
export declare function uninstall(packageNames: Array<string>, options: Options): import("execa").ExecaChildProcess<string>;
export declare function installAll(options: Options): import("execa").ExecaChildProcess<string>;
export {};
//# sourceMappingURL=packageManager.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"packageManager.d.ts","sourceRoot":"","sources":["../../src/tools/packageManager.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,eAAe,CAAC;AAE1D,KAAK,OAAO,GAAG;IACb,cAAc,EAAE,cAAc,CAAC;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAsBpB,CAAC;AA+BF,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,6BAK7C;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,6BAM5C;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,6BAM5C;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,OAAO,6CAEpC;AAED,wBAAgB,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,6CAEpE;AAED,wBAAgB,UAAU,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,6CAEvE;AAED,wBAAgB,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,6CAEtE;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,6CAE1C"}

View File

@@ -0,0 +1,95 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.init = init;
exports.install = install;
exports.installAll = installAll;
exports.installDev = installDev;
exports.shouldUseBun = shouldUseBun;
exports.shouldUseNpm = shouldUseNpm;
exports.shouldUseYarn = shouldUseYarn;
exports.uninstall = uninstall;
var _yarn = require("./yarn");
var _bun = require("./bun");
var _npm = require("./npm");
var _executeCommand = require("./executeCommand");
const packageManagers = {
yarn: {
init: ['init', '-y'],
install: ['add'],
installDev: ['add', '-D'],
uninstall: ['remove'],
installAll: ['install']
},
npm: {
init: ['init', '-y'],
install: ['install', '--save', '--save-exact'],
installDev: ['install', '--save-dev', '--save-exact'],
uninstall: ['uninstall', '--save'],
installAll: ['install']
},
bun: {
init: ['init', '-y'],
install: ['add', '--exact'],
installDev: ['add', '--dev', '--exact'],
uninstall: ['remove'],
installAll: ['install']
}
};
function configurePackageManager(packageNames, action, options) {
let yarnAvailable = shouldUseYarn(options);
let bunAvailable = shouldUseBun(options);
let pm = 'npm';
if (options.packageManager === 'bun') {
if (bunAvailable) {
pm = 'bun';
} else if (yarnAvailable) {
pm = 'yarn';
} else {
pm = 'npm';
}
}
if (options.packageManager === 'yarn' && yarnAvailable) {
pm = 'yarn';
}
const [executable, ...flags] = packageManagers[pm][action];
const args = [executable, ...flags, ...packageNames];
return (0, _executeCommand.executeCommand)(pm, args, options);
}
function shouldUseYarn(options) {
if (options.packageManager === 'yarn') {
return (0, _yarn.getYarnVersionIfAvailable)();
}
return (0, _yarn.isProjectUsingYarn)(options.root) && (0, _yarn.getYarnVersionIfAvailable)();
}
function shouldUseBun(options) {
if (options.packageManager === 'bun') {
return (0, _bun.getBunVersionIfAvailable)();
}
return (0, _bun.isProjectUsingBun)(options.root) && (0, _bun.getBunVersionIfAvailable)();
}
function shouldUseNpm(options) {
if (options.packageManager === 'npm') {
return (0, _npm.getNpmVersionIfAvailable)();
}
return (0, _npm.isProjectUsingNpm)(options.root) && (0, _npm.getNpmVersionIfAvailable)();
}
function init(options) {
return configurePackageManager([], 'init', options);
}
function install(packageNames, options) {
return configurePackageManager(packageNames, 'install', options);
}
function installDev(packageNames, options) {
return configurePackageManager(packageNames, 'installDev', options);
}
function uninstall(packageNames, options) {
return configurePackageManager(packageNames, 'uninstall', options);
}
function installAll(options) {
return configurePackageManager([], 'installAll', options);
}
//# sourceMappingURL=packageManager.ts.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export default function replacePathSepForRegex(string: string): string;
//# sourceMappingURL=replacePathSepForRegex.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"replacePathSepForRegex.d.ts","sourceRoot":"","sources":["../../src/tools/replacePathSepForRegex.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,MAAM,EAAE,MAAM,UAQ5D"}

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = replacePathSepForRegex;
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function replacePathSepForRegex(string) {
if (_path().default.sep === '\\') {
return string.replace(/(\/|(.)?\\(?![[\]{}()*+?.^$|\\]))/g, (_match, _, p2) => p2 && p2 !== '\\' ? p2 + '\\\\' : '\\\\');
}
return string;
}
//# sourceMappingURL=replacePathSepForRegex.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["replacePathSepForRegex","string","path","sep","replace","_match","_","p2"],"sources":["../../src/tools/replacePathSepForRegex.ts"],"sourcesContent":["import path from 'path';\n\nexport default function replacePathSepForRegex(string: string) {\n if (path.sep === '\\\\') {\n return string.replace(\n /(\\/|(.)?\\\\(?![[\\]{}()*+?.^$|\\\\]))/g,\n (_match, _, p2) => (p2 && p2 !== '\\\\' ? p2 + '\\\\\\\\' : '\\\\\\\\'),\n );\n }\n return string;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwB;AAET,SAASA,sBAAsB,CAACC,MAAc,EAAE;EAC7D,IAAIC,eAAI,CAACC,GAAG,KAAK,IAAI,EAAE;IACrB,OAAOF,MAAM,CAACG,OAAO,CACnB,oCAAoC,EACpC,CAACC,MAAM,EAAEC,CAAC,EAAEC,EAAE,KAAMA,EAAE,IAAIA,EAAE,KAAK,IAAI,GAAGA,EAAE,GAAG,MAAM,GAAG,MAAO,CAC9D;EACH;EACA,OAAON,MAAM;AACf"}

View File

@@ -0,0 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
declare function walk(current: string): string[];
export default walk;
//# sourceMappingURL=walk.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../../src/tools/walk.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,iBAAS,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAUvC;AAED,eAAe,IAAI,CAAC"}

View File

@@ -0,0 +1,41 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
function walk(current) {
if (!_fs().default.lstatSync(current).isDirectory()) {
return [current];
}
const files = _fs().default.readdirSync(current).map(child => walk(_path().default.join(current, child)));
const result = [];
return result.concat.apply([current], files);
}
var _default = walk;
exports.default = _default;
//# sourceMappingURL=walk.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["walk","current","fs","lstatSync","isDirectory","files","readdirSync","map","child","path","join","result","concat","apply"],"sources":["../../src/tools/walk.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nfunction walk(current: string): string[] {\n if (!fs.lstatSync(current).isDirectory()) {\n return [current];\n }\n\n const files = fs\n .readdirSync(current)\n .map((child) => walk(path.join(current, child)));\n const result: string[] = [];\n return result.concat.apply([current], files);\n}\n\nexport default walk;\n"],"mappings":";;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwB;AATxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,SAASA,IAAI,CAACC,OAAe,EAAY;EACvC,IAAI,CAACC,aAAE,CAACC,SAAS,CAACF,OAAO,CAAC,CAACG,WAAW,EAAE,EAAE;IACxC,OAAO,CAACH,OAAO,CAAC;EAClB;EAEA,MAAMI,KAAK,GAAGH,aAAE,CACbI,WAAW,CAACL,OAAO,CAAC,CACpBM,GAAG,CAAEC,KAAK,IAAKR,IAAI,CAACS,eAAI,CAACC,IAAI,CAACT,OAAO,EAAEO,KAAK,CAAC,CAAC,CAAC;EAClD,MAAMG,MAAgB,GAAG,EAAE;EAC3B,OAAOA,MAAM,CAACC,MAAM,CAACC,KAAK,CAAC,CAACZ,OAAO,CAAC,EAAEI,KAAK,CAAC;AAC9C;AAAC,eAEcL,IAAI;AAAA"}

View File

@@ -0,0 +1,17 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/**
* Use Yarn if available, it's much faster than the npm client.
* Return the version of yarn installed on the system, null if yarn is not available.
*/
export declare function getYarnVersionIfAvailable(): string | null;
/**
* Check if project is using Yarn (has `yarn.lock` in the tree)
*/
export declare function isProjectUsingYarn(cwd: string): string | undefined;
//# sourceMappingURL=yarn.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"yarn.d.ts","sourceRoot":"","sources":["../../src/tools/yarn.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH;;;GAGG;AACH,wBAAgB,yBAAyB,kBAsBxC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,sBAE7C"}

View File

@@ -0,0 +1,80 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getYarnVersionIfAvailable = getYarnVersionIfAvailable;
exports.isProjectUsingYarn = isProjectUsingYarn;
function _child_process() {
const data = require("child_process");
_child_process = function () {
return data;
};
return data;
}
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
function _cliTools() {
const data = require("@react-native-community/cli-tools");
_cliTools = function () {
return data;
};
return data;
}
function _findUp() {
const data = _interopRequireDefault(require("find-up"));
_findUp = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/**
* Use Yarn if available, it's much faster than the npm client.
* Return the version of yarn installed on the system, null if yarn is not available.
*/
function getYarnVersionIfAvailable() {
let yarnVersion;
try {
// execSync returns a Buffer -> convert to string
yarnVersion = ((0, _child_process().execSync)('yarn --version', {
stdio: [0, 'pipe', 'ignore']
}).toString() || '').trim();
} catch (error) {
return null;
}
// yarn < 0.16 has a 'missing manifest' bug
try {
if (_semver().default.gte(yarnVersion, '0.16.0')) {
return yarnVersion;
}
return null;
} catch (error) {
_cliTools().logger.error(`Cannot parse yarn version: ${yarnVersion}`);
return null;
}
}
/**
* Check if project is using Yarn (has `yarn.lock` in the tree)
*/
function isProjectUsingYarn(cwd) {
return _findUp().default.sync('yarn.lock', {
cwd
});
}
//# sourceMappingURL=yarn.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["getYarnVersionIfAvailable","yarnVersion","execSync","stdio","toString","trim","error","semver","gte","logger","isProjectUsingYarn","cwd","findUp","sync"],"sources":["../../src/tools/yarn.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport {execSync} from 'child_process';\nimport semver from 'semver';\nimport {logger} from '@react-native-community/cli-tools';\nimport findUp from 'find-up';\n\n/**\n * Use Yarn if available, it's much faster than the npm client.\n * Return the version of yarn installed on the system, null if yarn is not available.\n */\nexport function getYarnVersionIfAvailable() {\n let yarnVersion;\n try {\n // execSync returns a Buffer -> convert to string\n yarnVersion = (\n execSync('yarn --version', {\n stdio: [0, 'pipe', 'ignore'],\n }).toString() || ''\n ).trim();\n } catch (error) {\n return null;\n }\n // yarn < 0.16 has a 'missing manifest' bug\n try {\n if (semver.gte(yarnVersion, '0.16.0')) {\n return yarnVersion;\n }\n return null;\n } catch (error) {\n logger.error(`Cannot parse yarn version: ${yarnVersion}`);\n return null;\n }\n}\n\n/**\n * Check if project is using Yarn (has `yarn.lock` in the tree)\n */\nexport function isProjectUsingYarn(cwd: string) {\n return findUp.sync('yarn.lock', {cwd});\n}\n"],"mappings":";;;;;;;AAQA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA6B;AAX7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACO,SAASA,yBAAyB,GAAG;EAC1C,IAAIC,WAAW;EACf,IAAI;IACF;IACAA,WAAW,GAAG,CACZ,IAAAC,yBAAQ,EAAC,gBAAgB,EAAE;MACzBC,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ;IAC7B,CAAC,CAAC,CAACC,QAAQ,EAAE,IAAI,EAAE,EACnBC,IAAI,EAAE;EACV,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,OAAO,IAAI;EACb;EACA;EACA,IAAI;IACF,IAAIC,iBAAM,CAACC,GAAG,CAACP,WAAW,EAAE,QAAQ,CAAC,EAAE;MACrC,OAAOA,WAAW;IACpB;IACA,OAAO,IAAI;EACb,CAAC,CAAC,OAAOK,KAAK,EAAE;IACdG,kBAAM,CAACH,KAAK,CAAE,8BAA6BL,WAAY,EAAC,CAAC;IACzD,OAAO,IAAI;EACb;AACF;;AAEA;AACA;AACA;AACO,SAASS,kBAAkB,CAACC,GAAW,EAAE;EAC9C,OAAOC,iBAAM,CAACC,IAAI,CAAC,WAAW,EAAE;IAACF;EAAG,CAAC,CAAC;AACxC"}