create-myexam-app 1.0.21 → 1.0.22
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/index.js +25 -17
- package/package.json +1 -1
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/README.md +84 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/.env +3 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/config/db.js +13 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/authController.js +115 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/employeeController.js +97 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/payrollController.js +113 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/reportController.js +35 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/middleware/authMiddleware.js +9 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/Employee.js +52 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/Payroll.js +50 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/User.js +19 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/package-lock.json +1509 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/package.json +19 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/authRoutes.js +18 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/employeeRoutes.js +19 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/payrollRoutes.js +19 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/reportRoutes.js +9 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/server.js +71 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/index.html +12 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/package-lock.json +2888 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/package.json +23 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/postcss.config.js +6 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/App.jsx +57 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/apiClient.js +16 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/authApi.js +26 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/employeeApi.js +26 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/payrollApi.js +26 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/reportApi.js +6 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Header.jsx +17 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Layout.jsx +17 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Message.jsx +15 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/ProtectedRoute.jsx +41 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Sidebar.jsx +38 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/index.css +30 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/main.jsx +13 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/DashboardPage.jsx +64 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/EmployeePage.jsx +166 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/LoginPage.jsx +73 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/PayrollPage.jsx +198 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/RecoverPasswordPage.jsx +69 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/RegisterPage.jsx +69 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/ReportsPage.jsx +113 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/tailwind.config.js +13 -0
- package/projects/EPMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/vite.config.js +9 -0
- package/projects/SCMS/frontend/node_modules/.bin/acorn +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/acorn.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/acorn.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/baseline-browser-mapping +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/baseline-browser-mapping.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/baseline-browser-mapping.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/browserslist +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/browserslist.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/browserslist.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/eslint +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/eslint.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/eslint.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/jiti +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/jiti.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/jiti.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/jsesc +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/jsesc.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/jsesc.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/json5 +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/json5.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/json5.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/nanoid +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/nanoid.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/nanoid.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/node-which +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/node-which.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/node-which.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/parser +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/parser.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/parser.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/rolldown +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/rolldown.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/rolldown.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/semver +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/semver.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/semver.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/update-browserslist-db +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/update-browserslist-db.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/update-browserslist-db.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.bin/vite +16 -0
- package/projects/SCMS/frontend/node_modules/.bin/vite.cmd +17 -0
- package/projects/SCMS/frontend/node_modules/.bin/vite.ps1 +28 -0
- package/projects/SCMS/frontend/node_modules/.package-lock.json +2401 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/_metadata.json +56 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/axios.js +3184 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/axios.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/chunk-B-1-B7_t.js +33 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/package.json +3 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react-dom.js +186 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react-dom.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react-dom_client.js +14385 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react-dom_client.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react-router-dom.js +10177 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react-router-dom.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react.js +769 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react_jsx-dev-runtime.js +205 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react_jsx-runtime.js +209 -0
- package/projects/SCMS/frontend/node_modules/.vite/deps/react_jsx-runtime.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/code-frame/LICENSE +22 -0
- package/projects/SCMS/frontend/node_modules/@babel/code-frame/README.md +19 -0
- package/projects/SCMS/frontend/node_modules/@babel/code-frame/lib/index.js +217 -0
- package/projects/SCMS/frontend/node_modules/@babel/code-frame/lib/index.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/code-frame/package.json +32 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/LICENSE +22 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/README.md +19 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/corejs2-built-ins.js +2 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/corejs3-shipped-proposals.js +2 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/data/corejs2-built-ins.json +2120 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/data/corejs3-shipped-proposals.json +5 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/data/native-modules.json +18 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/data/overlapping-plugins.json +38 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/data/plugin-bugfixes.json +231 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/data/plugins.json +843 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/native-modules.js +2 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/overlapping-plugins.js +2 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/package.json +40 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/plugin-bugfixes.js +2 -0
- package/projects/SCMS/frontend/node_modules/@babel/compat-data/plugins.js +2 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/LICENSE +22 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/README.md +19 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/cache-contexts.js +5 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/cache-contexts.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/caching.js +261 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/caching.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/config-chain.js +469 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/config-chain.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/config-descriptors.js +190 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/config-descriptors.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/files/configuration.js +290 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/files/configuration.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/files/import.cjs +6 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/files/import.cjs.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/files/index-browser.js +58 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/files/index-browser.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/files/index.js +78 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/files/index.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/full.js +312 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/full.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/index.js +87 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/index.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/item.js +67 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/item.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/partial.js +158 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/partial.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/pattern-to-regex.js +38 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/pattern-to-regex.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/plugin.js +33 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/plugin.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/printer.js +113 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/printer.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/resolve-targets-browser.js +41 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/resolve-targets-browser.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/resolve-targets.js +61 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/resolve-targets.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/util.js +31 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/config/util.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/index.js +230 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/index.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/parse.js +45 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/parse.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/transform-ast.js +48 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/transform-ast.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/transform-file-browser.js +23 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/transform-file-browser.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/transform-file.js +40 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/transform-file.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/transform.js +47 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/lib/transform.js.map +1 -0
- package/projects/SCMS/frontend/node_modules/@babel/core/package.json +84 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/README.md +106 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/01_Introduction.md +8 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/02_Problem_Statement.md +12 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/03_Objectives.md +17 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/04_Technologies_Used.md +23 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/05_ERD.md +60 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/06_Database_Design.md +71 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/07_System_Architecture.md +28 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/08_API_Documentation.md +43 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/09_Testing.md +43 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/10_Challenges.md +12 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/REPORT/11_Conclusion.md +8 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/.env.example +4 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/config/db.js +16 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/deliveryController.js +145 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/shipmentController.js +149 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/supplierController.js +56 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/userController.js +158 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/middleware/authMiddleware.js +9 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/Delivery.js +34 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/Shipment.js +34 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/Supplier.js +38 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/User.js +21 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/package-lock.json +1540 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/package.json +22 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/deliveryRoutes.js +11 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/shipmentRoutes.js +11 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/supplierRoutes.js +9 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/userRoutes.js +11 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/server.js +70 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/.env.example +2 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/index.html +13 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/package-lock.json +2944 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/package.json +23 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/postcss.config.js +6 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/App.jsx +72 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/apiClient.js +14 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/deliveryApi.js +17 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/shipmentApi.js +17 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/supplierApi.js +9 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/userApi.js +21 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Layout.jsx +16 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Message.jsx +15 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/PageHeader.jsx +12 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Sidebar.jsx +40 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/main.jsx +13 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/Dashboard.jsx +62 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/Delivery.jsx +212 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/Login.jsx +158 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/Logout.jsx +24 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/Reports.jsx +221 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/Shipment.jsx +212 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/Supplier.jsx +118 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/styles.css +27 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/tailwind.config.js +8 -0
- package/projects/SCMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/vite.config.js +6 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/README.md +84 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/.env +3 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/config/db.js +13 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/productController.js +29 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/reportController.js +52 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/stockTransactionController.js +128 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/userController.js +115 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/controllers/warehouseController.js +29 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/middleware/authMiddleware.js +9 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/Product.js +44 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/StockTransaction.js +33 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/User.js +19 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/models/Warehouse.js +25 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/package-lock.json +1509 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/package.json +19 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/productRoutes.js +10 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/reportRoutes.js +9 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/stockTransactionRoutes.js +17 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/userRoutes.js +18 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/routes/warehouseRoutes.js +10 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/backend-project/server.js +73 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/index.html +12 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/package-lock.json +2888 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/package.json +23 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/postcss.config.js +6 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/App.jsx +66 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/apiClient.js +16 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/productApi.js +11 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/reportApi.js +6 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/transactionApi.js +21 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/userApi.js +26 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/api/warehouseApi.js +11 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Header.jsx +17 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Layout.jsx +17 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Message.jsx +15 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/ProtectedRoute.jsx +41 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/components/Sidebar.jsx +39 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/index.css +30 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/main.jsx +13 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/DashboardPage.jsx +64 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/LoginPage.jsx +73 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/ProductPage.jsx +107 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/RecoverPasswordPage.jsx +69 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/RegisterPage.jsx +69 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/ReportsPage.jsx +152 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/TransactionPage.jsx +195 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/src/pages/WarehousePage.jsx +93 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/tailwind.config.js +13 -0
- package/projects/SHMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026/frontend-project/vite.config.js +9 -0
- package/projects/SRMS/frontend/src/pages/Reports.jsx +170 -58
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/README.md +49 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/.env +3 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/middleware/authMiddleware.js +19 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/models/Customer.js +11 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/models/Product.js +10 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/models/Sale.js +19 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/models/User.js +8 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/package-lock.json +1609 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/package.json +20 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/routes/authRoutes.js +75 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/routes/customerRoutes.js +42 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/routes/productRoutes.js +41 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/routes/reportRoutes.js +129 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/routes/saleRoutes.js +107 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/backend-project/server.js +49 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/dist/assets/index-DZxY56Bj.js +75 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/dist/assets/index-J8MKb3Fq.css +1 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/dist/index.html +13 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/index.html +12 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/package-lock.json +2029 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/package.json +21 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/App.jsx +77 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/index.css +333 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/main.jsx +10 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/pages/Customers.jsx +85 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/pages/Dashboard.jsx +75 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/pages/Login.jsx +65 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/pages/Products.jsx +91 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/pages/Register.jsx +82 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/pages/Reports.jsx +138 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/src/pages/Sales.jsx +154 -0
- package/projects/SRMS(Ely)/KALIWABO_SHEMA_ELYSEE_National_Practical_Examination_2026(/frontend-project/vite.config.js +9 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createCachedDescriptors = createCachedDescriptors;
|
|
7
|
+
exports.createDescriptor = createDescriptor;
|
|
8
|
+
exports.createUncachedDescriptors = createUncachedDescriptors;
|
|
9
|
+
function _gensync() {
|
|
10
|
+
const data = require("gensync");
|
|
11
|
+
_gensync = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
var _functional = require("../gensync-utils/functional.js");
|
|
17
|
+
var _index = require("./files/index.js");
|
|
18
|
+
var _item = require("./item.js");
|
|
19
|
+
var _caching = require("./caching.js");
|
|
20
|
+
var _resolveTargets = require("./resolve-targets.js");
|
|
21
|
+
function isEqualDescriptor(a, b) {
|
|
22
|
+
var _a$file, _b$file, _a$file2, _b$file2;
|
|
23
|
+
return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved);
|
|
24
|
+
}
|
|
25
|
+
function* handlerOf(value) {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
function optionsWithResolvedBrowserslistConfigFile(options, dirname) {
|
|
29
|
+
if (typeof options.browserslistConfigFile === "string") {
|
|
30
|
+
options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname);
|
|
31
|
+
}
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
function createCachedDescriptors(dirname, options, alias) {
|
|
35
|
+
const {
|
|
36
|
+
plugins,
|
|
37
|
+
presets,
|
|
38
|
+
passPerPreset
|
|
39
|
+
} = options;
|
|
40
|
+
return {
|
|
41
|
+
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
|
|
42
|
+
plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]),
|
|
43
|
+
presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([])
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function createUncachedDescriptors(dirname, options, alias) {
|
|
47
|
+
return {
|
|
48
|
+
options: optionsWithResolvedBrowserslistConfigFile(options, dirname),
|
|
49
|
+
plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)),
|
|
50
|
+
presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset))
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const PRESET_DESCRIPTOR_CACHE = new WeakMap();
|
|
54
|
+
const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
|
|
55
|
+
const dirname = cache.using(dir => dir);
|
|
56
|
+
return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCache)(function* (passPerPreset) {
|
|
57
|
+
const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset);
|
|
58
|
+
return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc));
|
|
59
|
+
}));
|
|
60
|
+
});
|
|
61
|
+
const PLUGIN_DESCRIPTOR_CACHE = new WeakMap();
|
|
62
|
+
const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => {
|
|
63
|
+
const dirname = cache.using(dir => dir);
|
|
64
|
+
return (0, _caching.makeStrongCache)(function* (alias) {
|
|
65
|
+
const descriptors = yield* createPluginDescriptors(items, dirname, alias);
|
|
66
|
+
return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc));
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
const DEFAULT_OPTIONS = {};
|
|
70
|
+
function loadCachedDescriptor(cache, desc) {
|
|
71
|
+
const {
|
|
72
|
+
value,
|
|
73
|
+
options = DEFAULT_OPTIONS
|
|
74
|
+
} = desc;
|
|
75
|
+
if (options === false) return desc;
|
|
76
|
+
let cacheByOptions = cache.get(value);
|
|
77
|
+
if (!cacheByOptions) {
|
|
78
|
+
cacheByOptions = new WeakMap();
|
|
79
|
+
cache.set(value, cacheByOptions);
|
|
80
|
+
}
|
|
81
|
+
let possibilities = cacheByOptions.get(options);
|
|
82
|
+
if (!possibilities) {
|
|
83
|
+
possibilities = [];
|
|
84
|
+
cacheByOptions.set(options, possibilities);
|
|
85
|
+
}
|
|
86
|
+
if (!possibilities.includes(desc)) {
|
|
87
|
+
const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc));
|
|
88
|
+
if (matches.length > 0) {
|
|
89
|
+
return matches[0];
|
|
90
|
+
}
|
|
91
|
+
possibilities.push(desc);
|
|
92
|
+
}
|
|
93
|
+
return desc;
|
|
94
|
+
}
|
|
95
|
+
function* createPresetDescriptors(items, dirname, alias, passPerPreset) {
|
|
96
|
+
return yield* createDescriptors("preset", items, dirname, alias, passPerPreset);
|
|
97
|
+
}
|
|
98
|
+
function* createPluginDescriptors(items, dirname, alias) {
|
|
99
|
+
return yield* createDescriptors("plugin", items, dirname, alias);
|
|
100
|
+
}
|
|
101
|
+
function* createDescriptors(type, items, dirname, alias, ownPass) {
|
|
102
|
+
const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, {
|
|
103
|
+
type,
|
|
104
|
+
alias: `${alias}$${index}`,
|
|
105
|
+
ownPass: !!ownPass
|
|
106
|
+
})));
|
|
107
|
+
assertNoDuplicates(descriptors);
|
|
108
|
+
return descriptors;
|
|
109
|
+
}
|
|
110
|
+
function* createDescriptor(pair, dirname, {
|
|
111
|
+
type,
|
|
112
|
+
alias,
|
|
113
|
+
ownPass
|
|
114
|
+
}) {
|
|
115
|
+
const desc = (0, _item.getItemDescriptor)(pair);
|
|
116
|
+
if (desc) {
|
|
117
|
+
return desc;
|
|
118
|
+
}
|
|
119
|
+
let name;
|
|
120
|
+
let options;
|
|
121
|
+
let value = pair;
|
|
122
|
+
if (Array.isArray(value)) {
|
|
123
|
+
if (value.length === 3) {
|
|
124
|
+
[value, options, name] = value;
|
|
125
|
+
} else {
|
|
126
|
+
[value, options] = value;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
let file = undefined;
|
|
130
|
+
let filepath = null;
|
|
131
|
+
if (typeof value === "string") {
|
|
132
|
+
if (typeof type !== "string") {
|
|
133
|
+
throw new Error("To resolve a string-based item, the type of item must be given");
|
|
134
|
+
}
|
|
135
|
+
const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset;
|
|
136
|
+
const request = value;
|
|
137
|
+
({
|
|
138
|
+
filepath,
|
|
139
|
+
value
|
|
140
|
+
} = yield* resolver(value, dirname));
|
|
141
|
+
file = {
|
|
142
|
+
request,
|
|
143
|
+
resolved: filepath
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (!value) {
|
|
147
|
+
throw new Error(`Unexpected falsy value: ${String(value)}`);
|
|
148
|
+
}
|
|
149
|
+
if (typeof value === "object" && value.__esModule) {
|
|
150
|
+
if (value.default) {
|
|
151
|
+
value = value.default;
|
|
152
|
+
} else {
|
|
153
|
+
throw new Error("Must export a default export when using ES6 modules.");
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (typeof value !== "object" && typeof value !== "function") {
|
|
157
|
+
throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`);
|
|
158
|
+
}
|
|
159
|
+
if (filepath !== null && typeof value === "object" && value) {
|
|
160
|
+
throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
name,
|
|
164
|
+
alias: filepath || alias,
|
|
165
|
+
value,
|
|
166
|
+
options,
|
|
167
|
+
dirname,
|
|
168
|
+
ownPass,
|
|
169
|
+
file
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function assertNoDuplicates(items) {
|
|
173
|
+
const map = new Map();
|
|
174
|
+
for (const item of items) {
|
|
175
|
+
if (typeof item.value !== "function") continue;
|
|
176
|
+
let nameMap = map.get(item.value);
|
|
177
|
+
if (!nameMap) {
|
|
178
|
+
nameMap = new Set();
|
|
179
|
+
map.set(item.value, nameMap);
|
|
180
|
+
}
|
|
181
|
+
if (nameMap.has(item.name)) {
|
|
182
|
+
const conflicts = items.filter(i => i.value === item.value);
|
|
183
|
+
throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n"));
|
|
184
|
+
}
|
|
185
|
+
nameMap.add(item.name);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
0 && 0;
|
|
189
|
+
|
|
190
|
+
//# sourceMappingURL=config-descriptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_gensync","data","require","_functional","_index","_item","_caching","_resolveTargets","isEqualDescriptor","a","b","_a$file","_b$file","_a$file2","_b$file2","name","value","options","dirname","alias","ownPass","file","request","resolved","handlerOf","optionsWithResolvedBrowserslistConfigFile","browserslistConfigFile","resolveBrowserslistConfigFile","createCachedDescriptors","plugins","presets","passPerPreset","createCachedPluginDescriptors","createCachedPresetDescriptors","createUncachedDescriptors","once","createPluginDescriptors","createPresetDescriptors","PRESET_DESCRIPTOR_CACHE","WeakMap","makeWeakCacheSync","items","cache","using","dir","makeStrongCacheSync","makeStrongCache","descriptors","map","desc","loadCachedDescriptor","PLUGIN_DESCRIPTOR_CACHE","DEFAULT_OPTIONS","cacheByOptions","get","set","possibilities","includes","matches","filter","possibility","length","push","createDescriptors","type","gensync","all","item","index","createDescriptor","assertNoDuplicates","pair","getItemDescriptor","Array","isArray","undefined","filepath","Error","resolver","loadPlugin","loadPreset","String","__esModule","default","Map","nameMap","Set","has","conflicts","i","JSON","stringify","join","add"],"sources":["../../src/config/config-descriptors.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\nimport { once } from \"../gensync-utils/functional.ts\";\n\nimport { loadPlugin, loadPreset } from \"./files/index.ts\";\n\nimport { getItemDescriptor } from \"./item.ts\";\n\nimport {\n makeWeakCacheSync,\n makeStrongCacheSync,\n makeStrongCache,\n} from \"./caching.ts\";\nimport type { CacheConfigurator } from \"./caching.ts\";\n\nimport type {\n PluginItem,\n InputOptions,\n PresetItem,\n} from \"./validation/options.ts\";\n\nimport { resolveBrowserslistConfigFile } from \"./resolve-targets.ts\";\nimport type { PluginAPI, PresetAPI } from \"./helpers/config-api.ts\";\n\n// Represents a config object and functions to lazily load the descriptors\n// for the plugins and presets so we don't load the plugins/presets unless\n// the options object actually ends up being applicable.\nexport type OptionsAndDescriptors = {\n options: InputOptions;\n plugins: () => Handler<UnloadedDescriptor<PluginAPI>[]>;\n presets: () => Handler<UnloadedDescriptor<PresetAPI>[]>;\n};\n\n// Represents a plugin or presets at a given location in a config object.\n// At this point these have been resolved to a specific object or function,\n// but have not yet been executed to call functions with options.\nexport interface UnloadedDescriptor<API, Options = object | undefined> {\n name: string | undefined;\n value: object | ((api: API, options: Options, dirname: string) => unknown);\n options: Options;\n dirname: string;\n alias: string;\n ownPass?: boolean;\n file?: {\n request: string;\n resolved: string;\n };\n}\n\nfunction isEqualDescriptor<API>(\n a: UnloadedDescriptor<API>,\n b: UnloadedDescriptor<API>,\n): boolean {\n return (\n a.name === b.name &&\n a.value === b.value &&\n a.options === b.options &&\n a.dirname === b.dirname &&\n a.alias === b.alias &&\n a.ownPass === b.ownPass &&\n a.file?.request === b.file?.request &&\n a.file?.resolved === b.file?.resolved\n );\n}\n\nexport type ValidatedFile = {\n filepath: string;\n dirname: string;\n options: InputOptions;\n};\n\n// eslint-disable-next-line require-yield\nfunction* handlerOf<T>(value: T): Handler<T> {\n return value;\n}\n\nfunction optionsWithResolvedBrowserslistConfigFile(\n options: InputOptions,\n dirname: string,\n): InputOptions {\n if (typeof options.browserslistConfigFile === \"string\") {\n options.browserslistConfigFile = resolveBrowserslistConfigFile(\n options.browserslistConfigFile,\n dirname,\n );\n }\n return options;\n}\n\n/**\n * Create a set of descriptors from a given options object, preserving\n * descriptor identity based on the identity of the plugin/preset arrays\n * themselves, and potentially on the identity of the plugins/presets + options.\n */\nexport function createCachedDescriptors(\n dirname: string,\n options: InputOptions,\n alias: string,\n): OptionsAndDescriptors {\n const { plugins, presets, passPerPreset } = options;\n return {\n options: optionsWithResolvedBrowserslistConfigFile(options, dirname),\n plugins: plugins\n ? () =>\n // @ts-expect-error todo(flow->ts) ts complains about incorrect arguments\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n createCachedPluginDescriptors(plugins, dirname)(alias)\n : () => handlerOf([]),\n presets: presets\n ? () =>\n // @ts-expect-error todo(flow->ts) ts complains about incorrect arguments\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n createCachedPresetDescriptors(presets, dirname)(alias)(\n !!passPerPreset,\n )\n : () => handlerOf([]),\n };\n}\n\n/**\n * Create a set of descriptors from a given options object, with consistent\n * identity for the descriptors, but not caching based on any specific identity.\n */\nexport function createUncachedDescriptors(\n dirname: string,\n options: InputOptions,\n alias: string,\n): OptionsAndDescriptors {\n return {\n options: optionsWithResolvedBrowserslistConfigFile(options, dirname),\n // The returned result here is cached to represent a config object in\n // memory, so we build and memoize the descriptors to ensure the same\n // values are returned consistently.\n plugins: once(() =>\n createPluginDescriptors(options.plugins || [], dirname, alias),\n ),\n presets: once(() =>\n createPresetDescriptors(\n options.presets || [],\n dirname,\n alias,\n !!options.passPerPreset,\n ),\n ),\n };\n}\n\nconst PRESET_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPresetDescriptors = makeWeakCacheSync(\n (items: PresetItem[], cache: CacheConfigurator<string>) => {\n const dirname = cache.using(dir => dir);\n return makeStrongCacheSync((alias: string) =>\n makeStrongCache(function* (\n passPerPreset: boolean,\n ): Handler<UnloadedDescriptor<PresetAPI>[]> {\n const descriptors = yield* createPresetDescriptors(\n items,\n dirname,\n alias,\n passPerPreset,\n );\n return descriptors.map(\n // Items are cached using the overall preset array identity when\n // possibly, but individual descriptors are also cached if a match\n // can be found in the previously-used descriptor lists.\n desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc),\n );\n }),\n );\n },\n);\n\nconst PLUGIN_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPluginDescriptors = makeWeakCacheSync(\n (items: PluginItem[], cache: CacheConfigurator<string>) => {\n const dirname = cache.using(dir => dir);\n return makeStrongCache(function* (\n alias: string,\n ): Handler<UnloadedDescriptor<PluginAPI>[]> {\n const descriptors = yield* createPluginDescriptors(items, dirname, alias);\n return descriptors.map(\n // Items are cached using the overall plugin array identity when\n // possibly, but individual descriptors are also cached if a match\n // can be found in the previously-used descriptor lists.\n desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc),\n );\n });\n },\n);\n\n/**\n * When no options object is given in a descriptor, this object is used\n * as a WeakMap key in order to have consistent identity.\n */\nconst DEFAULT_OPTIONS = {};\n\n/**\n * Given the cache and a descriptor, returns a matching descriptor from the\n * cache, or else returns the input descriptor and adds it to the cache for\n * next time.\n */\nfunction loadCachedDescriptor<API>(\n cache: WeakMap<object | Function, WeakMap<object, UnloadedDescriptor<API>[]>>,\n desc: UnloadedDescriptor<API>,\n) {\n const { value, options = DEFAULT_OPTIONS } = desc;\n if (options === false) return desc;\n\n let cacheByOptions = cache.get(value);\n if (!cacheByOptions) {\n cacheByOptions = new WeakMap();\n cache.set(value, cacheByOptions);\n }\n\n let possibilities = cacheByOptions.get(options);\n if (!possibilities) {\n possibilities = [];\n cacheByOptions.set(options, possibilities);\n }\n\n if (!possibilities.includes(desc)) {\n const matches = possibilities.filter(possibility =>\n isEqualDescriptor(possibility, desc),\n );\n if (matches.length > 0) {\n return matches[0];\n }\n\n possibilities.push(desc);\n }\n\n return desc;\n}\n\nfunction* createPresetDescriptors(\n items: PresetItem[],\n dirname: string,\n alias: string,\n passPerPreset: boolean,\n): Handler<UnloadedDescriptor<PresetAPI>[]> {\n return yield* createDescriptors(\n \"preset\",\n items,\n dirname,\n alias,\n passPerPreset,\n );\n}\n\nfunction* createPluginDescriptors(\n items: PluginItem[],\n dirname: string,\n alias: string,\n): Handler<UnloadedDescriptor<PluginAPI>[]> {\n return yield* createDescriptors(\"plugin\", items, dirname, alias);\n}\n\nfunction* createDescriptors<const Type extends \"plugin\" | \"preset\">(\n type: Type,\n items: Type extends \"plugin\" ? PluginItem[] : PresetItem[],\n dirname: string,\n alias: string,\n ownPass?: boolean,\n): Handler<\n UnloadedDescriptor<Type extends \"plugin\" ? PluginAPI : PresetAPI>[]\n> {\n const descriptors = yield* gensync.all(\n items.map((item, index) =>\n createDescriptor(item, dirname, {\n type,\n alias: `${alias}$${index}`,\n ownPass: !!ownPass,\n }),\n ),\n );\n\n assertNoDuplicates(descriptors);\n\n return descriptors;\n}\n\n/**\n * Given a plugin/preset item, resolve it into a standard format.\n */\nexport function* createDescriptor<API>(\n pair: PluginItem | PresetItem,\n dirname: string,\n {\n type,\n alias,\n ownPass,\n }: {\n type?: \"plugin\" | \"preset\";\n alias: string;\n ownPass?: boolean;\n },\n): Handler<UnloadedDescriptor<API>> {\n const desc = getItemDescriptor(pair);\n if (desc) {\n return desc;\n }\n\n let name;\n let options;\n let value = pair;\n if (Array.isArray(value)) {\n if (value.length === 3) {\n [value, options, name] = value;\n } else {\n [value, options] = value;\n }\n }\n\n let file = undefined;\n let filepath = null;\n if (typeof value === \"string\") {\n if (typeof type !== \"string\") {\n throw new Error(\n \"To resolve a string-based item, the type of item must be given\",\n );\n }\n const resolver = type === \"plugin\" ? loadPlugin : loadPreset;\n const request = value;\n\n // @ts-expect-error value must be a PluginItem\n ({ filepath, value } = yield* resolver(value, dirname));\n\n file = {\n request,\n resolved: filepath,\n };\n }\n\n if (!value) {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n throw new Error(`Unexpected falsy value: ${String(value)}`);\n }\n\n // @ts-expect-error Handle transpiled ES6 modules.\n if (typeof value === \"object\" && value.__esModule) {\n // @ts-expect-error Handle transpiled ES6 modules.\n if (value.default) {\n // @ts-expect-error Handle transpiled ES6 modules.\n value = value.default;\n } else {\n throw new Error(\"Must export a default export when using ES6 modules.\");\n }\n }\n\n if (typeof value !== \"object\" && typeof value !== \"function\") {\n throw new Error(\n `Unsupported format: ${typeof value}. Expected an object or a function.`,\n );\n }\n\n if (filepath !== null && typeof value === \"object\" && value) {\n // We allow object values for plugins/presets nested directly within a\n // config object, because it can be useful to define them in nested\n // configuration contexts.\n throw new Error(\n `Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`,\n );\n }\n\n return {\n name,\n alias: filepath || alias,\n value,\n options,\n dirname,\n ownPass,\n file,\n };\n}\n\nfunction assertNoDuplicates<API>(items: UnloadedDescriptor<API>[]): void {\n const map = new Map();\n\n for (const item of items) {\n if (typeof item.value !== \"function\") continue;\n\n let nameMap = map.get(item.value);\n if (!nameMap) {\n nameMap = new Set();\n map.set(item.value, nameMap);\n }\n\n if (nameMap.has(item.name)) {\n const conflicts = items.filter(i => i.value === item.value);\n throw new Error(\n [\n `Duplicate plugin/preset detected.`,\n `If you'd like to use two separate instances of a plugin,`,\n `they need separate names, e.g.`,\n ``,\n ` plugins: [`,\n ` ['some-plugin', {}],`,\n ` ['some-plugin', {}, 'some unique name'],`,\n ` ]`,\n ``,\n `Duplicates detected are:`,\n `${JSON.stringify(conflicts, null, 2)}`,\n ].join(\"\\n\"),\n );\n }\n\n nameMap.add(item.name);\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,IAAAE,WAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AAaA,IAAAK,eAAA,GAAAL,OAAA;AA4BA,SAASM,iBAAiBA,CACxBC,CAA0B,EAC1BC,CAA0B,EACjB;EAAA,IAAAC,OAAA,EAAAC,OAAA,EAAAC,QAAA,EAAAC,QAAA;EACT,OACEL,CAAC,CAACM,IAAI,KAAKL,CAAC,CAACK,IAAI,IACjBN,C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IAAI,CAACpD,IAAI,CAAC;EACxB;AACF;AAAC","ignoreList":[]}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ROOT_CONFIG_FILENAMES = void 0;
|
|
7
|
+
exports.findConfigUpwards = findConfigUpwards;
|
|
8
|
+
exports.findRelativeConfig = findRelativeConfig;
|
|
9
|
+
exports.findRootConfig = findRootConfig;
|
|
10
|
+
exports.loadConfig = loadConfig;
|
|
11
|
+
exports.resolveShowConfigPath = resolveShowConfigPath;
|
|
12
|
+
function _debug() {
|
|
13
|
+
const data = require("debug");
|
|
14
|
+
_debug = function () {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
function _fs() {
|
|
20
|
+
const data = require("fs");
|
|
21
|
+
_fs = function () {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
24
|
+
return data;
|
|
25
|
+
}
|
|
26
|
+
function _path() {
|
|
27
|
+
const data = require("path");
|
|
28
|
+
_path = function () {
|
|
29
|
+
return data;
|
|
30
|
+
};
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
function _json() {
|
|
34
|
+
const data = require("json5");
|
|
35
|
+
_json = function () {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
return data;
|
|
39
|
+
}
|
|
40
|
+
function _gensync() {
|
|
41
|
+
const data = require("gensync");
|
|
42
|
+
_gensync = function () {
|
|
43
|
+
return data;
|
|
44
|
+
};
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
var _caching = require("../caching.js");
|
|
48
|
+
var _configApi = require("../helpers/config-api.js");
|
|
49
|
+
var _utils = require("./utils.js");
|
|
50
|
+
var _moduleTypes = require("./module-types.js");
|
|
51
|
+
var _patternToRegex = require("../pattern-to-regex.js");
|
|
52
|
+
var _configError = require("../../errors/config-error.js");
|
|
53
|
+
var fs = require("../../gensync-utils/fs.js");
|
|
54
|
+
require("module");
|
|
55
|
+
var _rewriteStackTrace = require("../../errors/rewrite-stack-trace.js");
|
|
56
|
+
var _async = require("../../gensync-utils/async.js");
|
|
57
|
+
const debug = _debug()("babel:config:loading:files:configuration");
|
|
58
|
+
const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = ["babel.config.js", "babel.config.cjs", "babel.config.mjs", "babel.config.json", "babel.config.cts", "babel.config.ts", "babel.config.mts"];
|
|
59
|
+
const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", ".babelrc.json", ".babelrc.cts"];
|
|
60
|
+
const BABELIGNORE_FILENAME = ".babelignore";
|
|
61
|
+
const runConfig = (0, _caching.makeWeakCache)(function* runConfig(options, cache) {
|
|
62
|
+
yield* [];
|
|
63
|
+
return {
|
|
64
|
+
options: (0, _rewriteStackTrace.endHiddenCallStack)(options)((0, _configApi.makeConfigAPI)(cache)),
|
|
65
|
+
cacheNeedsConfiguration: !cache.configured()
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
function* readConfigCode(filepath, data) {
|
|
69
|
+
if (!_fs().existsSync(filepath)) return null;
|
|
70
|
+
let options = yield* (0, _moduleTypes.default)(filepath, (yield* (0, _async.isAsync)()) ? "auto" : "require", "You appear to be using a native ECMAScript module configuration " + "file, which is only supported when running Babel asynchronously " + "or when using the Node.js `--experimental-require-module` flag.", "You appear to be using a configuration file that contains top-level " + "await, which is only supported when running Babel asynchronously.");
|
|
71
|
+
let cacheNeedsConfiguration = false;
|
|
72
|
+
if (typeof options === "function") {
|
|
73
|
+
({
|
|
74
|
+
options,
|
|
75
|
+
cacheNeedsConfiguration
|
|
76
|
+
} = yield* runConfig(options, data));
|
|
77
|
+
}
|
|
78
|
+
if (!options || typeof options !== "object" || Array.isArray(options)) {
|
|
79
|
+
throw new _configError.default(`Configuration should be an exported JavaScript object.`, filepath);
|
|
80
|
+
}
|
|
81
|
+
if (typeof options.then === "function") {
|
|
82
|
+
options.catch == null || options.catch(() => {});
|
|
83
|
+
throw new _configError.default(`You appear to be using an async configuration, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously return your config.`, filepath);
|
|
84
|
+
}
|
|
85
|
+
if (cacheNeedsConfiguration) throwConfigError(filepath);
|
|
86
|
+
return buildConfigFileObject(options, filepath);
|
|
87
|
+
}
|
|
88
|
+
const cfboaf = new WeakMap();
|
|
89
|
+
function buildConfigFileObject(options, filepath) {
|
|
90
|
+
let configFilesByFilepath = cfboaf.get(options);
|
|
91
|
+
if (!configFilesByFilepath) {
|
|
92
|
+
cfboaf.set(options, configFilesByFilepath = new Map());
|
|
93
|
+
}
|
|
94
|
+
let configFile = configFilesByFilepath.get(filepath);
|
|
95
|
+
if (!configFile) {
|
|
96
|
+
configFile = {
|
|
97
|
+
filepath,
|
|
98
|
+
dirname: _path().dirname(filepath),
|
|
99
|
+
options
|
|
100
|
+
};
|
|
101
|
+
configFilesByFilepath.set(filepath, configFile);
|
|
102
|
+
}
|
|
103
|
+
return configFile;
|
|
104
|
+
}
|
|
105
|
+
const packageToBabelConfig = (0, _caching.makeWeakCacheSync)(file => {
|
|
106
|
+
const babel = file.options.babel;
|
|
107
|
+
if (babel === undefined) return null;
|
|
108
|
+
if (typeof babel !== "object" || Array.isArray(babel) || babel === null) {
|
|
109
|
+
throw new _configError.default(`.babel property must be an object`, file.filepath);
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
filepath: file.filepath,
|
|
113
|
+
dirname: file.dirname,
|
|
114
|
+
options: babel
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
const readConfigJSON5 = (0, _utils.makeStaticFileCache)((filepath, content) => {
|
|
118
|
+
let options;
|
|
119
|
+
try {
|
|
120
|
+
options = _json().parse(content);
|
|
121
|
+
} catch (err) {
|
|
122
|
+
throw new _configError.default(`Error while parsing config - ${err.message}`, filepath);
|
|
123
|
+
}
|
|
124
|
+
if (!options) throw new _configError.default(`No config detected`, filepath);
|
|
125
|
+
if (typeof options !== "object") {
|
|
126
|
+
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
|
|
127
|
+
}
|
|
128
|
+
if (Array.isArray(options)) {
|
|
129
|
+
throw new _configError.default(`Expected config object but found array`, filepath);
|
|
130
|
+
}
|
|
131
|
+
delete options.$schema;
|
|
132
|
+
return {
|
|
133
|
+
filepath,
|
|
134
|
+
dirname: _path().dirname(filepath),
|
|
135
|
+
options
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
const readIgnoreConfig = (0, _utils.makeStaticFileCache)((filepath, content) => {
|
|
139
|
+
const ignoreDir = _path().dirname(filepath);
|
|
140
|
+
const ignorePatterns = content.split("\n").map(line => line.replace(/#.*$/, "").trim()).filter(Boolean);
|
|
141
|
+
for (const pattern of ignorePatterns) {
|
|
142
|
+
if (pattern.startsWith("!")) {
|
|
143
|
+
throw new _configError.default(`Negation of file paths is not supported.`, filepath);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
filepath,
|
|
148
|
+
dirname: _path().dirname(filepath),
|
|
149
|
+
ignore: ignorePatterns.map(pattern => (0, _patternToRegex.default)(pattern, ignoreDir))
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
function findConfigUpwards(rootDir) {
|
|
153
|
+
let dirname = rootDir;
|
|
154
|
+
for (;;) {
|
|
155
|
+
for (const filename of ROOT_CONFIG_FILENAMES) {
|
|
156
|
+
if (_fs().existsSync(_path().join(dirname, filename))) {
|
|
157
|
+
return dirname;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const nextDir = _path().dirname(dirname);
|
|
161
|
+
if (dirname === nextDir) break;
|
|
162
|
+
dirname = nextDir;
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
function* findRelativeConfig(packageData, envName, caller) {
|
|
167
|
+
let config = null;
|
|
168
|
+
let ignore = null;
|
|
169
|
+
const dirname = _path().dirname(packageData.filepath);
|
|
170
|
+
for (const loc of packageData.directories) {
|
|
171
|
+
if (!config) {
|
|
172
|
+
var _packageData$pkg;
|
|
173
|
+
config = yield* loadOneConfig(RELATIVE_CONFIG_FILENAMES, loc, envName, caller, ((_packageData$pkg = packageData.pkg) == null ? void 0 : _packageData$pkg.dirname) === loc ? packageToBabelConfig(packageData.pkg) : null);
|
|
174
|
+
}
|
|
175
|
+
if (!ignore) {
|
|
176
|
+
const ignoreLoc = _path().join(loc, BABELIGNORE_FILENAME);
|
|
177
|
+
ignore = yield* readIgnoreConfig(ignoreLoc);
|
|
178
|
+
if (ignore) {
|
|
179
|
+
debug("Found ignore %o from %o.", ignore.filepath, dirname);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
config,
|
|
185
|
+
ignore
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function findRootConfig(dirname, envName, caller) {
|
|
189
|
+
return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);
|
|
190
|
+
}
|
|
191
|
+
function* loadOneConfig(names, dirname, envName, caller, previousConfig = null) {
|
|
192
|
+
const configs = yield* _gensync().all(names.map(filename => readConfig(_path().join(dirname, filename), envName, caller)));
|
|
193
|
+
const config = configs.reduce((previousConfig, config) => {
|
|
194
|
+
if (config && previousConfig) {
|
|
195
|
+
throw new _configError.default(`Multiple configuration files found. Please remove one:\n` + ` - ${_path().basename(previousConfig.filepath)}\n` + ` - ${config.filepath}\n` + `from ${dirname}`);
|
|
196
|
+
}
|
|
197
|
+
return config || previousConfig;
|
|
198
|
+
}, previousConfig);
|
|
199
|
+
if (config) {
|
|
200
|
+
debug("Found configuration %o from %o.", config.filepath, dirname);
|
|
201
|
+
}
|
|
202
|
+
return config;
|
|
203
|
+
}
|
|
204
|
+
function* loadConfig(name, dirname, envName, caller) {
|
|
205
|
+
const filepath = (((v, w) => (v = v.split("."), w = w.split("."), +v[0] > +w[0] || v[0] == w[0] && +v[1] >= +w[1]))(process.versions.node, "8.9") ? require.resolve : (r, {
|
|
206
|
+
paths: [b]
|
|
207
|
+
}, M = require("module")) => {
|
|
208
|
+
let f = M._findPath(r, M._nodeModulePaths(b).concat(b));
|
|
209
|
+
if (f) return f;
|
|
210
|
+
f = new Error(`Cannot resolve module '${r}'`);
|
|
211
|
+
f.code = "MODULE_NOT_FOUND";
|
|
212
|
+
throw f;
|
|
213
|
+
})(name, {
|
|
214
|
+
paths: [dirname]
|
|
215
|
+
});
|
|
216
|
+
const conf = yield* readConfig(filepath, envName, caller);
|
|
217
|
+
if (!conf) {
|
|
218
|
+
throw new _configError.default(`Config file contains no configuration data`, filepath);
|
|
219
|
+
}
|
|
220
|
+
debug("Loaded config %o from %o.", name, dirname);
|
|
221
|
+
return conf;
|
|
222
|
+
}
|
|
223
|
+
function readConfig(filepath, envName, caller) {
|
|
224
|
+
const ext = _path().extname(filepath);
|
|
225
|
+
switch (ext) {
|
|
226
|
+
case ".js":
|
|
227
|
+
case ".cjs":
|
|
228
|
+
case ".mjs":
|
|
229
|
+
case ".ts":
|
|
230
|
+
case ".cts":
|
|
231
|
+
case ".mts":
|
|
232
|
+
return readConfigCode(filepath, {
|
|
233
|
+
envName,
|
|
234
|
+
caller
|
|
235
|
+
});
|
|
236
|
+
default:
|
|
237
|
+
return readConfigJSON5(filepath);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function* resolveShowConfigPath(dirname) {
|
|
241
|
+
const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;
|
|
242
|
+
if (targetPath != null) {
|
|
243
|
+
const absolutePath = _path().resolve(dirname, targetPath);
|
|
244
|
+
const stats = yield* fs.stat(absolutePath);
|
|
245
|
+
if (!stats.isFile()) {
|
|
246
|
+
throw new Error(`${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`);
|
|
247
|
+
}
|
|
248
|
+
return absolutePath;
|
|
249
|
+
}
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
function throwConfigError(filepath) {
|
|
253
|
+
throw new _configError.default(`\
|
|
254
|
+
Caching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured
|
|
255
|
+
for various types of caching, using the first param of their handler functions:
|
|
256
|
+
|
|
257
|
+
module.exports = function(api) {
|
|
258
|
+
// The API exposes the following:
|
|
259
|
+
|
|
260
|
+
// Cache the returned value forever and don't call this function again.
|
|
261
|
+
api.cache(true);
|
|
262
|
+
|
|
263
|
+
// Don't cache at all. Not recommended because it will be very slow.
|
|
264
|
+
api.cache(false);
|
|
265
|
+
|
|
266
|
+
// Cached based on the value of some function. If this function returns a value different from
|
|
267
|
+
// a previously-encountered value, the plugins will re-evaluate.
|
|
268
|
+
var env = api.cache(() => process.env.NODE_ENV);
|
|
269
|
+
|
|
270
|
+
// If testing for a specific env, we recommend specifics to avoid instantiating a plugin for
|
|
271
|
+
// any possible NODE_ENV value that might come up during plugin execution.
|
|
272
|
+
var isProd = api.cache(() => process.env.NODE_ENV === "production");
|
|
273
|
+
|
|
274
|
+
// .cache(fn) will perform a linear search though instances to find the matching plugin based
|
|
275
|
+
// based on previous instantiated plugins. If you want to recreate the plugin and discard the
|
|
276
|
+
// previous instance whenever something changes, you may use:
|
|
277
|
+
var isProd = api.cache.invalidate(() => process.env.NODE_ENV === "production");
|
|
278
|
+
|
|
279
|
+
// Note, we also expose the following more-verbose versions of the above examples:
|
|
280
|
+
api.cache.forever(); // api.cache(true)
|
|
281
|
+
api.cache.never(); // api.cache(false)
|
|
282
|
+
api.cache.using(fn); // api.cache(fn)
|
|
283
|
+
|
|
284
|
+
// Return the value that will be cached.
|
|
285
|
+
return { };
|
|
286
|
+
};`, filepath);
|
|
287
|
+
}
|
|
288
|
+
0 && 0;
|
|
289
|
+
|
|
290
|
+
//# sourceMappingURL=configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_debug","data","require","_fs","_path","_json","_gensync","_caching","_configApi","_utils","_moduleTypes","_patternToRegex","_configError","fs","_rewriteStackTrace","_async","debug","buildDebug","ROOT_CONFIG_FILENAMES","exports","RELATIVE_CONFIG_FILENAMES","BABELIGNORE_FILENAME","runConfig","makeWeakCache","options","cache","endHiddenCallStack","makeConfigAPI","cacheNeedsConfiguration","configured","readConfigCode","filepath","nodeFs","existsSync","loadCodeDefault","isAsync","Array","isArray","ConfigError","then","catch","throwConfigError","buildConfigFileObject","cfboaf","WeakMap","configFilesByFilepath","get","set","Map","configFile","dirname","path","packageToBabelConfig","makeWeakCacheSync","file","babel","undefined","readConfigJSON5","makeStaticFileCache","content","json5","parse","err","message","$schema","readIgnoreConfig","ignoreDir","ignorePatterns","split","map","line","replace","trim","filter","Boolean","pattern","startsWith","ignore","pathPatternToRegex","findConfigUpwards","rootDir","filename","join","nextDir","findRelativeConfig","packageData","envName","caller","config","loc","directories","_packageData$pkg","loadOneConfig","pkg","ignoreLoc","findRootConfig","names","previousConfig","configs","gensync","all","readConfig","reduce","basename","loadConfig","name","v","w","process","versions","node","resolve","r","paths","b","M","f","_findPath","_nodeModulePaths","concat","Error","code","conf","ext","extname","resolveShowConfigPath","targetPath","env","BABEL_SHOW_CONFIG_FOR","absolutePath","stats","stat","isFile"],"sources":["../../../src/config/files/configuration.ts"],"sourcesContent":["import buildDebug from \"debug\";\nimport nodeFs from \"node:fs\";\nimport path from \"node:path\";\nimport json5 from \"json5\";\nimport gensync from \"gensync\";\nimport type { Handler } from \"gensync\";\nimport { makeWeakCache, makeWeakCacheSync } from \"../caching.ts\";\nimport type { CacheConfigurator } from \"../caching.ts\";\nimport { makeConfigAPI } from \"../helpers/config-api.ts\";\nimport type { ConfigAPI } from \"../helpers/config-api.ts\";\nimport { makeStaticFileCache } from \"./utils.ts\";\nimport loadCodeDefault from \"./module-types.ts\";\nimport pathPatternToRegex from \"../pattern-to-regex.ts\";\nimport type { FilePackageData, RelativeConfig, ConfigFile } from \"./types.ts\";\nimport type { CallerMetadata, InputOptions } from \"../validation/options.ts\";\nimport ConfigError from \"../../errors/config-error.ts\";\n\nimport * as fs from \"../../gensync-utils/fs.ts\";\n\nimport { createRequire } from \"node:module\";\nimport { endHiddenCallStack } from \"../../errors/rewrite-stack-trace.ts\";\nimport { isAsync } from \"../../gensync-utils/async.ts\";\nconst require = createRequire(import.meta.url);\n\nconst debug = buildDebug(\"babel:config:loading:files:configuration\");\n\nexport const ROOT_CONFIG_FILENAMES = [\n \"babel.config.js\",\n \"babel.config.cjs\",\n \"babel.config.mjs\",\n \"babel.config.json\",\n \"babel.config.cts\",\n \"babel.config.ts\",\n \"babel.config.mts\",\n];\nconst RELATIVE_CONFIG_FILENAMES = [\n \".babelrc\",\n \".babelrc.js\",\n \".babelrc.cjs\",\n \".babelrc.mjs\",\n \".babelrc.json\",\n \".babelrc.cts\",\n];\n\nconst BABELIGNORE_FILENAME = \".babelignore\";\n\ntype ConfigCacheData = {\n envName: string;\n caller: CallerMetadata | undefined;\n};\n\nconst runConfig = makeWeakCache(function* runConfig(\n options: Function,\n cache: CacheConfigurator<ConfigCacheData>,\n): Handler<{\n options: InputOptions | null;\n cacheNeedsConfiguration: boolean;\n}> {\n // if we want to make it possible to use async configs\n yield* [];\n\n return {\n options: endHiddenCallStack(options as any as (api: ConfigAPI) => unknown)(\n makeConfigAPI(cache),\n ),\n cacheNeedsConfiguration: !cache.configured(),\n };\n});\n\nfunction* readConfigCode(\n filepath: string,\n data: ConfigCacheData,\n): Handler<ConfigFile | null> {\n if (!nodeFs.existsSync(filepath)) return null;\n\n let options = yield* loadCodeDefault(\n filepath,\n (yield* isAsync()) ? \"auto\" : \"require\",\n \"You appear to be using a native ECMAScript module configuration \" +\n \"file, which is only supported when running Babel asynchronously \" +\n \"or when using the Node.js `--experimental-require-module` flag.\",\n \"You appear to be using a configuration file that contains top-level \" +\n \"await, which is only supported when running Babel asynchronously.\",\n );\n\n let cacheNeedsConfiguration = false;\n if (typeof options === \"function\") {\n ({ options, cacheNeedsConfiguration } = yield* runConfig(options, data));\n }\n\n if (!options || typeof options !== \"object\" || Array.isArray(options)) {\n throw new ConfigError(\n `Configuration should be an exported JavaScript object.`,\n filepath,\n );\n }\n\n // @ts-expect-error todo(flow->ts)\n if (typeof options.then === \"function\") {\n // @ts-expect-error We use ?. in case options is a thenable but not a promise\n options.catch?.(() => {});\n throw new ConfigError(\n `You appear to be using an async configuration, ` +\n `which your current version of Babel does not support. ` +\n `We may add support for this in the future, ` +\n `but if you're on the most recent version of @babel/core and still ` +\n `seeing this error, then you'll need to synchronously return your config.`,\n filepath,\n );\n }\n\n if (cacheNeedsConfiguration) throwConfigError(filepath);\n\n return buildConfigFileObject(options, filepath);\n}\n\n// We cache the generated ConfigFile object rather than creating a new one\n// every time, so that it can be used as a cache key in other functions.\nconst cfboaf /* configFilesByOptionsAndFilepath */ = new WeakMap<\n InputOptions,\n Map<string, ConfigFile>\n>();\nfunction buildConfigFileObject(\n options: InputOptions,\n filepath: string,\n): ConfigFile {\n let configFilesByFilepath = cfboaf.get(options);\n if (!configFilesByFilepath) {\n cfboaf.set(options, (configFilesByFilepath = new Map()));\n }\n\n let configFile = configFilesByFilepath.get(filepath);\n if (!configFile) {\n configFile = {\n filepath,\n dirname: path.dirname(filepath),\n options,\n };\n configFilesByFilepath.set(filepath, configFile);\n }\n\n return configFile;\n}\n\nconst packageToBabelConfig = makeWeakCacheSync(\n (file: ConfigFile): ConfigFile | null => {\n const babel: unknown = file.options.babel;\n\n if (babel === undefined) return null;\n\n if (typeof babel !== \"object\" || Array.isArray(babel) || babel === null) {\n throw new ConfigError(`.babel property must be an object`, file.filepath);\n }\n\n return {\n filepath: file.filepath,\n dirname: file.dirname,\n options: babel,\n };\n },\n);\n\nconst readConfigJSON5 = makeStaticFileCache((filepath, content): ConfigFile => {\n let options;\n try {\n options = json5.parse(content);\n } catch (err) {\n throw new ConfigError(\n `Error while parsing config - ${err.message}`,\n filepath,\n );\n }\n\n if (!options) throw new ConfigError(`No config detected`, filepath);\n\n if (typeof options !== \"object\") {\n throw new ConfigError(`Config returned typeof ${typeof options}`, filepath);\n }\n if (Array.isArray(options)) {\n throw new ConfigError(`Expected config object but found array`, filepath);\n }\n\n delete options.$schema;\n\n return {\n filepath,\n dirname: path.dirname(filepath),\n options,\n };\n});\n\nconst readIgnoreConfig = makeStaticFileCache((filepath, content) => {\n const ignoreDir = path.dirname(filepath);\n const ignorePatterns = content\n .split(\"\\n\")\n .map(line =>\n line.replace(process.env.BABEL_8_BREAKING ? /^#.*$/ : /#.*$/, \"\").trim(),\n )\n .filter(Boolean);\n\n for (const pattern of ignorePatterns) {\n if (pattern.startsWith(\"!\")) {\n throw new ConfigError(\n `Negation of file paths is not supported.`,\n filepath,\n );\n }\n }\n\n return {\n filepath,\n dirname: path.dirname(filepath),\n ignore: ignorePatterns.map(pattern =>\n pathPatternToRegex(pattern, ignoreDir),\n ),\n };\n});\n\nexport function findConfigUpwards(rootDir: string): string | null {\n let dirname = rootDir;\n for (;;) {\n for (const filename of ROOT_CONFIG_FILENAMES) {\n if (nodeFs.existsSync(path.join(dirname, filename))) {\n return dirname;\n }\n }\n\n const nextDir = path.dirname(dirname);\n if (dirname === nextDir) break;\n dirname = nextDir;\n }\n\n return null;\n}\n\nexport function* findRelativeConfig(\n packageData: FilePackageData,\n envName: string,\n caller: CallerMetadata | undefined,\n): Handler<RelativeConfig> {\n let config = null;\n let ignore = null;\n\n const dirname = path.dirname(packageData.filepath);\n\n for (const loc of packageData.directories) {\n if (!config) {\n config = yield* loadOneConfig(\n RELATIVE_CONFIG_FILENAMES,\n loc,\n envName,\n caller,\n packageData.pkg?.dirname === loc\n ? packageToBabelConfig(packageData.pkg)\n : null,\n );\n }\n\n if (!ignore) {\n const ignoreLoc = path.join(loc, BABELIGNORE_FILENAME);\n ignore = yield* readIgnoreConfig(ignoreLoc);\n\n if (ignore) {\n debug(\"Found ignore %o from %o.\", ignore.filepath, dirname);\n }\n }\n }\n\n return { config, ignore };\n}\n\nexport function findRootConfig(\n dirname: string,\n envName: string,\n caller: CallerMetadata | undefined,\n): Handler<ConfigFile | null> {\n return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller);\n}\n\nfunction* loadOneConfig(\n names: string[],\n dirname: string,\n envName: string,\n caller: CallerMetadata | undefined,\n previousConfig: ConfigFile | null = null,\n): Handler<ConfigFile | null> {\n const configs = yield* gensync.all(\n names.map(filename =>\n readConfig(path.join(dirname, filename), envName, caller),\n ),\n );\n const config = configs.reduce((previousConfig: ConfigFile | null, config) => {\n if (config && previousConfig) {\n throw new ConfigError(\n `Multiple configuration files found. Please remove one:\\n` +\n ` - ${path.basename(previousConfig.filepath)}\\n` +\n ` - ${config.filepath}\\n` +\n `from ${dirname}`,\n );\n }\n\n return config || previousConfig;\n }, previousConfig);\n\n if (config) {\n debug(\"Found configuration %o from %o.\", config.filepath, dirname);\n }\n return config;\n}\n\nexport function* loadConfig(\n name: string,\n dirname: string,\n envName: string,\n caller: CallerMetadata | undefined,\n): Handler<ConfigFile> {\n const filepath = require.resolve(name, { paths: [dirname] });\n\n const conf = yield* readConfig(filepath, envName, caller);\n if (!conf) {\n throw new ConfigError(\n `Config file contains no configuration data`,\n filepath,\n );\n }\n\n debug(\"Loaded config %o from %o.\", name, dirname);\n return conf;\n}\n\n/**\n * Read the given config file, returning the result. Returns null if no config was found, but will\n * throw if there are parsing errors while loading a config.\n */\nfunction readConfig(\n filepath: string,\n envName: string,\n caller: CallerMetadata | undefined,\n): Handler<ConfigFile | null> {\n const ext = path.extname(filepath);\n switch (ext) {\n case \".js\":\n case \".cjs\":\n case \".mjs\":\n case \".ts\":\n case \".cts\":\n case \".mts\":\n return readConfigCode(filepath, { envName, caller });\n default:\n return readConfigJSON5(filepath);\n }\n}\n\nexport function* resolveShowConfigPath(\n dirname: string,\n): Handler<string | null> {\n const targetPath = process.env.BABEL_SHOW_CONFIG_FOR;\n if (targetPath != null) {\n const absolutePath = path.resolve(dirname, targetPath);\n const stats = yield* fs.stat(absolutePath);\n if (!stats.isFile()) {\n throw new Error(\n `${absolutePath}: BABEL_SHOW_CONFIG_FOR must refer to a regular file, directories are not supported.`,\n );\n }\n return absolutePath;\n }\n return null;\n}\n\nfunction throwConfigError(filepath: string): never {\n throw new ConfigError(\n `\\\nCaching was left unconfigured. Babel's plugins, presets, and .babelrc.js files can be configured\nfor various types of caching, using the first param of their handler functions:\n\nmodule.exports = function(api) {\n // The API exposes the following:\n\n // Cache the returned value forever and don't call this function again.\n api.cache(true);\n\n // Don't cache at all. Not recommended because it will be very slow.\n api.cache(false);\n\n // Cached based on the value of some function. If this function returns a value different from\n // a previously-encountered value, the plugins will re-evaluate.\n var env = api.cache(() => process.env.NODE_ENV);\n\n // If testing for a specific env, we recommend specifics to avoid instantiating a plugin for\n // any possible NODE_ENV value that might come up during plugin execution.\n var isProd = api.cache(() => process.env.NODE_ENV === \"production\");\n\n // .cache(fn) will perform a linear search though instances to find the matching plugin based\n // based on previous instantiated plugins. If you want to recreate the plugin and discard the\n // previous instance whenever something changes, you may use:\n var isProd = api.cache.invalidate(() => process.env.NODE_ENV === \"production\");\n\n // Note, we also expose the following more-verbose versions of the above examples:\n api.cache.forever(); // api.cache(true)\n api.cache.never(); // api.cache(false)\n api.cache.using(fn); // api.cache(fn)\n\n // Return the value that will be cached.\n return { };\n};`,\n filepath,\n );\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,IAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EA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GAAG,GAAGxE,MAAGA,CAAC,CAACyE,OAAO,CAAC7F,QAAQ,CAAC;EAClC,QAAQ4F,GAAG;IACT,KAAK,KAAK;IACV,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,KAAK;IACV,KAAK,MAAM;IACX,KAAK,MAAM;MACT,OAAO7F,cAAc,CAACC,QAAQ,EAAE;QAAEuD,OAAO;QAAEC;MAAO,CAAC,CAAC;IACtD;MACE,OAAO9B,eAAe,CAAC1B,QAAQ,CAAC;EACpC;AACF;AAEO,UAAU8F,qBAAqBA,CACpC3E,OAAe,EACS;EACxB,MAAM4E,UAAU,GAAGlB,OAAO,CAACmB,GAAG,CAACC,qBAAqB;EACpD,IAAIF,UAAU,IAAI,IAAI,EAAE;IACtB,MAAMG,YAAY,GAAG9E,MAAGA,CAAC,CAAC4D,OAAO,CAAC7D,OAAO,EAAE4E,UAAU,CAAC;IACtD,MAAMI,KAAK,GAAG,OAAOrH,EAAE,CAACsH,IAAI,CAACF,YAAY,CAAC;IAC1C,IAAI,CAACC,KAAK,CAACE,MAAM,CAAC,CAAC,EAAE;MACnB,MAAM,IAAIZ,KAAK,CACb,GAAGS,YAAY,sFACjB,CAAC;IACH;IACA,OAAOA,YAAY;EACrB;EACA,OAAO,IAAI;AACb;AAEA,SAASxF,gBAAgBA,CAACV,QAAgB,EAAS;EACjD,MAAM,IAAIO,oBAAW,CACnB;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,EACCP,QACF,CAAC;AACH;AAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["module","exports","import_","filepath"],"sources":["../../../src/config/files/import.cjs"],"sourcesContent":["// We keep this in a separate file so that in older node versions, where\n// import() isn't supported, we can try/catch around the require() call\n// when loading this file.\n\nmodule.exports = function import_(filepath) {\n return import(filepath);\n};\n"],"mappings":"AAIAA,MAAM,CAACC,OAAO,GAAG,SAASC,OAAOA,CAACC,QAAQ,EAAE;EAC1C,OAAO,OAAOA,QAAQ,CAAC;AACzB,CAAC;AAAC","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ROOT_CONFIG_FILENAMES = void 0;
|
|
7
|
+
exports.findConfigUpwards = findConfigUpwards;
|
|
8
|
+
exports.findPackageData = findPackageData;
|
|
9
|
+
exports.findRelativeConfig = findRelativeConfig;
|
|
10
|
+
exports.findRootConfig = findRootConfig;
|
|
11
|
+
exports.loadConfig = loadConfig;
|
|
12
|
+
exports.loadPlugin = loadPlugin;
|
|
13
|
+
exports.loadPreset = loadPreset;
|
|
14
|
+
exports.resolvePlugin = resolvePlugin;
|
|
15
|
+
exports.resolvePreset = resolvePreset;
|
|
16
|
+
exports.resolveShowConfigPath = resolveShowConfigPath;
|
|
17
|
+
function findConfigUpwards(rootDir) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
function* findPackageData(filepath) {
|
|
21
|
+
return {
|
|
22
|
+
filepath,
|
|
23
|
+
directories: [],
|
|
24
|
+
pkg: null,
|
|
25
|
+
isPackage: false
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function* findRelativeConfig(pkgData, envName, caller) {
|
|
29
|
+
return {
|
|
30
|
+
config: null,
|
|
31
|
+
ignore: null
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function* findRootConfig(dirname, envName, caller) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
function* loadConfig(name, dirname, envName, caller) {
|
|
38
|
+
throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);
|
|
39
|
+
}
|
|
40
|
+
function* resolveShowConfigPath(dirname) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = [];
|
|
44
|
+
function resolvePlugin(name, dirname) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
function resolvePreset(name, dirname) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
function loadPlugin(name, dirname) {
|
|
51
|
+
throw new Error(`Cannot load plugin ${name} relative to ${dirname} in a browser`);
|
|
52
|
+
}
|
|
53
|
+
function loadPreset(name, dirname) {
|
|
54
|
+
throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`);
|
|
55
|
+
}
|
|
56
|
+
0 && 0;
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=index-browser.js.map
|