- 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
69 lines
1.8 KiB
JavaScript
69 lines
1.8 KiB
JavaScript
'use strict';
|
|
|
|
const fs = require('fs');
|
|
const mm = require('micromatch');
|
|
|
|
const matchers = [];
|
|
|
|
/**
|
|
* Add glob patterns to ignore matched files and folders.
|
|
* Creates glob patterns to approximate gitignore patterns.
|
|
* @param {String} val - the glob or gitignore-style pattern to ignore
|
|
* @see {@linkplain https://git-scm.com/docs/gitignore#_pattern_format}
|
|
*/
|
|
function addIgnorePattern(val) {
|
|
if (val && typeof val === 'string' && val[0] !== '#') {
|
|
let pattern = val;
|
|
if (pattern.indexOf('/') === -1) {
|
|
matchers.push('**/' + pattern);
|
|
} else if (pattern[pattern.length-1] === '/') {
|
|
matchers.push('**/' + pattern + '**');
|
|
matchers.push(pattern + '**');
|
|
}
|
|
matchers.push(pattern);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Adds ignore patterns directly from function input
|
|
* @param {String|Array<String>} input - the ignore patterns
|
|
*/
|
|
function addIgnoreFromInput(input) {
|
|
let patterns = [];
|
|
if (input) {
|
|
patterns = patterns.concat(input);
|
|
}
|
|
patterns.forEach(addIgnorePattern);
|
|
}
|
|
|
|
/**
|
|
* Adds ignore patterns by reading files
|
|
* @param {String|Array<String>} input - the paths to the ignore config files
|
|
*/
|
|
function addIgnoreFromFile(input) {
|
|
let lines = [];
|
|
let files = [];
|
|
if (input) {
|
|
files = files.concat(input);
|
|
}
|
|
|
|
files.forEach(function(config) {
|
|
const stats = fs.statSync(config);
|
|
if (stats.isFile()) {
|
|
const content = fs.readFileSync(config, 'utf8');
|
|
lines = lines.concat(content.split(/\r?\n/));
|
|
}
|
|
});
|
|
|
|
lines.forEach(addIgnorePattern);
|
|
}
|
|
|
|
function shouldIgnore(path) {
|
|
const matched = matchers.length ? mm.isMatch(path, matchers, { dot:true }) : false;
|
|
return matched;
|
|
}
|
|
|
|
exports.add = addIgnoreFromInput;
|
|
exports.addFromFile = addIgnoreFromFile;
|
|
exports.shouldIgnore = shouldIgnore;
|