@fernir2/saas-kit-cli 0.1.38 → 0.1.39
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/base-repo/app-constants/alias-symbols.cjs.js +1 -1
- package/base-repo/app-constants/alias-symbols.js +1 -1
- package/base-repo/app-constants/aliases.cjs.js +1 -1
- package/base-repo/app-constants/aliases.js +1 -1
- package/base-repo/app-constants/project-paths.cjs.js +1 -1
- package/base-repo/app-constants/project-paths.js +1 -1
- package/cli/bin/create.ts +9 -14
- package/cli/configs/drizzle-cli-config.ts +2 -2
- package/cli/npm-commands/gen-meta.ts +2 -2
- package/cli/npm-commands/migrate-db.ts +2 -2
- package/cli/npm-commands/seed-db.ts +2 -2
- package/cli/server.ts +2 -2
- package/cli/src/app/f/(signed-in)/layout.tsx +5 -0
- package/cli/test/global-setup.ts +2 -24
- package/fd-toolbox/api/api-client.cjs.js +1 -1
- package/fd-toolbox/api/api-client.js +1 -1
- package/fd-toolbox/api/api-path-names.cjs.js +2 -2
- package/fd-toolbox/api/api-paths.cjs.js +1 -1
- package/fd-toolbox/api/api-paths.js +1 -1
- package/fd-toolbox/api/base-api.cjs.js +1 -1
- package/fd-toolbox/api/base-api.js +1 -1
- package/fd-toolbox/auth/login-states.cjs.js +1 -1
- package/fd-toolbox/auth/login-states.js +1 -1
- package/fd-toolbox/auth/session-storage.cjs.js +1 -1
- package/fd-toolbox/auth/session-storage.js +1 -1
- package/fd-toolbox/auth/tokens.cjs.js +1 -1
- package/fd-toolbox/auth/tokens.js +1 -1
- package/fd-toolbox/constants/constants.cjs.js +1 -1
- package/fd-toolbox/constants/constants.js +1 -1
- package/fd-toolbox/enums/enums.cjs.js +1 -1
- package/fd-toolbox/enums/enums.js +1 -1
- package/fd-toolbox/errors/error-handler.cjs.js +1 -1
- package/fd-toolbox/errors/error-handler.js +1 -1
- package/fd-toolbox/errors/errors.cjs.js +1 -1
- package/fd-toolbox/errors/errors.js +1 -1
- package/fd-toolbox/errors/problem-details.cjs.js +1 -1
- package/fd-toolbox/errors/problem-details.js +1 -1
- package/fd-toolbox/functions/value-checking-functions.cjs.js +1 -1
- package/fd-toolbox/functions/value-checking-functions.js +1 -1
- package/fd-toolbox/http/url/urls.cjs.js +1 -1
- package/fd-toolbox/http/url/urls.js +1 -1
- package/fd-toolbox/infra/env-config.cjs.js +2 -2
- package/fd-toolbox/infra/env-config.js +2 -2
- package/fd-toolbox/infra/env-functions.cjs.js +1 -1
- package/fd-toolbox/infra/env-functions.js +1 -1
- package/fd-toolbox/infra/env-schema.cjs.js +2 -2
- package/fd-toolbox/infra/env-schema.js +2 -2
- package/fd-toolbox/infra/env-store.cjs.js +1 -1
- package/fd-toolbox/infra/env-store.js +1 -1
- package/fd-toolbox/infra/toolbox-env-setting-keys.cjs.js +1 -1
- package/fd-toolbox/infra/toolbox-env-setting-keys.js +1 -1
- package/fd-toolbox/lib/environments.cjs.js +1 -1
- package/fd-toolbox/lib/environments.js +1 -1
- package/fd-toolbox/lib/utils.cjs.js +1 -1
- package/fd-toolbox/lib/utils.js +1 -1
- package/fd-toolbox/local-storage/local-storage.cjs.js +1 -1
- package/fd-toolbox/local-storage/local-storage.js +1 -1
- package/fd-toolbox/logging/loggers.cjs.js +1 -1
- package/fd-toolbox/logging/loggers.js +1 -1
- package/fd-toolbox/notifications.cjs.js +2 -2
- package/fd-toolbox/notifications.js +2 -2
- package/fd-toolbox/odata/odata-constants.cjs.js +1 -1
- package/fd-toolbox/odata/odata-constants.js +1 -1
- package/fd-toolbox/odata/odatas.cjs.js +1 -1
- package/fd-toolbox/odata/odatas.js +1 -1
- package/fd-toolbox/odata/services/odata-filters.cjs.js +1 -1
- package/fd-toolbox/odata/services/odata-filters.js +1 -1
- package/fd-toolbox/paths/paths-names.cjs.js +2 -2
- package/fd-toolbox/paths/paths-names.js +1 -1
- package/fd-toolbox/routing/login-routers.cjs.js +1 -1
- package/fd-toolbox/routing/login-routers.js +1 -1
- package/fd-toolbox/routing/paths.cjs.js +1 -1
- package/fd-toolbox/routing/paths.js +1 -1
- package/fd-toolbox/strings/strings-constants.cjs.js +1 -1
- package/fd-toolbox/strings/strings-constants.js +1 -1
- package/fd-toolbox/strings/strings.cjs.js +1 -1
- package/fd-toolbox/strings/strings.js +1 -1
- package/fd-toolbox/types/ensure-type.cjs.js +1 -1
- package/fd-toolbox/types/ensure-type.js +1 -1
- package/fd-toolbox-core/core/name-of.cjs.js +1 -1
- package/fd-toolbox-core/core/name-of.js +1 -1
- package/fd-toolbox-core/types/resource-with-id.cjs.js +1 -1
- package/fd-toolbox-core/types/resource-with-id.js +1 -1
- package/level2/cli/bin/index.cjs.js +1 -1
- package/level2/cli/bin/index.js +1 -1
- package/level2/cli/create/bin/create.cjs.js +4 -4
- package/level2/cli/create/bin/create.js +3 -3
- package/level2/npm-commands/build-npm/path.cjs.js +2 -2
- package/level2/npm-commands/build-npm/path.js +3 -3
- package/package.json +3 -2
- package/cli/public/images/shipment/076aecd1-7fb8-5d89-baa9-e48e61048525.pdf +0 -0
- package/cli/public/images/shipment/21884fb7-6e39-4f7b-9a49-0f46d527f50c.pdf +0 -0
- package/cli/public/images/shipment/e6367904-081e-479b-a8c5-5972057a261e.pdf +0 -0
- package/cli/public/images/store/00000000-0000-0000-0000-000000000000.webp +0 -0
- package/cli/public/images/test/photo-1460925895917-afdab827c52f.jpg +0 -0
- package/cli/public/images/test/photo-1499636136210-6f4ee915583e.jpg +0 -0
- package/cli/public/images/test/photo-1519681393784-d120267933ba.jpg +0 -0
- package/cli/src/app/api/v1/[resourceName]/[id]/route.ts +0 -11
- package/cli/src/app/api/v1/[resourceName]/route.ts +0 -14
- package/cli/src/app/api/v1/[resourceName]/upsert/route.ts +0 -3
- package/cli/src/app/api/v1/blob/route.ts +0 -7
- package/cli/src/app/api/v1/log/route.ts +0 -7
- package/cli/src/app/api/v1/otheruser/[id]/route.ts +0 -14
- package/cli/src/app/api/v1/otheruser/route.ts +0 -7
- package/cli/src/app/api/v1/password/forgotpassword/route.ts +0 -3
- package/cli/src/app/api/v1/password/resetpassword/route.ts +0 -3
- package/cli/src/app/api/v1/payment/method/route.ts +0 -4
- package/cli/src/app/api/v1/payment/route.ts +0 -3
- package/cli/src/app/api/v1/payment/verify-fail/route.ts +0 -3
- package/cli/src/app/api/v1/payment/verify-success/route.ts +0 -3
- package/cli/src/app/api/v1/preload/route.ts +0 -3
- package/cli/src/app/api/v1/searchable-resources/route.ts +0 -11
- package/cli/src/app/api/v1/searchresult/route.ts +0 -35
- package/cli/src/app/api/v1/sign-in/route.ts +0 -3
- package/cli/src/app/api/v1/sign-out/route.ts +0 -3
- package/cli/src/app/api/v1/sign-up/route.ts +0 -3
- package/cli/src/app/api/v1/subscription/cancel/route.ts +0 -3
- package/cli/src/app/api/v1/subscription/create/route.ts +0 -3
- package/cli/src/app/api/v1/subscription/update/route.ts +0 -3
- package/cli/src/app/api/v1/uimeta/route.ts +0 -3
- package/cli/src/app/api/v1/uimetas/route.ts +0 -3
- package/cli/src/app/api/v1/userfeature/isenabled/route.ts +0 -3
- package/cli/src/app/api/v1/userpermission/route.ts +0 -3
- package/cli/src/app/api/v1/visible-workspace/route.ts +0 -5
- package/cli/src/app/api/v1/workspace/change/route.ts +0 -5
- package/cli/src/app/f/(private)/layout.tsx +0 -5
- package/cli/src/app/f/defaultRedirect/page.tsx +0 -9
- package/cli/src/app/f/editpassword/page.tsx +0 -8
- package/cli/src/app/f/forgotpassword/page.tsx +0 -13
- package/cli/src/app/f/resetpassword/page.tsx +0 -11
- /package/cli/src/app/f/{edit-password → (not-signed-in)/edit-password}/page.tsx +0 -0
- /package/cli/src/app/f/{forgot-password → (not-signed-in)/forgot-password}/page.tsx +0 -0
- /package/cli/src/app/f/{reset-password → (not-signed-in)/reset-password}/page.tsx +0 -0
- /package/cli/src/app/f/{sign-in → (not-signed-in)/sign-in}/microsoft/page.tsx +0 -0
- /package/cli/src/app/f/{sign-in → (not-signed-in)/sign-in}/page.tsx +0 -0
- /package/cli/src/app/f/{sign-up → (not-signed-in)/sign-up}/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/dashboard/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/dynamiclayout/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/edituser/[id]/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/edituser/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/lm/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/payment-plans/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/preload/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/statusboard/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/userlist/page.tsx +0 -0
- /package/cli/src/app/f/{(private) → (signed-in)}/view/page.tsx +0 -0
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { execSync } from 'child_process';
|
|
3
3
|
import { existsSync, promises, mkdirSync, rmSync } from 'fs';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
5
|
+
import * as _0x2657b6 from 'path';
|
|
6
|
+
import _0x4e9839 from 'node:fs';
|
|
7
7
|
import { toolsFoldersToReplace, additionalFoldersToCreate } from '../../../../base-repo/constants/create-app-constants.js';
|
|
8
8
|
import { logStringError, logInfoRaw } from '../../../../fd-toolbox/logging/loggers.js';
|
|
9
9
|
import { projectName } from '../../../../fd-toolbox/constants/constants.js';
|
|
@@ -15,6 +15,6 @@ import { aliasSymbols } from '../../../../base-repo/app-constants/aliases.js';
|
|
|
15
15
|
import { isWithIndexer, isString } from '../../../../fd-toolbox/types/ensure-type.js';
|
|
16
16
|
import { cliScripts, cliEslintContent } from '../../../npm-commands/build-npm/cli-contents.js';
|
|
17
17
|
|
|
18
|
-
var __defProp=Object['defineProperty'],__name=(_0x59bd8c,_0x22c9fe)=>__defProp(_0x59bd8c,'name',{'value':_0x22c9fe,'configurable':!![]});const requiredNodeVersion='v20.0.0';process['version']<requiredNodeVersion&&(logStringError('Node.js\x20'+requiredNodeVersion+'+\x20is\x20required'),process['exit'](0x1b7*0x11+0x22bf+-0x3fe5*0x1));const filename=fileURLToPath(import.meta.url),sourceDir='../../../../',binDir=_0x2abbe5['dirname'](filename),repoRoot=_0x2abbe5['resolve'](binDir,sourceDir),envLocalPath=_0x2abbe5['join'](binDir,sourceDir+folders['cli']+'/'+files['envExample']),envTemplate=_0xbe647a['readFileSync'](envLocalPath,'utf8'),foldersToIgnore=[folders['cli']+'/'+folders['constants'],folders['cli']+'/'+files['packageTemplate'],folders['cli']+'/'+files['envExample'],folders['cli']+'/'+folders['bin'],folders['cli']+'/'+folders['configs']];function runCommand(_0x44752e,_0x3b6e76){logInfoRaw('Executing:\x20'+_0x44752e);try{execSync(_0x44752e,{'stdio':'inherit','cwd':_0x3b6e76??process['cwd']()});}catch(_0x2b1809){const _0x4b70bf=_0x2b1809 instanceof Error?_0x2b1809['message']:'Unknown\x20error';logStringError('Error\x20executing:\x20'+_0x44752e),logStringError(_0x4b70bf),process['exit'](-0x2399+0x1e05+0x595);}}__name(runCommand,'runCommand');function checkTargetFolder(_0x4f2edc){existsSync(_0x4f2edc)&&(logStringError('Error:\x20Folder\x20\x22'+_0x2abbe5['basename'](_0x4f2edc)+'\x22\x20already\x20exists.'),process['exit'](0x14b3+0xd1e*-0x2+0x58a));}__name(checkTargetFolder,'checkTargetFolder');function getCreateNextAppVersion(){const _0x34ae0f=_0x2abbe5['resolve'](repoRoot,files['packageJson']),_0x453ccd=JSON['parse'](_0xbe647a['readFileSync'](_0x34ae0f,'utf-8'));return String(_0x453ccd['devDependencies']?.['next']??_0x453ccd['dependencies']?.['next']??'latest');}__name(getCreateNextAppVersion,'getCreateNextAppVersion');function createNextProject(_0x2e3841,_0x585859){logInfoRaw('Creating\x20Next.js\x20project...');const _0x32639d=getCreateNextAppVersion(),_0x936ecf=['npx\x20--yes\x20create-next-app@'+_0x32639d+'\x20\x22'+_0x2e3841+'\x22','--typescript','--tailwind','--eslint','--app','--src-dir','--turbopack','--no-import-alias','--no-git','--react-compiler']['join']('\x20');runCommand(_0x936ecf,_0x2abbe5['dirname'](_0x585859)),logInfoRaw('Next.js\x20project\x20created!');const _0x4f3530=_0x2abbe5['join'](_0x585859,'next.config.ts'),_0xfc8679=_0x2abbe5['join'](_0x585859,folders['public']);_0xbe647a['existsSync'](_0x4f3530)&&(_0xbe647a['rmSync'](_0x4f3530),logInfoRaw('Removed\x20default\x20next.config.ts')),_0xbe647a['existsSync'](_0xfc8679)&&(_0xbe647a['rmSync'](_0xfc8679,{'recursive':!![],'force':!![]}),logInfoRaw('Removed\x20default\x20public\x20folder')),_0xbe647a['mkdirSync'](_0xfc8679);}__name(createNextProject,'createNextProject');async function createEnvFile(_0x42d5b2){logInfoRaw('Creating\x20'+files['env']+'\x20file\x20with\x20default\x20values...');const _0x8d3c2e=_0x2abbe5['join'](_0x42d5b2,files['env']);try{await promises['writeFile'](_0x8d3c2e,envTemplate,'utf8'),logInfoRaw(files['env']+'\x20file\x20created\x20with\x20values!');}catch(_0x57ab78){const _0x43e7ff=_0x57ab78 instanceof Error?_0x57ab78['message']:'Unknown\x20error';logStringError('Error\x20creating\x20'+files['env']+'\x20file:'),logStringError(_0x43e7ff);throw _0x57ab78;}}__name(createEnvFile,'createEnvFile');async function overridePackageJson(_0x57ef22){const _0x417f7a=_0x2abbe5['join'](_0x57ef22,files['packageJson']),_0x40027f=_0x2abbe5['join'](repoRoot,folders['cli']+'/'+files['packageTemplate']);try{const _0x19ee5e=JSON['parse'](await promises['readFile'](_0x417f7a,'utf8')),_0x283df0=_0x19ee5e['name'],_0x4635b8=JSON['parse'](await promises['readFile'](_0x40027f,'utf8')),_0x42687c={..._0x4635b8,'name':_0x283df0};await promises['writeFile'](_0x417f7a,JSON['stringify'](_0x42687c,null,-0x240b*0x1+0x1765+-0x2*-0x654)+'\x0a','utf8');}catch(_0x2e4189){const _0x21caaa=_0x2e4189 instanceof Error?_0x2e4189['message']:'Unknown\x20error';logStringError('Error\x20overriding\x20'+files['packageJson']+':'),logStringError(_0x21caaa);throw _0x2e4189;}}__name(overridePackageJson,'overridePackageJson');function replaceImports(_0xd3316f){const _0x3fb3bb=/(import\s+)([^'"]+)(\s+from\s+["'])([^"']+)(["'])/g;return _0xd3316f['replace'](_0x3fb3bb,(_0x2ee833,_0x406b56,_0x20384,_0x3d11da,_0x44a9dc,_0x294422)=>{if(!_0x44a9dc['startsWith'](aliasSymbols['atSign'])||_0x44a9dc['startsWith'](npmPackages['saasKit']))return _0x2ee833;let _0x559a9b;_0x44a9dc['startsWith'](aliasSymbols['atSign']+folders['server'])||_0x44a9dc['includes'](''+nonRootProjectPaths['server'])?_0x559a9b=npmPackages['saasKitServer']:_0x559a9b=npmPackages['saasKit'];let _0x69074=_0x20384['trim']();const _0x46fa07=/^type\b/['test'](_0x69074),_0x34fc8b=/^\*\s+as\s+/['test'](_0x69074);return !_0x46fa07&&!_0x34fc8b&&!_0x69074['startsWith']('{')&&(_0x69074='{\x20'+_0x69074+'\x20}'),''+_0x406b56+_0x69074+_0x3d11da+_0x559a9b+_0x294422;});}__name(replaceImports,'replaceImports');async function copyProjectFiles(_0x254aee){logInfoRaw('Copying\x20'+projectName+'\x20files...');for(const _0x6dcdc8 of allFilesToCopy){const _0x2d258e=_0x6dcdc8['replace'](/\[(.)\]/g,'$1'),_0x2f215b=folders['cli']+'/'+_0x2d258e,_0x597c07=_0x2abbe5['join'](repoRoot,_0x2f215b),_0x1bed2b=replaceToolsFolder(_0x2d258e),_0x16dcfc=_0x2abbe5['join'](_0x254aee,_0x1bed2b);if(existsSync(_0x597c07)){const _0x1f8381=await promises['stat'](_0x597c07);_0x1f8381['isDirectory']()?await copyDirectoryContents(_0x597c07,_0x16dcfc):await copyAndProcessFile(_0x597c07,_0x16dcfc);}else logInfoRaw('Source\x20file\x20not\x20found:\x20'+_0x2f215b);}logInfoRaw('Files\x20copied\x20and\x20imports\x20updated!');}__name(copyProjectFiles,'copyProjectFiles');function replaceToolsFolder(_0x1e4ea2){let _0x4ee4c1=_0x1e4ea2;for(const [_0x29a402,_0x371eac]of Object['entries'](toolsFoldersToReplace)){if(_0x4ee4c1['startsWith'](_0x29a402)&&isWithIndexer(_0x371eac)){const _0x16a723=_0x371eac;for(const _0x1f6a08 in _0x16a723){const _0x53276e=_0x16a723[_0x1f6a08];isString(_0x53276e)&&(_0x4ee4c1=_0x4ee4c1['replace'](_0x1f6a08,_0x53276e));}break;}}return _0x4ee4c1;}__name(replaceToolsFolder,'replaceToolsFolder');function shouldIgnorePath(_0x536965,_0x5b2340,_0x580c36=![]){const _0x5133e2=_0x2abbe5['relative'](repoRoot,_0x536965)['replace'](/\\/g,'/'),_0x3ef87d=foldersToIgnore['map'](_0x2a73ce=>_0x2a73ce['replace'](/\\/g,'/'));if(_0x3ef87d['includes'](_0x5133e2))return !![];if(_0x580c36){const _0xf443f9=_0x2abbe5['relative'](_0x5b2340,_0x536965)['replace'](/\\/g,'/'),_0x18840e=_0xf443f9['split']('/');return _0x3ef87d['some'](_0xe63b85=>_0x18840e['some'](_0x8cb999=>_0x8cb999===_0xe63b85));}return ![];}__name(shouldIgnorePath,'shouldIgnorePath');async function copyDirectoryContents(_0x3ac55a,_0x2702ae){!existsSync(_0x2702ae)&&mkdirSync(_0x2702ae,{'recursive':!![]});try{const _0x4c5f0a=await promises['readdir'](_0x3ac55a,{'withFileTypes':!![]});for(const _0x4a9f93 of _0x4c5f0a){const _0x328f88=_0x2abbe5['join'](_0x3ac55a,_0x4a9f93['name']),_0x4b067c=_0x2abbe5['join'](_0x2702ae,_0x4a9f93['name']);!shouldIgnorePath(_0x328f88,_0x3ac55a,_0x4a9f93['isDirectory']())&&(_0x4a9f93['isDirectory']()?await copyDirectoryContents(_0x328f88,_0x4b067c):await copyAndProcessFile(_0x328f88,_0x4b067c));}}catch(_0xf301d0){const _0x4eeba1=_0xf301d0 instanceof Error?_0xf301d0['message']:'Unknown\x20error';logStringError('Error\x20reading\x20directory\x20'+_0x3ac55a+':\x20'+_0x4eeba1);throw _0xf301d0;}}__name(copyDirectoryContents,'copyDirectoryContents');async function copyAndProcessFile(_0x3d98de,_0x5096ab){const _0xe2df57=_0x2abbe5['dirname'](_0x5096ab);!existsSync(_0xe2df57)&&mkdirSync(_0xe2df57,{'recursive':!![]});const _0x517036=await promises['stat'](_0x3d98de);if(_0x517036['isDirectory']())await copyDirectoryContents(_0x3d98de,_0x5096ab);else {const _0x20fbed=_0x2abbe5['extname'](_0x3d98de)['toLowerCase'](),_0x41ec23=['.ico','.png','.jpg','.jpeg','.webp','.gif','.svg','.pdf'];if(_0x41ec23['includes'](_0x20fbed)){await promises['copyFile'](_0x3d98de,_0x5096ab);return;}const _0x99ba03=await promises['readFile'](_0x3d98de,'utf8'),_0x5b6053=replaceImports(_0x99ba03);await promises['writeFile'](_0x5096ab,_0x5b6053,'utf8');}}__name(copyAndProcessFile,'copyAndProcessFile');function createAdditionalFolders(_0x537066){for(const _0x2ac6e7 of additionalFoldersToCreate){const _0x520685=_0x2abbe5['join'](_0x537066,_0x2ac6e7);!existsSync(_0x520685)&&(mkdirSync(_0x520685,{'recursive':!![]}),logInfoRaw('Created\x20folder:\x20'+_0x2ac6e7));}logInfoRaw('Additional\x20folders\x20created!');}__name(createAdditionalFolders,'createAdditionalFolders');async function setupPreCommitHooks(_0x52365d){const _0x59b890=_0x2abbe5['join'](_0x52365d,folders['husky']),_0xba8aa7=_0x2abbe5['join'](_0x59b890,files['preCommit']),_0x5cd7cf=_0x2abbe5['join'](_0x59b890,files['commitMsg']);mkdirSync(_0x59b890,{'recursive':!![]}),await promises['writeFile'](_0xba8aa7,cliScripts['preCommit'],'utf8'),await promises['writeFile'](_0x5cd7cf,cliScripts['commitMsg'],'utf8'),runCommand(cliScripts['chmodPreCommit'],_0x52365d),runCommand(cliScripts['chmodCommitMsg'],_0x52365d);}__name(setupPreCommitHooks,'setupPreCommitHooks');async function setupEslintConfig(_0x3f0f20){const _0x187864=_0x2abbe5['join'](_0x3f0f20,files['eslintConfigMjs']);existsSync(_0x187864)&&await promises['rm'](_0x187864);const _0x49c128=_0x2abbe5['join'](_0x3f0f20,files['eslintConfigJs']);await promises['writeFile'](_0x49c128,cliEslintContent,'utf8');}__name(setupEslintConfig,'setupEslintConfig');async function enableRepoModeExtras(_0x14b07f){logInfoRaw('Enabling\x20recommendation\x20mode\x20(-r)...'),runCommand(cliScripts['gitInit'],_0x14b07f),runCommand(cliScripts['installDevHuskyTsx'],_0x14b07f),runCommand(cliScripts['setLint'],_0x14b07f),runCommand(cliScripts['installHusky'],_0x14b07f),await setupPreCommitHooks(_0x14b07f);}__name(enableRepoModeExtras,'enableRepoModeExtras');async function updateLayoutTitle(_0x34eccd,_0x203ebb){const _0x550717=_0x2abbe5['join'](_0x34eccd,projectPaths['app']+'/'+files['layout']);if(!existsSync(_0x550717))throw createError(files['layout']+'\x20not\x20found\x20at\x20'+_0x550717+',\x20cannot\x20update\x20title.');let _0x3ef347=await promises['readFile'](_0x550717,'utf8');const _0x42ad07=/"SaaS Kit"/g;if(!_0x42ad07['test'](_0x3ef347))throw createError('SaaS\x20Kit\x20not\x20found\x20in\x20'+files['layout']+',\x20cannot\x20update\x20title.');_0x3ef347=_0x3ef347['replace'](_0x42ad07,'\x22'+_0x203ebb+'\x22'),await promises['writeFile'](_0x550717,_0x3ef347,'utf8');}__name(updateLayoutTitle,'updateLayoutTitle');async function create(_0x5e9e1b){try{_0x5e9e1b['length']<-0x178c+-0x1*-0x18b+-0x9*-0x272&&(logStringError('Error:\x20Specify\x20folder\x20name.\x20Example:\x20npx\x20create-saas-kit-app\x20<folder-name>'),process['exit'](0x5*0x705+0x50e+-0x2826));const _0x5df846=_0x5e9e1b[-0xa*-0x201+0x26a4+-0x3aae],_0x2f1ae1=_0x5e9e1b['includes']('-r'),_0x33204d=_0x2abbe5['resolve'](process['cwd'](),_0x5df846);logInfoRaw('\x0aCreating\x20'+projectName+'\x20project\x20\x22'+_0x5df846+'\x22...\x0a');try{checkTargetFolder(_0x33204d),createNextProject(_0x5df846,_0x33204d),await copyProjectFiles(_0x33204d),await overridePackageJson(_0x33204d),createAdditionalFolders(_0x33204d),await createEnvFile(_0x33204d),await updateLayoutTitle(_0x33204d,_0x5df846),await setupEslintConfig(_0x33204d),_0x2f1ae1&&await enableRepoModeExtras(_0x33204d),logInfoRaw('\x0a'+projectName+'\x20project\x20\x22'+_0x5df846+'\x22\x20is\x20ready!'),logInfoRaw('Next\x20steps:'),logInfoRaw('\x20\x20cd\x20'+_0x5df846),logInfoRaw('\x20\x20npm\x20run\x20prod'),logInfoRaw('\x20\x20npm\x20start');}catch(_0x51921d){const _0x55c938=_0x51921d instanceof Error?_0x51921d['message']:'Unknown\x20error';logStringError('Error:'),logStringError(_0x55c938),existsSync(_0x33204d)&&(logInfoRaw('Cleaning\x20up...'),rmSync(_0x33204d,{'recursive':!![],'force':!![]})),process['exit'](-0x120a+-0x160e*-0x1+-0x403);}}catch(_0x14e487){const _0x407113=_0x14e487 instanceof Error?_0x14e487['message']:'Unknown\x20error';logStringError('Unhandled\x20error:'),logStringError(_0x407113),process['exit'](-0x2de+0x1*-0xfa3+-0x941*-0x2);}}__name(create,'create');
|
|
18
|
+
var __defProp=Object['defineProperty'],__name=(_0x1b0777,_0x53b8d8)=>__defProp(_0x1b0777,'name',{'value':_0x53b8d8,'configurable':!![]});const requiredNodeVersion='v20.0.0';process['version']<requiredNodeVersion&&(logStringError('Node.js\x20'+requiredNodeVersion+'+\x20is\x20required'),process['exit'](0x1*-0x1585+0x19b*0xf+0x1*-0x28f));const filename=fileURLToPath(import.meta.url),sourceDir='../../../../',binDir=_0x2657b6['dirname'](filename),repoRoot=_0x2657b6['resolve'](binDir,sourceDir),envLocalPath=_0x2657b6['join'](binDir,sourceDir+folders['cli']+'/'+files['envExample']),envTemplate=_0x4e9839['readFileSync'](envLocalPath,'utf8'),foldersToIgnore=[folders['cli']+'/'+folders['constants'],folders['cli']+'/'+files['packageTemplate'],folders['cli']+'/'+files['envExample'],folders['cli']+'/'+folders['bin'],folders['cli']+'/'+folders['configs']];function runCommand(_0x4f479c,_0x4b5078){logInfoRaw('Executing:\x20'+_0x4f479c);try{execSync(_0x4f479c,{'stdio':'inherit','cwd':_0x4b5078??process['cwd']()});}catch(_0x5db369){const _0x390bed=_0x5db369 instanceof Error?_0x5db369['message']:'Unknown\x20error';logStringError('Error\x20executing:\x20'+_0x4f479c),logStringError(_0x390bed),process['exit'](-0x1355*0x2+-0x221+-0x7*-0x5d4);}}__name(runCommand,'runCommand');function checkTargetFolder(_0x4a064c){existsSync(_0x4a064c)&&(logStringError('Error:\x20Folder\x20\x22'+_0x2657b6['basename'](_0x4a064c)+'\x22\x20already\x20exists.'),process['exit'](-0x14dd+0x2512+-0x1034));}__name(checkTargetFolder,'checkTargetFolder');function getCreateNextAppVersion(){const _0x1cc3db=_0x2657b6['resolve'](repoRoot,files['packageJson']),_0x18c7f1=JSON['parse'](_0x4e9839['readFileSync'](_0x1cc3db,'utf-8'));return String(_0x18c7f1['devDependencies']?.['next']??_0x18c7f1['dependencies']?.['next']??'latest');}__name(getCreateNextAppVersion,'getCreateNextAppVersion');async function createNextProject(_0x43a2ec,_0x2c1a5c){logInfoRaw('Creating\x20Next.js\x20project...');const _0x52a455=getCreateNextAppVersion(),_0x4c18fa=['npx\x20--yes\x20create-next-app@'+_0x52a455+'\x20\x22'+_0x43a2ec+'\x22','--typescript','--tailwind','--eslint','--app','--src-dir','--turbopack','--no-import-alias','--no-git','--react-compiler']['join']('\x20');runCommand(_0x4c18fa,_0x2657b6['dirname'](_0x2c1a5c)),logInfoRaw('Next.js\x20project\x20created!');const _0x49a50b=_0x2657b6['join'](_0x2c1a5c,'next.config.ts'),_0x4d972b=_0x2657b6['join'](_0x2c1a5c,folders['public']);await promises['rm'](_0x49a50b,{'force':!![]}),logInfoRaw('Removed\x20default\x20next.config.ts'),await promises['rm'](_0x4d972b,{'recursive':!![],'force':!![]}),logInfoRaw('Removed\x20default\x20public\x20folder'),await promises['mkdir'](_0x4d972b);}__name(createNextProject,'createNextProject');async function createEnvFile(_0x2b845e){logInfoRaw('Creating\x20'+files['env']+'\x20file\x20with\x20default\x20values...');const _0x29a66f=_0x2657b6['join'](_0x2b845e,files['env']);try{await promises['writeFile'](_0x29a66f,envTemplate,'utf8'),logInfoRaw(files['env']+'\x20file\x20created\x20with\x20values!');}catch(_0xb0c791){const _0x38c34e=_0xb0c791 instanceof Error?_0xb0c791['message']:'Unknown\x20error';logStringError('Error\x20creating\x20'+files['env']+'\x20file:'),logStringError(_0x38c34e);throw _0xb0c791;}}__name(createEnvFile,'createEnvFile');async function overridePackageJson(_0x2b7a2a){const _0x992347=_0x2657b6['join'](_0x2b7a2a,files['packageJson']),_0x56ed97=_0x2657b6['join'](repoRoot,folders['cli']+'/'+files['packageTemplate']);try{const _0x576a20=JSON['parse'](await promises['readFile'](_0x992347,'utf8')),_0x8821dd=_0x576a20['name'],_0x19743a=JSON['parse'](await promises['readFile'](_0x56ed97,'utf8')),_0x52f8ac={..._0x19743a,'name':_0x8821dd};await promises['writeFile'](_0x992347,JSON['stringify'](_0x52f8ac,null,0xe98+0x137*0x13+-0x1*0x25ab)+'\x0a','utf8');}catch(_0x396660){const _0x4307a8=_0x396660 instanceof Error?_0x396660['message']:'Unknown\x20error';logStringError('Error\x20overriding\x20'+files['packageJson']+':'),logStringError(_0x4307a8);throw _0x396660;}}__name(overridePackageJson,'overridePackageJson');function replaceImports(_0x139294){const _0x1edccc=/(import\s+)([^'"]+)(\s+from\s+["'])([^"']+)(["'])/g;return _0x139294['replace'](_0x1edccc,(_0x12cbd1,_0xaedecc,_0x260a0e,_0x1615dc,_0x4de4f4,_0x315e4e)=>{if(!_0x4de4f4['startsWith'](aliasSymbols['atSign'])||_0x4de4f4['startsWith'](npmPackages['saasKit']))return _0x12cbd1;let _0x58032c;_0x4de4f4['startsWith'](aliasSymbols['atSign']+folders['server'])||_0x4de4f4['includes'](''+nonRootProjectPaths['server'])?_0x58032c=npmPackages['saasKitServer']:_0x58032c=npmPackages['saasKit'];let _0x584e94=_0x260a0e['trim']();const _0x19b308=/^type\b/['test'](_0x584e94),_0x10e814=/^\*\s+as\s+/['test'](_0x584e94);return !_0x19b308&&!_0x10e814&&!_0x584e94['startsWith']('{')&&(_0x584e94='{\x20'+_0x584e94+'\x20}'),''+_0xaedecc+_0x584e94+_0x1615dc+_0x58032c+_0x315e4e;});}__name(replaceImports,'replaceImports');async function copyProjectFiles(_0x366ecb){logInfoRaw('Copying\x20'+projectName+'\x20files...');for(const _0x381a85 of allFilesToCopy){const _0xc6f65a=folders['cli']+'/'+_0x381a85,_0x5f0c79=_0x2657b6['join'](repoRoot,_0xc6f65a),_0x3d01d0=replaceToolsFolder(_0x381a85),_0x14bf77=_0x2657b6['join'](_0x366ecb,_0x3d01d0);if(existsSync(_0x5f0c79)){const _0x45ce1f=await promises['stat'](_0x5f0c79);_0x45ce1f['isDirectory']()?await copyDirectoryContents(_0x5f0c79,_0x14bf77):await copyAndProcessFile(_0x5f0c79,_0x14bf77);}else logInfoRaw('Source\x20file\x20not\x20found:\x20'+_0xc6f65a);}logInfoRaw('Files\x20copied\x20and\x20imports\x20updated!');}__name(copyProjectFiles,'copyProjectFiles');function replaceToolsFolder(_0xf111be){let _0x596f83=_0xf111be;for(const [_0x4b9621,_0x2e1997]of Object['entries'](toolsFoldersToReplace)){if(_0x596f83['startsWith'](_0x4b9621)&&isWithIndexer(_0x2e1997)){const _0x5746eb=_0x2e1997;for(const _0x2c5a95 in _0x5746eb){const _0x50be8b=_0x5746eb[_0x2c5a95];isString(_0x50be8b)&&(_0x596f83=_0x596f83['replace'](_0x2c5a95,_0x50be8b));}break;}}return _0x596f83;}__name(replaceToolsFolder,'replaceToolsFolder');function shouldIgnorePath(_0x549db7,_0xa77ee3,_0x555e34=![]){const _0xaad736=_0x2657b6['relative'](repoRoot,_0x549db7)['replace'](/\\/g,'/'),_0x4af70e=foldersToIgnore['map'](_0x220b91=>_0x220b91['replace'](/\\/g,'/'));if(_0x4af70e['includes'](_0xaad736))return !![];if(_0x555e34){const _0x1c1513=_0x2657b6['relative'](_0xa77ee3,_0x549db7)['replace'](/\\/g,'/'),_0x28d938=_0x1c1513['split']('/');return _0x4af70e['some'](_0x7a84fb=>_0x28d938['some'](_0x5cfd87=>_0x5cfd87===_0x7a84fb));}return ![];}__name(shouldIgnorePath,'shouldIgnorePath');async function copyDirectoryContents(_0x516b90,_0x36fe04){!existsSync(_0x36fe04)&&mkdirSync(_0x36fe04,{'recursive':!![]});try{const _0xe32e15=await promises['readdir'](_0x516b90,{'withFileTypes':!![]});for(const _0x25fbcf of _0xe32e15){const _0xb8d8d7=_0x2657b6['join'](_0x516b90,_0x25fbcf['name']),_0x2c4993=_0x2657b6['join'](_0x36fe04,_0x25fbcf['name']);!shouldIgnorePath(_0xb8d8d7,_0x516b90,_0x25fbcf['isDirectory']())&&(_0x25fbcf['isDirectory']()?await copyDirectoryContents(_0xb8d8d7,_0x2c4993):await copyAndProcessFile(_0xb8d8d7,_0x2c4993));}}catch(_0x4a024c){const _0xa666ea=_0x4a024c instanceof Error?_0x4a024c['message']:'Unknown\x20error';logStringError('Error\x20reading\x20directory\x20'+_0x516b90+':\x20'+_0xa666ea);throw _0x4a024c;}}__name(copyDirectoryContents,'copyDirectoryContents');async function copyAndProcessFile(_0x4a9fd6,_0x28cfe4){const _0x5c8de0=_0x2657b6['dirname'](_0x28cfe4);!existsSync(_0x5c8de0)&&mkdirSync(_0x5c8de0,{'recursive':!![]});const _0x2e43ad=await promises['stat'](_0x4a9fd6);if(_0x2e43ad['isDirectory']())await copyDirectoryContents(_0x4a9fd6,_0x28cfe4);else {const _0x1cd805=_0x2657b6['extname'](_0x4a9fd6)['toLowerCase'](),_0x390f45=['.ico','.png','.jpg','.jpeg','.webp','.gif','.svg','.pdf'];if(_0x390f45['includes'](_0x1cd805)){await promises['copyFile'](_0x4a9fd6,_0x28cfe4);return;}const _0x22c9b8=await promises['readFile'](_0x4a9fd6,'utf8'),_0x4a2213=replaceImports(_0x22c9b8);await promises['writeFile'](_0x28cfe4,_0x4a2213,'utf8');}}__name(copyAndProcessFile,'copyAndProcessFile');function createAdditionalFolders(_0x563ecd){for(const _0x548162 of additionalFoldersToCreate){const _0x3db59f=_0x2657b6['join'](_0x563ecd,_0x548162);!existsSync(_0x3db59f)&&(mkdirSync(_0x3db59f,{'recursive':!![]}),logInfoRaw('Created\x20folder:\x20'+_0x548162));}logInfoRaw('Additional\x20folders\x20created!');}__name(createAdditionalFolders,'createAdditionalFolders');async function setupPreCommitHooks(_0x1872cc){const _0x37dc0c=_0x2657b6['join'](_0x1872cc,folders['husky']),_0x2f4d7d=_0x2657b6['join'](_0x37dc0c,files['preCommit']),_0x26cadf=_0x2657b6['join'](_0x37dc0c,files['commitMsg']);mkdirSync(_0x37dc0c,{'recursive':!![]}),await promises['writeFile'](_0x2f4d7d,cliScripts['preCommit'],'utf8'),await promises['writeFile'](_0x26cadf,cliScripts['commitMsg'],'utf8'),runCommand(cliScripts['chmodPreCommit'],_0x1872cc),runCommand(cliScripts['chmodCommitMsg'],_0x1872cc);}__name(setupPreCommitHooks,'setupPreCommitHooks');async function setupEslintConfig(_0x479713){const _0xa1deb5=_0x2657b6['join'](_0x479713,files['eslintConfigMjs']);existsSync(_0xa1deb5)&&await promises['rm'](_0xa1deb5);const _0x132a49=_0x2657b6['join'](_0x479713,files['eslintConfigJs']);await promises['writeFile'](_0x132a49,cliEslintContent,'utf8');}__name(setupEslintConfig,'setupEslintConfig');async function enableRepoModeExtras(_0x109ef7){logInfoRaw('Enabling\x20recommendation\x20mode\x20(-r)...'),runCommand(cliScripts['gitInit'],_0x109ef7),runCommand(cliScripts['installDevHuskyTsx'],_0x109ef7),runCommand(cliScripts['setLint'],_0x109ef7),runCommand(cliScripts['installHusky'],_0x109ef7),await setupPreCommitHooks(_0x109ef7);}__name(enableRepoModeExtras,'enableRepoModeExtras');async function updateLayoutTitle(_0x1f9c79,_0x4e790b){const _0x47b4b1=_0x2657b6['join'](_0x1f9c79,projectPaths['app']+'/'+files['layout']);if(!existsSync(_0x47b4b1))throw createError(files['layout']+'\x20not\x20found\x20at\x20'+_0x47b4b1+',\x20cannot\x20update\x20title.');let _0x98c251=await promises['readFile'](_0x47b4b1,'utf8');const _0x3ff355=/"SaaS Kit"/g;if(!_0x3ff355['test'](_0x98c251))throw createError('SaaS\x20Kit\x20not\x20found\x20in\x20'+files['layout']+',\x20cannot\x20update\x20title.');_0x98c251=_0x98c251['replace'](_0x3ff355,'\x22'+_0x4e790b+'\x22'),await promises['writeFile'](_0x47b4b1,_0x98c251,'utf8');}__name(updateLayoutTitle,'updateLayoutTitle');async function create(_0xaaa7fe){try{_0xaaa7fe['length']<0x7b2+-0x6b*-0x1b+-0x12fa&&(logStringError('Error:\x20Specify\x20folder\x20name.\x20Example:\x20npx\x20create-saas-kit-app\x20<folder-name>'),process['exit'](-0x15b4+0x1*0x13d+0x1478));const _0xcdd775=_0xaaa7fe[0x1f2d+-0xd67+-0x11c6],_0xe07060=_0xaaa7fe['includes']('-r'),_0x46475b=_0x2657b6['resolve'](process['cwd'](),_0xcdd775);logInfoRaw('\x0aCreating\x20'+projectName+'\x20project\x20\x22'+_0xcdd775+'\x22...\x0a');try{checkTargetFolder(_0x46475b),await createNextProject(_0xcdd775,_0x46475b),await copyProjectFiles(_0x46475b),await overridePackageJson(_0x46475b),createAdditionalFolders(_0x46475b),await createEnvFile(_0x46475b),await updateLayoutTitle(_0x46475b,_0xcdd775),await setupEslintConfig(_0x46475b),_0xe07060&&await enableRepoModeExtras(_0x46475b),logInfoRaw('\x0a'+projectName+'\x20project\x20\x22'+_0xcdd775+'\x22\x20is\x20ready!'),logInfoRaw('Next\x20steps:'),logInfoRaw('\x20\x20cd\x20'+_0xcdd775),logInfoRaw('\x20\x20npm\x20run\x20prod'),logInfoRaw('\x20\x20npm\x20start');}catch(_0x4c1a64){const _0x3b0c32=_0x4c1a64 instanceof Error?_0x4c1a64['message']:'Unknown\x20error';logStringError('Error:'),logStringError(_0x3b0c32),existsSync(_0x46475b)&&(logInfoRaw('Cleaning\x20up...'),rmSync(_0x46475b,{'recursive':!![],'force':!![]})),process['exit'](-0x1ea4+0x241*0x1+-0x2*-0xe32);}}catch(_0x69982d){const _0x21eaeb=_0x69982d instanceof Error?_0x69982d['message']:'Unknown\x20error';logStringError('Unhandled\x20error:'),logStringError(_0x21eaeb),process['exit'](0x2392+-0x8b1*-0x1+-0x2c42);}}__name(create,'create');
|
|
19
19
|
|
|
20
20
|
export { create };
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
var projectPaths = require('../../../base-repo/app-constants/project-paths.cjs.js');
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
var __defProp=Object['defineProperty'],__name=(_0x4848fd,_0x22a287)=>__defProp(_0x4848fd,'name',{'value':_0x22a287,'configurable':!![]});function normalizePathForRollUpCopy(_0x1e3147){return _0x1e3147['replace'](/\/\(([^)]+)\)\//g,'/[(]$1[)]/');}__name(normalizePathForRollUpCopy,'normalizePathForRollUpCopy');const filesToCopy=['',''+projectPaths.folders['git']];const rootFilesToCopy=['.gitignore','postcss.config.mjs','server.ts'];const appFilesToCopy=[projectPaths.clientPaths['styles'],projectPaths.projectPaths['app']+'/favicon.ico',projectPaths.projectPaths['app']+'/globals.css',projectPaths.projectPaths['app']+'/layout.tsx',projectPaths.projectPaths['app']+'/page.tsx'];const apiRoutesToCopy=[projectPaths.projectPaths['apiV1F']+'/searchable-resources/route.ts',projectPaths.projectPaths['apiV1F']+'/search-result/route.ts',projectPaths.projectPaths['apiV1F']+'/workspace/change/route.ts',projectPaths.projectPaths['apiV1F']+'/visible-workspace/route.ts',projectPaths.projectPaths['apiV1F']+'/user-permission/route.ts',projectPaths.projectPaths['apiV1F']+'/user-feature/isenabled/route.ts',projectPaths.projectPaths['apiV1F']+'/uimetas/route.ts',projectPaths.projectPaths['apiV1F']+'/uimeta/route.ts',projectPaths.projectPaths['apiV1F']+'/subscription/update/route.ts',projectPaths.projectPaths['apiV1F']+'/subscription/create/route.ts',projectPaths.projectPaths['apiV1F']+'/subscription/cancel/route.ts',projectPaths.projectPaths['apiV1F']+'/sign-up/route.ts',projectPaths.projectPaths['apiV1F']+'/sign-out/route.ts',projectPaths.projectPaths['apiV1F']+'/sign-in/route.ts',projectPaths.projectPaths['apiV1F']+'/preload/route.ts',projectPaths.projectPaths['apiV1F']+'/payment/route.ts',projectPaths.projectPaths['apiV1F']+'/payment/verify-success/route.ts',projectPaths.projectPaths['apiV1F']+'/payment/verify-fail/route.ts',projectPaths.projectPaths['apiV1F']+'/payment/method/route.ts',projectPaths.projectPaths['apiV1F']+'/password/reset-password/route.ts',projectPaths.projectPaths['apiV1F']+'/password/forgot-password/route.ts',projectPaths.projectPaths['apiV1F']+'/other-user/route.ts',projectPaths.projectPaths['apiV1F']+'/other-user/[id]/route.ts',projectPaths.projectPaths['apiV1F']+'/log/route.ts',projectPaths.projectPaths['apiV1F']+'/blob/route.ts',projectPaths.projectPaths['apiV1F']+'/[resourceName]/route.ts',projectPaths.projectPaths['apiV1F']+'/[resourceName]/upsert/route.ts',projectPaths.projectPaths['apiV1F']+'/[resourceName]/[id]/route.ts'];const allFilesToCopy=[...filesToCopy,...rootFilesToCopy,...appFilesToCopy,...apiRoutesToCopy];
|
|
7
7
|
|
|
8
8
|
exports.allFilesToCopy = allFilesToCopy;
|
|
9
9
|
exports.apiRoutesToCopy = apiRoutesToCopy;
|
|
10
|
-
exports.apiV1Glob = apiV1Glob;
|
|
11
10
|
exports.appFilesToCopy = appFilesToCopy;
|
|
12
11
|
exports.filesToCopy = filesToCopy;
|
|
12
|
+
exports.normalizePathForRollUpCopy = normalizePathForRollUpCopy;
|
|
13
13
|
exports.rootFilesToCopy = rootFilesToCopy;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import {
|
|
2
|
+
import { folders, clientPaths, projectPaths } from '../../../base-repo/app-constants/project-paths.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
var __defProp=Object['defineProperty'],__name=(_0x4848fd,_0x22a287)=>__defProp(_0x4848fd,'name',{'value':_0x22a287,'configurable':!![]});function normalizePathForRollUpCopy(_0x1e3147){return _0x1e3147['replace'](/\/\(([^)]+)\)\//g,'/[(]$1[)]/');}__name(normalizePathForRollUpCopy,'normalizePathForRollUpCopy');const filesToCopy=['',''+folders['git']];const rootFilesToCopy=['.gitignore','postcss.config.mjs','server.ts'];const appFilesToCopy=[clientPaths['styles'],projectPaths['app']+'/favicon.ico',projectPaths['app']+'/globals.css',projectPaths['app']+'/layout.tsx',projectPaths['app']+'/page.tsx'];const apiRoutesToCopy=[projectPaths['apiV1F']+'/searchable-resources/route.ts',projectPaths['apiV1F']+'/search-result/route.ts',projectPaths['apiV1F']+'/workspace/change/route.ts',projectPaths['apiV1F']+'/visible-workspace/route.ts',projectPaths['apiV1F']+'/user-permission/route.ts',projectPaths['apiV1F']+'/user-feature/isenabled/route.ts',projectPaths['apiV1F']+'/uimetas/route.ts',projectPaths['apiV1F']+'/uimeta/route.ts',projectPaths['apiV1F']+'/subscription/update/route.ts',projectPaths['apiV1F']+'/subscription/create/route.ts',projectPaths['apiV1F']+'/subscription/cancel/route.ts',projectPaths['apiV1F']+'/sign-up/route.ts',projectPaths['apiV1F']+'/sign-out/route.ts',projectPaths['apiV1F']+'/sign-in/route.ts',projectPaths['apiV1F']+'/preload/route.ts',projectPaths['apiV1F']+'/payment/route.ts',projectPaths['apiV1F']+'/payment/verify-success/route.ts',projectPaths['apiV1F']+'/payment/verify-fail/route.ts',projectPaths['apiV1F']+'/payment/method/route.ts',projectPaths['apiV1F']+'/password/reset-password/route.ts',projectPaths['apiV1F']+'/password/forgot-password/route.ts',projectPaths['apiV1F']+'/other-user/route.ts',projectPaths['apiV1F']+'/other-user/[id]/route.ts',projectPaths['apiV1F']+'/log/route.ts',projectPaths['apiV1F']+'/blob/route.ts',projectPaths['apiV1F']+'/[resourceName]/route.ts',projectPaths['apiV1F']+'/[resourceName]/upsert/route.ts',projectPaths['apiV1F']+'/[resourceName]/[id]/route.ts'];const allFilesToCopy=[...filesToCopy,...rootFilesToCopy,...appFilesToCopy,...apiRoutesToCopy];
|
|
5
5
|
|
|
6
|
-
export { allFilesToCopy, apiRoutesToCopy,
|
|
6
|
+
export { allFilesToCopy, apiRoutesToCopy, appFilesToCopy, filesToCopy, normalizePathForRollUpCopy, rootFilesToCopy };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fernir2/saas-kit-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"description": "CLI for creating saas-kit apps",
|
|
5
5
|
"bin": {
|
|
6
6
|
"saaskitcli": "./level2/cli/bin/index.js"
|
|
@@ -166,6 +166,7 @@
|
|
|
166
166
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
167
167
|
"eslint-plugin-react-refresh": "0.4.20",
|
|
168
168
|
"eslint-plugin-sonarjs": "3.0.5",
|
|
169
|
+
"globby": "16.0.0",
|
|
169
170
|
"husky": "9.1.7",
|
|
170
171
|
"nx": "22.3.3",
|
|
171
172
|
"postcss": "8.5.6",
|
|
@@ -186,4 +187,4 @@
|
|
|
186
187
|
"typescript-eslint": "8.36.0"
|
|
187
188
|
},
|
|
188
189
|
"type": "module"
|
|
189
|
-
}
|
|
190
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deleteResourceByIdRoute,
|
|
3
|
-
getResourceByIdRoute,
|
|
4
|
-
putResourceByIdRoute,
|
|
5
|
-
} from "@meta/server/basic-crud/crud-api";
|
|
6
|
-
|
|
7
|
-
export const GET = getResourceByIdRoute;
|
|
8
|
-
|
|
9
|
-
export const PUT = putResourceByIdRoute;
|
|
10
|
-
|
|
11
|
-
export const DELETE = deleteResourceByIdRoute;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deleteResourceRoute,
|
|
3
|
-
getResourceRoute,
|
|
4
|
-
postResourceRoute,
|
|
5
|
-
putResourceRoute,
|
|
6
|
-
} from "@meta/server/basic-crud/crud-api";
|
|
7
|
-
|
|
8
|
-
export const PUT = putResourceRoute;
|
|
9
|
-
|
|
10
|
-
export const GET = getResourceRoute;
|
|
11
|
-
|
|
12
|
-
export const POST = postResourceRoute;
|
|
13
|
-
|
|
14
|
-
export const DELETE = deleteResourceRoute;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
otheruserIdGetRoute,
|
|
3
|
-
otheruserIdPostRoute,
|
|
4
|
-
otheruserIdPutRoute,
|
|
5
|
-
otheruserIdDeleteRoute,
|
|
6
|
-
} from "@server/otheruser/id/otheruser-id-api";
|
|
7
|
-
|
|
8
|
-
export const GET = otheruserIdGetRoute;
|
|
9
|
-
|
|
10
|
-
export const POST = otheruserIdPostRoute;
|
|
11
|
-
|
|
12
|
-
export const PUT = otheruserIdPutRoute;
|
|
13
|
-
|
|
14
|
-
export const DELETE = otheruserIdDeleteRoute;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getSearchableResources } from "@meta/server/resources/searchable-resources";
|
|
2
|
-
import { apiBadRequestResponse, apiOkResponse } from "@meta/server/web/responses";
|
|
3
|
-
import { httpApiWrapper } from "@meta/server/web/http-api-wrapper";
|
|
4
|
-
|
|
5
|
-
export const GET = httpApiWrapper(async () => {
|
|
6
|
-
const resourceNames = Array.from((await getSearchableResources()).keys());
|
|
7
|
-
|
|
8
|
-
if (!resourceNames) return apiBadRequestResponse([]);
|
|
9
|
-
|
|
10
|
-
return apiOkResponse(resourceNames);
|
|
11
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { SearchResult } from "@fd-app-toolbox/resources/search-result.resource";
|
|
2
|
-
import { searchResultParams } from "@fd-toolbox/constants/search-result-constants";
|
|
3
|
-
import { getSearchableResourceResult, getSearchScreensResult } from "@server/search/search-result";
|
|
4
|
-
import { SearchableResourceResult } from "@fd-app-toolbox/models/searchable-resource-result";
|
|
5
|
-
import { ScreensResult } from "@fd-app-toolbox/models/screens-result";
|
|
6
|
-
import { httpApiWrapper } from "@meta/server/web/http-api-wrapper";
|
|
7
|
-
import { apiOkResponse } from "@meta/server/web/responses";
|
|
8
|
-
import { isPromiseFulfilled } from "@fd-toolbox/lib/utils";
|
|
9
|
-
|
|
10
|
-
export const GET = httpApiWrapper(async (req: Request) => {
|
|
11
|
-
const url = new URL(req.url);
|
|
12
|
-
const querySearch = url.searchParams.get(searchResultParams.querySearch) ?? "";
|
|
13
|
-
const filterSearchParam = url.searchParams.get(searchResultParams.filterSearch);
|
|
14
|
-
|
|
15
|
-
const filterSearch = filterSearchParam ? filterSearchParam.split(",") : [];
|
|
16
|
-
|
|
17
|
-
const searchResourceResultPromise = getSearchableResourceResult(
|
|
18
|
-
querySearch,
|
|
19
|
-
filterSearch,
|
|
20
|
-
) satisfies Promise<SearchableResourceResult[]>;
|
|
21
|
-
|
|
22
|
-
const searchScreensResultPromise = getSearchScreensResult(querySearch, filterSearch) satisfies Promise<
|
|
23
|
-
ScreensResult[]
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
const [searchResourceResult, searchScreensResult] = await Promise.allSettled([
|
|
27
|
-
searchResourceResultPromise,
|
|
28
|
-
searchScreensResultPromise,
|
|
29
|
-
]);
|
|
30
|
-
|
|
31
|
-
return apiOkResponse<SearchResult>({
|
|
32
|
-
searchableResources: isPromiseFulfilled(searchResourceResult) ? searchResourceResult.value : [],
|
|
33
|
-
screens: isPromiseFulfilled(searchScreensResult) ? searchScreensResult.value : [],
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import ForgotPasswordPage from "@client/pages/forgot-password-page/ForgotPasswordPage";
|
|
2
|
-
import { httpWrapper } from "@server/web/http-wrapper";
|
|
3
|
-
|
|
4
|
-
export const dynamic = "force-dynamic";
|
|
5
|
-
|
|
6
|
-
const Page = httpWrapper(
|
|
7
|
-
async () => {
|
|
8
|
-
return <ForgotPasswordPage />;
|
|
9
|
-
},
|
|
10
|
-
{ isAnonymous: true },
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
export default Page;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import ResetPasswordPage from "@client/pages/reset-password-page/ResetPasswordPage";
|
|
2
|
-
import { httpWrapper } from "@server/web/http-wrapper";
|
|
3
|
-
|
|
4
|
-
const Page = httpWrapper(
|
|
5
|
-
async () => {
|
|
6
|
-
return <ResetPasswordPage />;
|
|
7
|
-
},
|
|
8
|
-
{ isAnonymous: true },
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
export default Page;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|