@fernir2/saas-kit-cli 0.1.15 → 0.1.17
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/aliases.cjs.js +1 -1
- package/base-repo/app-constants/aliases.js +1 -1
- package/level2/cli/create-saas-kit-app/bin/index.cjs.js +4 -4
- package/level2/cli/create-saas-kit-app/bin/index.js +3 -3
- package/level2/fd-toolbox/api/api-client.cjs.js +1 -1
- package/level2/fd-toolbox/api/api-client.js +1 -1
- package/level2/fd-toolbox/api/api-path-names.cjs.js +2 -2
- package/level2/fd-toolbox/api/api-paths.cjs.js +1 -1
- package/level2/fd-toolbox/api/api-paths.js +1 -1
- package/level2/fd-toolbox/api/base-api.cjs.js +1 -1
- package/level2/fd-toolbox/api/base-api.js +1 -1
- package/level2/fd-toolbox/auth/login-states.cjs.js +1 -1
- package/level2/fd-toolbox/auth/login-states.js +1 -1
- package/level2/fd-toolbox/auth/session-storage.cjs.js +1 -1
- package/level2/fd-toolbox/auth/session-storage.js +1 -1
- package/level2/fd-toolbox/auth/tokens.cjs.js +1 -1
- package/level2/fd-toolbox/auth/tokens.js +1 -1
- package/level2/fd-toolbox/constants/constants.cjs.js +1 -1
- package/level2/fd-toolbox/constants/constants.js +1 -1
- package/level2/fd-toolbox/enums/enums.cjs.js +1 -1
- package/level2/fd-toolbox/enums/enums.js +1 -1
- package/level2/fd-toolbox/errors/error-handler.cjs.js +1 -1
- package/level2/fd-toolbox/errors/error-handler.js +1 -1
- package/level2/fd-toolbox/errors/errors.cjs.js +1 -1
- package/level2/fd-toolbox/errors/errors.js +1 -1
- package/level2/fd-toolbox/errors/problem-details.cjs.js +1 -1
- package/level2/fd-toolbox/errors/problem-details.js +1 -1
- package/level2/fd-toolbox/functions/value-checking-functions.cjs.js +1 -1
- package/level2/fd-toolbox/functions/value-checking-functions.js +1 -1
- package/level2/fd-toolbox/http/url/urls.cjs.js +1 -1
- package/level2/fd-toolbox/http/url/urls.js +1 -1
- package/level2/fd-toolbox/infra/env-config.cjs.js +2 -2
- package/level2/fd-toolbox/infra/env-config.js +2 -2
- package/level2/fd-toolbox/infra/env-functions.cjs.js +1 -1
- package/level2/fd-toolbox/infra/env-functions.js +1 -1
- package/level2/fd-toolbox/infra/env-schema.cjs.js +2 -2
- package/level2/fd-toolbox/infra/env-schema.js +2 -2
- package/level2/fd-toolbox/infra/env-store.cjs.js +1 -1
- package/level2/fd-toolbox/infra/env-store.js +1 -1
- package/level2/fd-toolbox/lib/environments.cjs.js +1 -1
- package/level2/fd-toolbox/lib/environments.js +1 -1
- package/level2/fd-toolbox/lib/utils.cjs.js +1 -1
- package/level2/fd-toolbox/lib/utils.js +1 -1
- package/level2/fd-toolbox/local-storage/local-storage.cjs.js +1 -1
- package/level2/fd-toolbox/local-storage/local-storage.js +1 -1
- package/level2/fd-toolbox/logging/loggers.cjs.js +1 -1
- package/level2/fd-toolbox/logging/loggers.js +1 -1
- package/level2/fd-toolbox/notifications.cjs.js +2 -2
- package/level2/fd-toolbox/notifications.js +2 -2
- package/level2/fd-toolbox/odata/odata-constants.cjs.js +1 -1
- package/level2/fd-toolbox/odata/odata-constants.js +1 -1
- package/level2/fd-toolbox/odata/odatas.cjs.js +1 -1
- package/level2/fd-toolbox/odata/odatas.js +1 -1
- package/level2/fd-toolbox/odata/services/odata-filters.cjs.js +1 -1
- package/level2/fd-toolbox/odata/services/odata-filters.js +1 -1
- package/level2/fd-toolbox/paths/paths-names.cjs.js +2 -2
- package/level2/fd-toolbox/paths/paths-names.js +1 -1
- package/level2/fd-toolbox/routing/login-routers.cjs.js +1 -1
- package/level2/fd-toolbox/routing/login-routers.js +1 -1
- package/level2/fd-toolbox/routing/paths.cjs.js +1 -1
- package/level2/fd-toolbox/routing/paths.js +1 -1
- package/level2/fd-toolbox/strings/strings-constants.cjs.js +1 -1
- package/level2/fd-toolbox/strings/strings-constants.js +1 -1
- package/level2/fd-toolbox/strings/strings.cjs.js +1 -1
- package/level2/fd-toolbox/strings/strings.js +1 -1
- package/level2/fd-toolbox/types/ensure-type.cjs.js +1 -1
- package/level2/fd-toolbox/types/ensure-type.js +1 -1
- package/level2/fd-toolbox-core/core/name-of.cjs.js +1 -1
- package/level2/fd-toolbox-core/core/name-of.js +1 -1
- package/level2/fd-toolbox-core/types/resource-with-id.cjs.js +1 -1
- package/level2/fd-toolbox-core/types/resource-with-id.js +1 -1
- package/package.json +2 -2
- package/LICENSE +0 -45
- package/bin/index.js +0 -262
- package/cli/.gitlab-ci.yml +0 -15
- package/cli/.husky/commit-msg +0 -1
- package/cli/.husky/pre-commit +0 -2
- package/cli/README.md +0 -101
- package/cli/bin/index.ts +0 -359
- package/cli/constants/path.js +0 -54
- package/cli/drizzle.config.ts +0 -12
- package/cli/eslint.config.js +0 -10
- package/cli/global-setup.ts +0 -25
- package/cli/next.config.js +0 -55
- package/cli/npm-commands/gen-meta/index.ts +0 -3
- package/cli/npm-commands/gen-schema/index.ts +0 -5
- package/cli/npm-commands/migrate-db/index.ts +0 -5
- package/cli/npm-commands/migrate-db/migrate-db.ts +0 -15
- package/cli/npm-commands/seed-db/index.ts +0 -5
- package/cli/npm-commands/seed-db/seed-db.ts +0 -15
- package/cli/package-template.json +0 -61
- package/cli/playwright.config.ts +0 -34
- package/cli/postcss.config.mjs +0 -9
- package/cli/server.ts +0 -41
- package/cli/src/app/api/v1/[resourceName]/[id]/route.ts/route.ts +0 -11
- package/cli/src/app/api/v1/[resourceName]/route.ts/route.ts +0 -14
- package/cli/src/app/api/v1/[resourceName]/upsert/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/log/route.ts/route.ts +0 -7
- package/cli/src/app/api/v1/otheruser/[id]/route.ts/route.ts +0 -14
- package/cli/src/app/api/v1/otheruser/route.ts/route.ts +0 -7
- package/cli/src/app/api/v1/password/forgotpassword/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/password/resetpassword/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/payment/method/route.ts/route.ts +0 -4
- package/cli/src/app/api/v1/payment/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/payment/verify-fail/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/payment/verify-success/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/preload/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/searchable-resources/route.ts/route.ts +0 -11
- package/cli/src/app/api/v1/searchresult/route.ts/route.ts +0 -35
- package/cli/src/app/api/v1/sign-in/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/sign-out/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/sign-up/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/subscription/cancel/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/subscription/create/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/subscription/update/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/uimeta/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/uimetas/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/userpermission/route.ts/route.ts +0 -3
- package/cli/src/app/api/v1/visible-workspace/route.ts/route.ts +0 -5
- package/cli/src/app/api/v1/workspace/change/route.ts/route.ts +0 -5
- package/cli/src/app/favicon.ico +0 -0
- package/cli/src/app/globals.css +0 -1
- package/cli/src/app/layout.tsx +0 -44
- package/cli/src/app/page.tsx +0 -9
- package/cli/src/app/styles/common.css +0 -74
- package/cli/src/app/styles/rich-text-editor.css +0 -130
- package/cli/tailwind.config.ts +0 -13
- package/cli/tsconfig.declaration.json +0 -48
- package/cli/tsconfig.json +0 -65
- package/cli/tsconfig.server.json +0 -14
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _0x4aa8bb = require('path');
|
|
5
5
|
|
|
6
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
6
|
+
var __defProp=Object['defineProperty'],__name=(_0x5e9bea,_0x39a7d5)=>__defProp(_0x5e9bea,'name',{'value':_0x39a7d5,'configurable':!![]});function getFileNameWithExtension(_0x513c2f,_0xc6d911){if(!_0xc6d911['startsWith']('.'))return _0x513c2f+'.'+_0xc6d911;return _0x513c2f+_0xc6d911;}__name(getFileNameWithExtension,'getFileNameWithExtension');function getFullFilePath(_0x3addff,_0x56569e,..._0x2c7363){const _0x5d5ec1=getFileNameWithExtension(_0x3addff,_0x56569e);return _0x4aa8bb.join(..._0x2c7363,_0x5d5ec1);}__name(getFullFilePath,'getFullFilePath');
|
|
7
7
|
|
|
8
8
|
exports.getFileNameWithExtension = getFileNameWithExtension;
|
|
9
9
|
exports.getFullFilePath = getFullFilePath;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { join } from 'path';
|
|
3
3
|
|
|
4
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
4
|
+
var __defProp=Object['defineProperty'],__name=(_0x5e9bea,_0x39a7d5)=>__defProp(_0x5e9bea,'name',{'value':_0x39a7d5,'configurable':!![]});function getFileNameWithExtension(_0x513c2f,_0xc6d911){if(!_0xc6d911['startsWith']('.'))return _0x513c2f+'.'+_0xc6d911;return _0x513c2f+_0xc6d911;}__name(getFileNameWithExtension,'getFileNameWithExtension');function getFullFilePath(_0x3addff,_0x56569e,..._0x2c7363){const _0x5d5ec1=getFileNameWithExtension(_0x3addff,_0x56569e);return join(..._0x2c7363,_0x5d5ec1);}__name(getFullFilePath,'getFullFilePath');
|
|
5
5
|
|
|
6
6
|
export { getFileNameWithExtension, getFullFilePath };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var routes = require('./routes.cjs.js');
|
|
5
5
|
|
|
6
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
6
|
+
var __defProp=Object['defineProperty'],__name=(_0x8a1fc8,_0x2e171d)=>__defProp(_0x8a1fc8,'name',{'value':_0x2e171d,'configurable':!![]});function getRelativeLoginUrl(){return '/'+routes.routes['login'];}__name(getRelativeLoginUrl,'getRelativeLoginUrl');function getLoginUrl(){return window['location']['origin']+getRelativeLoginUrl();}__name(getLoginUrl,'getLoginUrl');function goToLogin(){window['location']['href']=getRelativeLoginUrl();}__name(goToLogin,'goToLogin');
|
|
7
7
|
|
|
8
8
|
exports.getLoginUrl = getLoginUrl;
|
|
9
9
|
exports.getRelativeLoginUrl = getRelativeLoginUrl;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { routes } from './routes.js';
|
|
3
3
|
|
|
4
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
4
|
+
var __defProp=Object['defineProperty'],__name=(_0x8a1fc8,_0x2e171d)=>__defProp(_0x8a1fc8,'name',{'value':_0x2e171d,'configurable':!![]});function getRelativeLoginUrl(){return '/'+routes['login'];}__name(getRelativeLoginUrl,'getRelativeLoginUrl');function getLoginUrl(){return window['location']['origin']+getRelativeLoginUrl();}__name(getLoginUrl,'getLoginUrl');function goToLogin(){window['location']['href']=getRelativeLoginUrl();}__name(goToLogin,'goToLogin');
|
|
5
5
|
|
|
6
6
|
export { getLoginUrl, getRelativeLoginUrl, goToLogin };
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
var utils = require('../lib/utils.cjs.js');
|
|
5
5
|
|
|
6
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
6
|
+
var __defProp=Object['defineProperty'],__name=(_0xd76441,_0x2292e1)=>__defProp(_0xd76441,'name',{'value':_0x2292e1,'configurable':!![]});function addQueryParamsToPath(_0x4d1c3b,_0x456a83){let _0x3babd7=_0x4d1c3b;if(_0x456a83&&Array['isArray'](_0x456a83))_0x3babd7+=convertQueryParamsArrayToString(_0x456a83);else _0x456a83&&utils.isPlainObject(_0x456a83)&&(_0x3babd7+=convertQueryParamsObjectToString(_0x456a83));return _0x3babd7;}__name(addQueryParamsToPath,'addQueryParamsToPath');function convertQueryParamsArrayToString(_0x35811f){const _0x23a463=_0x35811f['map'](_0x5863a6=>_0x5863a6['name']+'='+_0x5863a6['value'])['join']('&');return _0x23a463?'?'+_0x23a463:'';}__name(convertQueryParamsArrayToString,'convertQueryParamsArrayToString');function convertQueryParamsObjectToString(_0x5a996b){const _0x142aed=Object['entries'](_0x5a996b)['map'](([_0x46dd01,_0x2d8f53])=>_0x46dd01+'='+_0x2d8f53)['join']('&');return _0x142aed?'?'+_0x142aed:'';}__name(convertQueryParamsObjectToString,'convertQueryParamsObjectToString');
|
|
7
7
|
|
|
8
8
|
exports.addQueryParamsToPath = addQueryParamsToPath;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { isPlainObject } from '../lib/utils.js';
|
|
3
3
|
|
|
4
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
4
|
+
var __defProp=Object['defineProperty'],__name=(_0xd76441,_0x2292e1)=>__defProp(_0xd76441,'name',{'value':_0x2292e1,'configurable':!![]});function addQueryParamsToPath(_0x4d1c3b,_0x456a83){let _0x3babd7=_0x4d1c3b;if(_0x456a83&&Array['isArray'](_0x456a83))_0x3babd7+=convertQueryParamsArrayToString(_0x456a83);else _0x456a83&&isPlainObject(_0x456a83)&&(_0x3babd7+=convertQueryParamsObjectToString(_0x456a83));return _0x3babd7;}__name(addQueryParamsToPath,'addQueryParamsToPath');function convertQueryParamsArrayToString(_0x35811f){const _0x23a463=_0x35811f['map'](_0x5863a6=>_0x5863a6['name']+'='+_0x5863a6['value'])['join']('&');return _0x23a463?'?'+_0x23a463:'';}__name(convertQueryParamsArrayToString,'convertQueryParamsArrayToString');function convertQueryParamsObjectToString(_0x5a996b){const _0x142aed=Object['entries'](_0x5a996b)['map'](([_0x46dd01,_0x2d8f53])=>_0x46dd01+'='+_0x2d8f53)['join']('&');return _0x142aed?'?'+_0x142aed:'';}__name(convertQueryParamsObjectToString,'convertQueryParamsObjectToString');
|
|
5
5
|
|
|
6
6
|
export { addQueryParamsToPath };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var stringsConstants = require('./strings-constants.cjs.js');
|
|
5
5
|
var valueCheckingFunctions = require('../functions/value-checking-functions.cjs.js');
|
|
6
6
|
|
|
7
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
7
|
+
var __defProp=Object['defineProperty'],__name=(_0x3c6676,_0x568b85)=>__defProp(_0x3c6676,'name',{'value':_0x568b85,'configurable':!![]});function shortenWithEllipsis(_0x362e69,_0x18dc69=stringsConstants.shortTextLength){if(valueCheckingFunctions.isNullOrUndefined(_0x362e69))return '';return _0x362e69['length']<-0x22*-0x32+0x621*0x3+-0x1ab*0xf?_0x362e69['length']<=_0x18dc69?_0x362e69:_0x362e69['substring'](-0x1f0d+0x191f+0x5ee,_0x18dc69):_0x362e69['length']<=_0x18dc69?_0x362e69:_0x362e69['substring'](0xd9d+0x25fa+-0x3397,_0x18dc69-(-0x7*0x34+0x48*-0x3a+0x11bd))+stringsConstants.ellipsis;}__name(shortenWithEllipsis,'shortenWithEllipsis');function trimCharacter(_0x1193d,_0x38a34b){let _0x42343c=_0x1193d;if(Array['isArray'](_0x38a34b))for(let _0x2299a5 of _0x38a34b){(_0x1193d['startsWith'](_0x2299a5)||_0x1193d['endsWith'](_0x2299a5))&&(_0x42343c=trimOneCharacter(_0x1193d,_0x2299a5));}else _0x42343c=trimOneCharacter(_0x1193d,_0x38a34b);return _0x42343c;}__name(trimCharacter,'trimCharacter');function trimOneCharacter(_0x21fa82,_0xcf1279){let _0x625aef=_0x21fa82;return _0x625aef?.['startsWith'](_0xcf1279)&&(_0x625aef=_0x625aef['substring'](0x1a73*-0x1+-0x6e0*-0x3+-0x2*-0x2ea)),_0x625aef?.['endsWith'](_0xcf1279)&&(_0x625aef=_0x625aef['substring'](0x26f3*0x1+-0x2f*-0x29+-0x12*0x295,_0x625aef['lastIndexOf'](_0xcf1279))),_0x625aef;}__name(trimOneCharacter,'trimOneCharacter');
|
|
8
8
|
|
|
9
9
|
exports.shortenWithEllipsis = shortenWithEllipsis;
|
|
10
10
|
exports.trimCharacter = trimCharacter;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { shortTextLength, ellipsis } from './strings-constants.js';
|
|
3
3
|
import { isNullOrUndefined } from '../functions/value-checking-functions.js';
|
|
4
4
|
|
|
5
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
5
|
+
var __defProp=Object['defineProperty'],__name=(_0x3c6676,_0x568b85)=>__defProp(_0x3c6676,'name',{'value':_0x568b85,'configurable':!![]});function shortenWithEllipsis(_0x362e69,_0x18dc69=shortTextLength){if(isNullOrUndefined(_0x362e69))return '';return _0x362e69['length']<-0x22*-0x32+0x621*0x3+-0x1ab*0xf?_0x362e69['length']<=_0x18dc69?_0x362e69:_0x362e69['substring'](-0x1f0d+0x191f+0x5ee,_0x18dc69):_0x362e69['length']<=_0x18dc69?_0x362e69:_0x362e69['substring'](0xd9d+0x25fa+-0x3397,_0x18dc69-(-0x7*0x34+0x48*-0x3a+0x11bd))+ellipsis;}__name(shortenWithEllipsis,'shortenWithEllipsis');function trimCharacter(_0x1193d,_0x38a34b){let _0x42343c=_0x1193d;if(Array['isArray'](_0x38a34b))for(let _0x2299a5 of _0x38a34b){(_0x1193d['startsWith'](_0x2299a5)||_0x1193d['endsWith'](_0x2299a5))&&(_0x42343c=trimOneCharacter(_0x1193d,_0x2299a5));}else _0x42343c=trimOneCharacter(_0x1193d,_0x38a34b);return _0x42343c;}__name(trimCharacter,'trimCharacter');function trimOneCharacter(_0x21fa82,_0xcf1279){let _0x625aef=_0x21fa82;return _0x625aef?.['startsWith'](_0xcf1279)&&(_0x625aef=_0x625aef['substring'](0x1a73*-0x1+-0x6e0*-0x3+-0x2*-0x2ea)),_0x625aef?.['endsWith'](_0xcf1279)&&(_0x625aef=_0x625aef['substring'](0x26f3*0x1+-0x2f*-0x29+-0x12*0x295,_0x625aef['lastIndexOf'](_0xcf1279))),_0x625aef;}__name(trimOneCharacter,'trimOneCharacter');
|
|
6
6
|
|
|
7
7
|
export { shortenWithEllipsis, trimCharacter };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
4
|
+
var __defProp=Object['defineProperty'],__name=(_0x16af49,_0x4b5cd8)=>__defProp(_0x16af49,'name',{'value':_0x4b5cd8,'configurable':!![]});function ensureString(_0x5314f1){return isString(_0x5314f1)?_0x5314f1:String(_0x5314f1);}__name(ensureString,'ensureString');function ensureNumber(_0x4ba0c6){if(isNumber(_0x4ba0c6))return _0x4ba0c6;else {if(isString(_0x4ba0c6))return parseFloat(_0x4ba0c6);else return NaN;}}__name(ensureNumber,'ensureNumber');function ensureObjectArray(_0xfa8713){if(Array['isArray'](_0xfa8713)&&_0xfa8713['length']>0x13c3+0x1f*0x1b+-0x1708&&isObject(_0xfa8713[-0xd4e+0xc*-0x11b+0x166*0x13])){const _0x2abf4f=[];for(const _0x2c2c31 of _0xfa8713){if(isObject(_0x2c2c31))_0x2abf4f['push'](_0x2c2c31);}return _0x2abf4f;}return [];}__name(ensureObjectArray,'ensureObjectArray');function ensureWithIndexer(_0x184ab6){let _0x1f1dc6={};return isWithIndexer(_0x184ab6)&&(_0x1f1dc6=_0x184ab6),_0x1f1dc6;}__name(ensureWithIndexer,'ensureWithIndexer');const types={'object':'object','string':'string','number':'number'};const stripeConflictResponseProperties={'detail':'detail'};function isObject(_0x5230b3){return typeof _0x5230b3===types['object']&&_0x5230b3!==null;}__name(isObject,'isObject');function isString(_0x33b057){return typeof _0x33b057===types['string'];}__name(isString,'isString');function isNumber(_0x1069d6){return typeof _0x1069d6===types['number'];}__name(isNumber,'isNumber');function isWithIndexer(_0x259ce0){return isObject(_0x259ce0)&&!Array['isArray'](_0x259ce0);}__name(isWithIndexer,'isWithIndexer');function isArray(_0x236308){return isObject(_0x236308)&&Array['isArray'](_0x236308);}__name(isArray,'isArray');function isErrorResponseWithDetail(_0x46fc0d){return isObject(_0x46fc0d)&&stripeConflictResponseProperties['detail']in _0x46fc0d;}__name(isErrorResponseWithDetail,'isErrorResponseWithDetail');function isBoolean(_0x3ff1fb){return typeof _0x3ff1fb==='boolean';}__name(isBoolean,'isBoolean');
|
|
5
5
|
|
|
6
6
|
exports.ensureNumber = ensureNumber;
|
|
7
7
|
exports.ensureObjectArray = ensureObjectArray;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
2
|
+
var __defProp=Object['defineProperty'],__name=(_0x16af49,_0x4b5cd8)=>__defProp(_0x16af49,'name',{'value':_0x4b5cd8,'configurable':!![]});function ensureString(_0x5314f1){return isString(_0x5314f1)?_0x5314f1:String(_0x5314f1);}__name(ensureString,'ensureString');function ensureNumber(_0x4ba0c6){if(isNumber(_0x4ba0c6))return _0x4ba0c6;else {if(isString(_0x4ba0c6))return parseFloat(_0x4ba0c6);else return NaN;}}__name(ensureNumber,'ensureNumber');function ensureObjectArray(_0xfa8713){if(Array['isArray'](_0xfa8713)&&_0xfa8713['length']>0x13c3+0x1f*0x1b+-0x1708&&isObject(_0xfa8713[-0xd4e+0xc*-0x11b+0x166*0x13])){const _0x2abf4f=[];for(const _0x2c2c31 of _0xfa8713){if(isObject(_0x2c2c31))_0x2abf4f['push'](_0x2c2c31);}return _0x2abf4f;}return [];}__name(ensureObjectArray,'ensureObjectArray');function ensureWithIndexer(_0x184ab6){let _0x1f1dc6={};return isWithIndexer(_0x184ab6)&&(_0x1f1dc6=_0x184ab6),_0x1f1dc6;}__name(ensureWithIndexer,'ensureWithIndexer');const types={'object':'object','string':'string','number':'number'};const stripeConflictResponseProperties={'detail':'detail'};function isObject(_0x5230b3){return typeof _0x5230b3===types['object']&&_0x5230b3!==null;}__name(isObject,'isObject');function isString(_0x33b057){return typeof _0x33b057===types['string'];}__name(isString,'isString');function isNumber(_0x1069d6){return typeof _0x1069d6===types['number'];}__name(isNumber,'isNumber');function isWithIndexer(_0x259ce0){return isObject(_0x259ce0)&&!Array['isArray'](_0x259ce0);}__name(isWithIndexer,'isWithIndexer');function isArray(_0x236308){return isObject(_0x236308)&&Array['isArray'](_0x236308);}__name(isArray,'isArray');function isErrorResponseWithDetail(_0x46fc0d){return isObject(_0x46fc0d)&&stripeConflictResponseProperties['detail']in _0x46fc0d;}__name(isErrorResponseWithDetail,'isErrorResponseWithDetail');function isBoolean(_0x3ff1fb){return typeof _0x3ff1fb==='boolean';}__name(isBoolean,'isBoolean');
|
|
3
3
|
|
|
4
4
|
export { ensureNumber, ensureObjectArray, ensureString, ensureWithIndexer, isArray, isBoolean, isErrorResponseWithDetail, isNumber, isObject, isString, isWithIndexer, stripeConflictResponseProperties, types };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
4
|
+
var __defProp=Object['defineProperty'],__name=(_0x4c4212,_0x55e0b1)=>__defProp(_0x4c4212,'name',{'value':_0x55e0b1,'configurable':!![]});const nameOf=__name(_0x3248fa=>_0x3248fa['toString'](),'nameOf');const deepNameOf=__name((_0x5b7c58,_0x47c280)=>_0x5b7c58+'.'+_0x47c280,'deepNameOf');const nameOfWithType=__name(_0x49cc89=>_0x49cc89,'nameOfWithType');
|
|
5
5
|
|
|
6
6
|
exports.deepNameOf = deepNameOf;
|
|
7
7
|
exports.nameOf = nameOf;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
2
|
+
var __defProp=Object['defineProperty'],__name=(_0x4c4212,_0x55e0b1)=>__defProp(_0x4c4212,'name',{'value':_0x55e0b1,'configurable':!![]});const nameOf=__name(_0x3248fa=>_0x3248fa['toString'](),'nameOf');const deepNameOf=__name((_0x5b7c58,_0x47c280)=>_0x5b7c58+'.'+_0x47c280,'deepNameOf');const nameOfWithType=__name(_0x49cc89=>_0x49cc89,'nameOfWithType');
|
|
3
3
|
|
|
4
4
|
export { deepNameOf, nameOf, nameOfWithType };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var nameOf = require('../core/name-of.cjs.js');
|
|
5
5
|
|
|
6
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
6
|
+
var __defProp=Object['defineProperty'],__name=(_0x40a233,_0x856422)=>__defProp(_0x40a233,'name',{'value':_0x856422,'configurable':!![]});const withIdProps={'id':nameOf.nameOf('id')};function isResourceWithId(_0xb1c922){return _0xb1c922&&typeof _0xb1c922==='object'&&typeof _0xb1c922['id']==='string';}__name(isResourceWithId,'isResourceWithId');
|
|
7
7
|
|
|
8
8
|
exports.isResourceWithId = isResourceWithId;
|
|
9
9
|
exports.withIdProps = withIdProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { nameOf } from '../core/name-of.js';
|
|
3
3
|
|
|
4
|
-
var __defProp=Object['defineProperty'],__name=(
|
|
4
|
+
var __defProp=Object['defineProperty'],__name=(_0x40a233,_0x856422)=>__defProp(_0x40a233,'name',{'value':_0x856422,'configurable':!![]});const withIdProps={'id':nameOf('id')};function isResourceWithId(_0xb1c922){return _0xb1c922&&typeof _0xb1c922==='object'&&typeof _0xb1c922['id']==='string';}__name(isResourceWithId,'isResourceWithId');
|
|
5
5
|
|
|
6
6
|
export { isResourceWithId, withIdProps };
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fernir2/saas-kit-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "CLI for creating saas-kit apps",
|
|
5
5
|
"bin": {
|
|
6
|
-
"create": "
|
|
6
|
+
"create": "level2/cli/create-saas-kit-app/bin/index.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"start": "node bin/index.js"
|
package/LICENSE
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
SaaS Kit License 1.0
|
|
2
|
-
|
|
3
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION AND DISTRIBUTION
|
|
4
|
-
|
|
5
|
-
1. Definitions.
|
|
6
|
-
|
|
7
|
-
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
8
|
-
|
|
9
|
-
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
10
|
-
|
|
11
|
-
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
12
|
-
|
|
13
|
-
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
14
|
-
|
|
15
|
-
"Object" form shall mean npm package @fernir/saas-kit which belongs to Licensor and hosted on npm.com, JSR or other public or private npm package registries.
|
|
16
|
-
|
|
17
|
-
"Work" shall mean the work of authorship in Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work.
|
|
18
|
-
|
|
19
|
-
2. Grant of Copyright License. Subject to the terms and conditions of this License, Licensor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, publicly display, publicly perform, sublicense, and distribute the Work in Object form. Otherwise provided in this License or required to be permitted by applicable law, you shall not: (i) reverse-engineer or decompile the Work; or, (ii) remove or modify Licensor copyright, patent, trademark, or attribution notices in the Work.
|
|
20
|
-
|
|
21
|
-
3. Redistribution. You may distribute copies of the Work in Object form in any medium, without modifications, provided that You meet the following conditions:
|
|
22
|
-
|
|
23
|
-
You must give any other recipients of the Work a copy of this License;
|
|
24
|
-
|
|
25
|
-
4. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work.
|
|
26
|
-
|
|
27
|
-
5. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
28
|
-
|
|
29
|
-
6. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall Licensor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if Licensor has been advised of the possibility of such damages.
|
|
30
|
-
|
|
31
|
-
7. Accepting Warranty or Additional Liability. While redistributing the Work, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of Licensor, and only if You agree to indemnify, defend, and hold Licensor harmless for any liability incurred by, or claims asserted against, Licensor by reason of your accepting any such warranty or additional liability.
|
|
32
|
-
|
|
33
|
-
8. Different license terms. Subject to the above terms and conditions, the License granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
|
|
34
|
-
|
|
35
|
-
9. Miscellaneous
|
|
36
|
-
|
|
37
|
-
b. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
|
|
38
|
-
|
|
39
|
-
c. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
|
|
40
|
-
|
|
41
|
-
d. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
|
|
42
|
-
|
|
43
|
-
END OF TERMS AND CONDITIONS
|
|
44
|
-
|
|
45
|
-
|
package/bin/index.js
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { execSync } from "child_process";
|
|
3
|
-
import { promises as fsPromises, existsSync, mkdirSync, rmSync } from "fs";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import * as path from "path";
|
|
6
|
-
import fs from "node:fs";
|
|
7
|
-
import { toolsFoldersToReplace, additionalFoldersToCreate, } from "@packages/base-repo/constants/create-app-constants";
|
|
8
|
-
import { logStringError, logInfoRaw } from "@packages/level2/fd-toolbox/logging/loggers";
|
|
9
|
-
import { projectName } from "@packages/level2/fd-toolbox/constants/constants";
|
|
10
|
-
import { allFilesToCopy } from "@packages/level2/npm-commands/build-npm/path";
|
|
11
|
-
import { createError } from "@packages/level2/fd-toolbox/errors/errors";
|
|
12
|
-
import { folders } from "@packages/base-repo/app-constants/project-paths";
|
|
13
|
-
import { npmPackages } from "@packages/base-repo/constants/packages";
|
|
14
|
-
import { aliasSymbols } from "@packages/base-repo/app-constants/aliases";
|
|
15
|
-
import { isString, isWithIndexer } from "@packages/level2/fd-toolbox/types/ensure-type";
|
|
16
|
-
const requiredNodeVersion = "v18.0.0";
|
|
17
|
-
if (process.version < requiredNodeVersion) {
|
|
18
|
-
logStringError(`Node.js ${requiredNodeVersion}+ is required`);
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
const filename = fileURLToPath(import.meta.url);
|
|
22
|
-
const dir = path.dirname(filename);
|
|
23
|
-
const repoRoot = path.resolve(dir, "..");
|
|
24
|
-
const saasKitRoot = path.resolve(dir, "@../..");
|
|
25
|
-
const envLocalPath = path.join(dir, `../${folders.cli}/.env`);
|
|
26
|
-
const envTemplate = fs.readFileSync(envLocalPath, "utf8");
|
|
27
|
-
const foldersToIgnore = [`${folders.cli}/constants`];
|
|
28
|
-
function runCommand(command, cwd) {
|
|
29
|
-
logInfoRaw(`Executing: ${command}`);
|
|
30
|
-
try {
|
|
31
|
-
execSync(command, { stdio: "inherit", cwd: cwd ?? process.cwd() });
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
35
|
-
logStringError(`Error executing: ${command}`);
|
|
36
|
-
logStringError(errorMessage);
|
|
37
|
-
process.exit(1);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function checkTargetFolder(targetDir) {
|
|
41
|
-
if (existsSync(targetDir)) {
|
|
42
|
-
logStringError(`Error: Folder "${path.basename(targetDir)}" already exists.`);
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function getCreateNextAppVersion() {
|
|
47
|
-
const packageJsonPath = path.resolve(saasKitRoot, "package.json");
|
|
48
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
49
|
-
return String(packageJson.devDependencies?.["next"] ?? packageJson.dependencies?.["next"] ?? "latest");
|
|
50
|
-
}
|
|
51
|
-
function createNextProject(projectTitle, targetDir) {
|
|
52
|
-
logInfoRaw("Creating Next.js project...");
|
|
53
|
-
const createNextAppVersion = getCreateNextAppVersion();
|
|
54
|
-
const createCommand = [
|
|
55
|
-
`npx create-next-app@${createNextAppVersion} "${projectTitle}"`,
|
|
56
|
-
"--typescript",
|
|
57
|
-
"--tailwind",
|
|
58
|
-
"--eslint",
|
|
59
|
-
"--app",
|
|
60
|
-
"--src-dir",
|
|
61
|
-
"--turbopack",
|
|
62
|
-
"--no-import-alias",
|
|
63
|
-
"--no-git",
|
|
64
|
-
].join(" ");
|
|
65
|
-
runCommand(createCommand, path.dirname(targetDir));
|
|
66
|
-
logInfoRaw("Next.js project created!");
|
|
67
|
-
}
|
|
68
|
-
async function createEnvFile(targetDir) {
|
|
69
|
-
logInfoRaw("Creating .env file with default values...");
|
|
70
|
-
const envPath = path.join(targetDir, ".env");
|
|
71
|
-
try {
|
|
72
|
-
await fsPromises.writeFile(envPath, envTemplate, "utf8");
|
|
73
|
-
logInfoRaw(".env file created with values!");
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
77
|
-
logStringError("Error creating .env file:");
|
|
78
|
-
logStringError(errorMessage);
|
|
79
|
-
throw error;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async function overridePackageJson(targetDir) {
|
|
83
|
-
const targetPackageJsonPath = path.join(targetDir, "package.json");
|
|
84
|
-
const cliPackageJsonPath = path.join(repoRoot, `${folders.cli}/package-template.json`);
|
|
85
|
-
try {
|
|
86
|
-
const targetPackageJson = JSON.parse(await fsPromises.readFile(targetPackageJsonPath, "utf8"));
|
|
87
|
-
const name = targetPackageJson.name;
|
|
88
|
-
const cliPackageJson = JSON.parse(await fsPromises.readFile(cliPackageJsonPath, "utf8"));
|
|
89
|
-
const finalPackageJson = {
|
|
90
|
-
...cliPackageJson,
|
|
91
|
-
name: name,
|
|
92
|
-
};
|
|
93
|
-
await fsPromises.writeFile(targetPackageJsonPath, `${JSON.stringify(finalPackageJson, null, 2)}\n`, "utf8");
|
|
94
|
-
}
|
|
95
|
-
catch (error) {
|
|
96
|
-
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
97
|
-
logStringError("Error overriding package.json:");
|
|
98
|
-
logStringError(errorMessage);
|
|
99
|
-
throw error;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
function replaceImports(content) {
|
|
103
|
-
const importRegex = /(import\s+[^'"]*from\s+["'])([^"']+)(["'])/g;
|
|
104
|
-
return content.replace(importRegex, (match, p1, importPath, p3) => {
|
|
105
|
-
if (!importPath.startsWith(aliasSymbols.atSign) || importPath.startsWith(npmPackages.saasKit)) {
|
|
106
|
-
return match;
|
|
107
|
-
}
|
|
108
|
-
if (importPath.startsWith(aliasSymbols.atSign + folders.server) ||
|
|
109
|
-
importPath.includes(`/${folders.server}/`)) {
|
|
110
|
-
return `${p1}${npmPackages.saasKitServer}${p3}`;
|
|
111
|
-
}
|
|
112
|
-
return `${p1}${npmPackages.saasKit}${p3}`;
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
async function copyProjectFiles(targetDir) {
|
|
116
|
-
logInfoRaw(`Copying ${projectName} files...`);
|
|
117
|
-
for (const file of allFilesToCopy) {
|
|
118
|
-
const cliFile = `${folders.cli}/${file}`;
|
|
119
|
-
const srcPath = path.join(repoRoot, cliFile);
|
|
120
|
-
const processedFile = replaceToolsFolder(file);
|
|
121
|
-
const destPath = path.join(targetDir, processedFile);
|
|
122
|
-
if (existsSync(srcPath)) {
|
|
123
|
-
const stats = await fsPromises.stat(srcPath);
|
|
124
|
-
if (stats.isDirectory()) {
|
|
125
|
-
await copyDirectoryContents(srcPath, destPath);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
await copyAndProcessFile(srcPath, destPath);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
logInfoRaw(`Source file not found: ${cliFile}`);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
logInfoRaw("Files copied and imports updated!");
|
|
136
|
-
}
|
|
137
|
-
function replaceToolsFolder(file) {
|
|
138
|
-
let processedFile = file;
|
|
139
|
-
for (const [folderPrefix, replacements] of Object.entries(toolsFoldersToReplace)) {
|
|
140
|
-
if (processedFile.startsWith(folderPrefix) && isWithIndexer(replacements)) {
|
|
141
|
-
const typedReplacements = replacements;
|
|
142
|
-
for (const key in typedReplacements) {
|
|
143
|
-
const value = typedReplacements[key];
|
|
144
|
-
if (isString(value)) {
|
|
145
|
-
processedFile = processedFile.replace(key, value);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
return processedFile;
|
|
152
|
-
}
|
|
153
|
-
function shouldIgnorePath(filePath, basePath, isDirectory = false) {
|
|
154
|
-
const relativePath = path.relative(basePath, filePath);
|
|
155
|
-
const pathParts = relativePath.split(path.sep);
|
|
156
|
-
const relativeFromRepo = path.relative(repoRoot, filePath).replace(/\\/g, "/");
|
|
157
|
-
return ((isDirectory && foldersToIgnore.includes(relativeFromRepo)) ||
|
|
158
|
-
foldersToIgnore.some((ignoreFolder) => pathParts.some((part) => part === ignoreFolder)));
|
|
159
|
-
}
|
|
160
|
-
async function copyDirectoryContents(srcDir, destDir) {
|
|
161
|
-
if (!existsSync(destDir)) {
|
|
162
|
-
mkdirSync(destDir, { recursive: true });
|
|
163
|
-
}
|
|
164
|
-
try {
|
|
165
|
-
const entries = await fsPromises.readdir(srcDir, { withFileTypes: true });
|
|
166
|
-
for (const entry of entries) {
|
|
167
|
-
const srcPath = path.join(srcDir, entry.name);
|
|
168
|
-
const destPath = path.join(destDir, entry.name);
|
|
169
|
-
if (!shouldIgnorePath(srcPath, srcDir, entry.isDirectory())) {
|
|
170
|
-
if (entry.isDirectory()) {
|
|
171
|
-
await copyDirectoryContents(srcPath, destPath);
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
await copyAndProcessFile(srcPath, destPath);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
catch (error) {
|
|
180
|
-
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
181
|
-
logStringError(`Error reading directory ${srcDir}: ${errorMessage}`);
|
|
182
|
-
throw error;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
async function copyAndProcessFile(srcPath, destPath) {
|
|
186
|
-
const destDir = path.dirname(destPath);
|
|
187
|
-
if (!existsSync(destDir)) {
|
|
188
|
-
mkdirSync(destDir, { recursive: true });
|
|
189
|
-
}
|
|
190
|
-
const stats = await fsPromises.stat(srcPath);
|
|
191
|
-
if (stats.isDirectory()) {
|
|
192
|
-
await copyDirectoryContents(srcPath, destPath);
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
const content = await fsPromises.readFile(srcPath, "utf8");
|
|
196
|
-
const processedContent = replaceImports(content);
|
|
197
|
-
await fsPromises.writeFile(destPath, processedContent, "utf8");
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
function createAdditionalFolders(targetDir) {
|
|
201
|
-
for (const folder of additionalFoldersToCreate) {
|
|
202
|
-
const folderPath = path.join(targetDir, folder);
|
|
203
|
-
if (!existsSync(folderPath)) {
|
|
204
|
-
mkdirSync(folderPath, { recursive: true });
|
|
205
|
-
logInfoRaw(`Created folder: ${folder}`);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
logInfoRaw("Additional folders created!");
|
|
209
|
-
}
|
|
210
|
-
async function main() {
|
|
211
|
-
const args = process.argv.slice(2);
|
|
212
|
-
if (args.length < 1) {
|
|
213
|
-
logStringError("Error: Specify folder name. Example: npx create-saas-kit-app <folder-name>");
|
|
214
|
-
process.exit(1);
|
|
215
|
-
}
|
|
216
|
-
const folderName = args[0];
|
|
217
|
-
const targetDir = path.resolve(process.cwd(), folderName);
|
|
218
|
-
logInfoRaw(`\nCreating ${projectName} project "${folderName}"...\n`);
|
|
219
|
-
try {
|
|
220
|
-
checkTargetFolder(targetDir);
|
|
221
|
-
createNextProject(folderName, targetDir);
|
|
222
|
-
await copyProjectFiles(targetDir);
|
|
223
|
-
await overridePackageJson(targetDir);
|
|
224
|
-
createAdditionalFolders(targetDir);
|
|
225
|
-
await createEnvFile(targetDir);
|
|
226
|
-
await updateLayoutTitle(targetDir, folderName);
|
|
227
|
-
logInfoRaw(`\n${projectName} project "${folderName}" is ready!`);
|
|
228
|
-
logInfoRaw("Next steps:");
|
|
229
|
-
logInfoRaw(` cd ${folderName}`);
|
|
230
|
-
logInfoRaw(" npm run prod");
|
|
231
|
-
logInfoRaw(" npm start");
|
|
232
|
-
}
|
|
233
|
-
catch (error) {
|
|
234
|
-
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
235
|
-
logStringError("Error:");
|
|
236
|
-
logStringError(errorMessage);
|
|
237
|
-
if (existsSync(targetDir)) {
|
|
238
|
-
logInfoRaw("Cleaning up...");
|
|
239
|
-
rmSync(targetDir, { recursive: true, force: true });
|
|
240
|
-
}
|
|
241
|
-
process.exit(1);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
async function updateLayoutTitle(targetDir, folderName) {
|
|
245
|
-
const layoutPath = path.join(targetDir, "src/app/layout.tsx");
|
|
246
|
-
if (!existsSync(layoutPath)) {
|
|
247
|
-
throw createError(`layout.tsx not found at ${layoutPath}, cannot update title.`);
|
|
248
|
-
}
|
|
249
|
-
let content = await fsPromises.readFile(layoutPath, "utf8");
|
|
250
|
-
const titleRegex = /"SaaS Kit"/g;
|
|
251
|
-
if (!titleRegex.test(content)) {
|
|
252
|
-
throw createError("SaaS Kit not found in layout.tsx, cannot update title.");
|
|
253
|
-
}
|
|
254
|
-
content = content.replace(titleRegex, `"${folderName}"`);
|
|
255
|
-
await fsPromises.writeFile(layoutPath, content, "utf8");
|
|
256
|
-
}
|
|
257
|
-
main().catch((error) => {
|
|
258
|
-
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
259
|
-
logStringError("Unhandled error:");
|
|
260
|
-
logStringError(errorMessage);
|
|
261
|
-
process.exit(1);
|
|
262
|
-
});
|
package/cli/.gitlab-ci.yml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
include:
|
|
2
|
-
- "packages/infra/ci/templates/ci-variables.yml"
|
|
3
|
-
- "packages/infra/ci/templates/base-template.yml"
|
|
4
|
-
|
|
5
|
-
- "packages/infra/ci/templates/build-package.yml"
|
|
6
|
-
- "packages/infra/ci/templates/lint.yml"
|
|
7
|
-
- "packages/infra/ci/templates/build-and-test.yml"
|
|
8
|
-
- "packages/infra/ci/templates/saas-kit-test-build-and-test.yml"
|
|
9
|
-
- "packages/infra/ci/templates/create-saas-kit-app-test.yml"
|
|
10
|
-
|
|
11
|
-
- "packages/infra/ci/templates/manual-cleanup.yml"
|
|
12
|
-
- "packages/infra/ci/templates/update-submodules.yml"
|
|
13
|
-
- "packages/infra/ci/templates/deploy-to-vercel.yml"
|
|
14
|
-
- "packages/infra/ci/templates/clear-nx-cache.yml"
|
|
15
|
-
- "packages/infra/ci/templates/drop-all-db.yml"
|
package/cli/.husky/commit-msg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npx tsx packages/base-repo/tools/git/commit-msg-script.ts "$1"
|
package/cli/.husky/pre-commit
DELETED