@factiii/stack 0.1.28 → 0.1.30
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/dist/cli/init.d.ts +8 -3
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +128 -289
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/scan.d.ts +1 -1
- package/dist/cli/scan.d.ts.map +1 -1
- package/dist/cli/scan.js +84 -12
- package/dist/cli/scan.js.map +1 -1
- package/dist/generators/generate-stack-yml.d.ts +6 -0
- package/dist/generators/generate-stack-yml.d.ts.map +1 -1
- package/dist/generators/generate-stack-yml.js +130 -0
- package/dist/generators/generate-stack-yml.js.map +1 -1
- package/dist/plugins/pipelines/factiii/index.js +2 -2
- package/dist/plugins/pipelines/factiii/index.js.map +1 -1
- package/dist/plugins/pipelines/factiii/scanfix/bootstrap.d.ts +11 -0
- package/dist/plugins/pipelines/factiii/scanfix/bootstrap.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/bootstrap.js +168 -0
- package/dist/plugins/pipelines/factiii/scanfix/bootstrap.js.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/config.d.ts +3 -1
- package/dist/plugins/pipelines/factiii/scanfix/config.d.ts.map +1 -1
- package/dist/plugins/pipelines/factiii/scanfix/config.js +3 -15
- package/dist/plugins/pipelines/factiii/scanfix/config.js.map +1 -1
- package/dist/plugins/pipelines/factiii/workflows/stack-ci.yml +27 -8
- package/dist/plugins/pipelines/factiii/workflows/stack-cicd-prod.yml +27 -8
- package/dist/utils/gitignore.d.ts +15 -0
- package/dist/utils/gitignore.d.ts.map +1 -0
- package/dist/{plugins/pipelines/factiii/scanfix/local-config.js → utils/gitignore.js} +36 -32
- package/dist/utils/gitignore.js.map +1 -0
- package/package.json +1 -1
- package/dist/plugins/pipelines/factiii/scanfix/local-config.d.ts +0 -7
- package/dist/plugins/pipelines/factiii/scanfix/local-config.d.ts.map +0 -1
- package/dist/plugins/pipelines/factiii/scanfix/local-config.js.map +0 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Bootstrap Scanfixes
|
|
4
|
+
*
|
|
5
|
+
* Creates config files (stack.yml, stackAuto.yml, stack.local.yml) and
|
|
6
|
+
* ensures gitignore entries for sensitive files. These run first in the
|
|
7
|
+
* factiii pipeline's fixes array so that other scanfixes can rely on
|
|
8
|
+
* config files existing.
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.bootstrapFixes = void 0;
|
|
45
|
+
const fs = __importStar(require("fs"));
|
|
46
|
+
const config_files_js_1 = require("../../../../constants/config-files.js");
|
|
47
|
+
const gitignore_js_1 = require("../../../../utils/gitignore.js");
|
|
48
|
+
/**
|
|
49
|
+
* Detect the dev OS from process.platform
|
|
50
|
+
*/
|
|
51
|
+
function detectDevOS() {
|
|
52
|
+
if (process.platform === 'darwin')
|
|
53
|
+
return 'mac';
|
|
54
|
+
if (process.platform === 'win32')
|
|
55
|
+
return 'windows';
|
|
56
|
+
return 'ubuntu';
|
|
57
|
+
}
|
|
58
|
+
exports.bootstrapFixes = [
|
|
59
|
+
// ── Config file creation ───────────────────────────────────────
|
|
60
|
+
{
|
|
61
|
+
id: 'missing-stack-yml',
|
|
62
|
+
stage: 'dev',
|
|
63
|
+
severity: 'critical',
|
|
64
|
+
description: config_files_js_1.STACK_CONFIG_FILENAME + ' not found',
|
|
65
|
+
scan: async (_config, rootDir) => {
|
|
66
|
+
return !fs.existsSync((0, config_files_js_1.getStackConfigPath)(rootDir));
|
|
67
|
+
},
|
|
68
|
+
fix: async (_config, rootDir) => {
|
|
69
|
+
// Use dynamic import to avoid circular dependency
|
|
70
|
+
const { generateSmartStackYml } = await Promise.resolve().then(() => __importStar(require('../../../../generators/generate-stack-yml.js')));
|
|
71
|
+
return generateSmartStackYml(rootDir);
|
|
72
|
+
},
|
|
73
|
+
manualFix: 'Run: npx stack fix',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'missing-stack-auto-yml',
|
|
77
|
+
stage: 'dev',
|
|
78
|
+
severity: 'critical',
|
|
79
|
+
description: config_files_js_1.STACK_AUTO_FILENAME + ' not found',
|
|
80
|
+
scan: async (_config, rootDir) => {
|
|
81
|
+
return !fs.existsSync((0, config_files_js_1.getStackAutoPath)(rootDir));
|
|
82
|
+
},
|
|
83
|
+
fix: async (_config, rootDir) => {
|
|
84
|
+
const { generateFactiiiAuto } = await Promise.resolve().then(() => __importStar(require('../../../../generators/generate-stack-auto.js')));
|
|
85
|
+
await generateFactiiiAuto(rootDir, { force: true });
|
|
86
|
+
return true;
|
|
87
|
+
},
|
|
88
|
+
manualFix: 'Run: npx stack fix',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'missing-stack-local-yml',
|
|
92
|
+
stage: 'dev',
|
|
93
|
+
severity: 'warning',
|
|
94
|
+
description: config_files_js_1.STACK_LOCAL_FILENAME + ' not found (specifies your dev OS)',
|
|
95
|
+
scan: async (_config, rootDir) => {
|
|
96
|
+
return !fs.existsSync((0, config_files_js_1.getStackLocalPath)(rootDir));
|
|
97
|
+
},
|
|
98
|
+
fix: async (_config, rootDir) => {
|
|
99
|
+
const localPath = (0, config_files_js_1.getStackLocalPath)(rootDir);
|
|
100
|
+
const devOS = detectDevOS();
|
|
101
|
+
const content = '# Local machine config (gitignored - each developer has their own)\n' +
|
|
102
|
+
'# Generated by: npx stack\n' +
|
|
103
|
+
'\n' +
|
|
104
|
+
'dev_os: ' + devOS + '\n';
|
|
105
|
+
fs.writeFileSync(localPath, content, 'utf8');
|
|
106
|
+
// Also ensure gitignored
|
|
107
|
+
(0, gitignore_js_1.ensureGitignored)(rootDir, config_files_js_1.STACK_LOCAL_FILENAME);
|
|
108
|
+
(0, gitignore_js_1.ensureGitignored)(rootDir, 'factiii.local.yml');
|
|
109
|
+
console.log(' [OK] Created ' + config_files_js_1.STACK_LOCAL_FILENAME + ' (dev_os: ' + devOS + ')');
|
|
110
|
+
return true;
|
|
111
|
+
},
|
|
112
|
+
manualFix: 'Create ' + config_files_js_1.STACK_LOCAL_FILENAME + ' with: dev_os: mac|windows|ubuntu',
|
|
113
|
+
},
|
|
114
|
+
// ── Gitignore checks ──────────────────────────────────────────
|
|
115
|
+
{
|
|
116
|
+
id: 'gitignore-local-config',
|
|
117
|
+
stage: 'dev',
|
|
118
|
+
severity: 'info',
|
|
119
|
+
description: config_files_js_1.STACK_LOCAL_FILENAME + ' not in .gitignore',
|
|
120
|
+
scan: async (_config, rootDir) => {
|
|
121
|
+
// Only check if the file exists (no point gitignoring something that doesn't exist)
|
|
122
|
+
if (!fs.existsSync((0, config_files_js_1.getStackLocalPath)(rootDir)))
|
|
123
|
+
return false;
|
|
124
|
+
return !(0, gitignore_js_1.isGitignored)(rootDir, config_files_js_1.STACK_LOCAL_FILENAME);
|
|
125
|
+
},
|
|
126
|
+
fix: async (_config, rootDir) => {
|
|
127
|
+
(0, gitignore_js_1.ensureGitignored)(rootDir, config_files_js_1.STACK_LOCAL_FILENAME);
|
|
128
|
+
(0, gitignore_js_1.ensureGitignored)(rootDir, 'factiii.local.yml');
|
|
129
|
+
return true;
|
|
130
|
+
},
|
|
131
|
+
manualFix: 'Add ' + config_files_js_1.STACK_LOCAL_FILENAME + ' to .gitignore',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: 'gitignore-env-staging',
|
|
135
|
+
stage: 'dev',
|
|
136
|
+
severity: 'info',
|
|
137
|
+
description: '.env.staging not in .gitignore',
|
|
138
|
+
scan: async (_config, rootDir) => {
|
|
139
|
+
const envPath = require('path').join(rootDir, '.env.staging');
|
|
140
|
+
if (!fs.existsSync(envPath))
|
|
141
|
+
return false;
|
|
142
|
+
return !(0, gitignore_js_1.isGitignored)(rootDir, '.env.staging');
|
|
143
|
+
},
|
|
144
|
+
fix: async (_config, rootDir) => {
|
|
145
|
+
(0, gitignore_js_1.ensureGitignored)(rootDir, '.env.staging');
|
|
146
|
+
return true;
|
|
147
|
+
},
|
|
148
|
+
manualFix: 'Add .env.staging to .gitignore',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'gitignore-env-prod',
|
|
152
|
+
stage: 'dev',
|
|
153
|
+
severity: 'info',
|
|
154
|
+
description: '.env.prod not in .gitignore',
|
|
155
|
+
scan: async (_config, rootDir) => {
|
|
156
|
+
const envPath = require('path').join(rootDir, '.env.prod');
|
|
157
|
+
if (!fs.existsSync(envPath))
|
|
158
|
+
return false;
|
|
159
|
+
return !(0, gitignore_js_1.isGitignored)(rootDir, '.env.prod');
|
|
160
|
+
},
|
|
161
|
+
fix: async (_config, rootDir) => {
|
|
162
|
+
(0, gitignore_js_1.ensureGitignored)(rootDir, '.env.prod');
|
|
163
|
+
return true;
|
|
164
|
+
},
|
|
165
|
+
manualFix: 'Add .env.prod to .gitignore',
|
|
166
|
+
},
|
|
167
|
+
];
|
|
168
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../../../src/plugins/pipelines/factiii/scanfix/bootstrap.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AAEzB,2EAAkL;AAClL,iEAAgF;AAGhF;;GAEG;AACH,SAAS,WAAW;IAClB,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAChD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,SAAS,CAAC;IACnD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAEY,QAAA,cAAc,GAAU;IACnC,kEAAkE;IAClE;QACE,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,uCAAqB,GAAG,YAAY;QACjD,IAAI,EAAE,KAAK,EAAE,OAAsB,EAAE,OAAe,EAAoB,EAAE;YACxE,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,IAAA,oCAAkB,EAAC,OAAO,CAAC,CAAC,CAAC;QACrD,CAAC;Q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
|
/**
|
|
2
2
|
* Configuration-related fixes for Factiii Pipeline plugin
|
|
3
|
-
*
|
|
3
|
+
* Validates stack.yml content (EXAMPLE- values, etc.)
|
|
4
|
+
*
|
|
5
|
+
* Note: Missing stack.yml detection is in bootstrap.ts (runs first).
|
|
4
6
|
*/
|
|
5
7
|
import type { Fix } from '../../../../types/index.js';
|
|
6
8
|
export declare const configFixes: Fix[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/pipelines/factiii/scanfix/config.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/pipelines/factiii/scanfix/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAiB,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAGrE,eAAO,MAAM,WAAW,EAAE,GAAG,EAqB5B,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* Configuration-related fixes for Factiii Pipeline plugin
|
|
4
|
-
*
|
|
4
|
+
* Validates stack.yml content (EXAMPLE- values, etc.)
|
|
5
|
+
*
|
|
6
|
+
* Note: Missing stack.yml detection is in bootstrap.ts (runs first).
|
|
5
7
|
*/
|
|
6
8
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
9
|
if (k2 === undefined) k2 = k;
|
|
@@ -61,19 +63,5 @@ exports.configFixes = [
|
|
|
61
63
|
' - staging.domain: staging.yourdomain.com\n' +
|
|
62
64
|
' - prod.domain: yourdomain.com',
|
|
63
65
|
},
|
|
64
|
-
{
|
|
65
|
-
id: 'missing-stack-yml',
|
|
66
|
-
stage: 'dev',
|
|
67
|
-
severity: 'critical',
|
|
68
|
-
description: config_files_js_1.STACK_CONFIG_FILENAME + ' configuration file not found',
|
|
69
|
-
scan: async (_config, rootDir) => {
|
|
70
|
-
return !fs.existsSync((0, config_files_js_1.getStackConfigPath)(rootDir));
|
|
71
|
-
},
|
|
72
|
-
fix: async (_config, rootDir) => {
|
|
73
|
-
const { generateFactiiiYml } = await Promise.resolve().then(() => __importStar(require('../../../../generators/generate-stack-yml.js')));
|
|
74
|
-
return generateFactiiiYml(rootDir, { force: false });
|
|
75
|
-
},
|
|
76
|
-
manualFix: 'Run: npx stack fix (will create ' + config_files_js_1.STACK_CONFIG_FILENAME + ' from plugin schemas)',
|
|
77
|
-
},
|
|
78
66
|
];
|
|
79
67
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../src/plugins/pipelines/factiii/scanfix/config.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../src/plugins/pipelines/factiii/scanfix/config.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AAEzB,2EAAkG;AAErF,QAAA,WAAW,GAAU;IAChC;QACE,EAAE,EAAE,0BAA0B;QAC9B,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,uCAAqB,GAAG,6DAA6D;QAClG,IAAI,EAAE,KAAK,EAAE,OAAsB,EAAE,OAAe,EAAoB,EAAE;YACxE,MAAM,UAAU,GAAG,IAAA,oCAAkB,EAAC,OAAO,CAAC,CAAC;YAC/C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;gBAAE,OAAO,KAAK,CAAC;YAC7C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YACpD,OAAO,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QACtC,CAAC;QACD,GAAG,EAAE,IAAI;QACT,SAAS,EACP,0CAA0C,GAAG,uCAAqB,GAAG,6BAA6B;YAClG,gCAAgC;YAChC,gDAAgD;YAChD,4CAA4C;YAC5C,kDAAkD;YAClD,qCAAqC;KACxC;CACF,CAAC"}
|
|
@@ -13,22 +13,36 @@ on:
|
|
|
13
13
|
jobs:
|
|
14
14
|
ci:
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
|
+
env:
|
|
17
|
+
CI: true
|
|
18
|
+
ENV: test
|
|
19
|
+
NODE_ENV: test
|
|
20
|
+
DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
21
|
+
TEST_DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
22
|
+
TEST_ADMIN_IP: "::ffff:127.0.0.1"
|
|
23
|
+
SITE_URL: http://localhost:3000
|
|
24
|
+
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:5001
|
|
25
|
+
ACCESS_TOKEN_SECRET: test-secret-key
|
|
26
|
+
GOOGLE_CLIENT_ID: test-google-id
|
|
27
|
+
APPLE_CLIENT_ID: com.factiii.test
|
|
28
|
+
NEXT_PUBLIC_SITE_URL: http://localhost:3000
|
|
29
|
+
NEXT_PUBLIC_API_URL: http://localhost:5001
|
|
30
|
+
|
|
16
31
|
steps:
|
|
17
32
|
- name: Checkout
|
|
18
33
|
uses: actions/checkout@v4
|
|
19
34
|
|
|
20
|
-
- name: Setup Node.js
|
|
21
|
-
uses: actions/setup-node@v4
|
|
22
|
-
with:
|
|
23
|
-
node-version: '20'
|
|
24
|
-
|
|
25
35
|
- name: Setup pnpm
|
|
26
36
|
uses: pnpm/action-setup@v4
|
|
37
|
+
|
|
38
|
+
- name: Setup Node.js
|
|
39
|
+
uses: actions/setup-node@v4
|
|
27
40
|
with:
|
|
28
|
-
version:
|
|
41
|
+
node-version: '24'
|
|
42
|
+
cache: 'pnpm'
|
|
29
43
|
|
|
30
44
|
- name: Install dependencies
|
|
31
|
-
run: pnpm install
|
|
45
|
+
run: pnpm install
|
|
32
46
|
|
|
33
47
|
- name: Build server
|
|
34
48
|
run: pnpm build
|
|
@@ -52,5 +66,10 @@ jobs:
|
|
|
52
66
|
./gradlew assembleRelease
|
|
53
67
|
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
54
68
|
|
|
69
|
+
- name: Start Docker containers
|
|
70
|
+
run: |
|
|
71
|
+
chmod +x ./start.sh
|
|
72
|
+
./start.sh
|
|
73
|
+
|
|
55
74
|
- name: Run tests
|
|
56
|
-
run: pnpm test
|
|
75
|
+
run: pnpm test:server
|
|
@@ -11,22 +11,36 @@ on:
|
|
|
11
11
|
jobs:
|
|
12
12
|
ci:
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
|
+
env:
|
|
15
|
+
CI: true
|
|
16
|
+
ENV: test
|
|
17
|
+
NODE_ENV: test
|
|
18
|
+
DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
19
|
+
TEST_DATABASE_URL: "postgresql://postgres:password@localhost:5440/factiii-test?connect_timeout=300"
|
|
20
|
+
TEST_ADMIN_IP: "::ffff:127.0.0.1"
|
|
21
|
+
SITE_URL: http://localhost:3000
|
|
22
|
+
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:5001
|
|
23
|
+
ACCESS_TOKEN_SECRET: test-secret-key
|
|
24
|
+
GOOGLE_CLIENT_ID: test-google-id
|
|
25
|
+
APPLE_CLIENT_ID: com.factiii.test
|
|
26
|
+
NEXT_PUBLIC_SITE_URL: http://localhost:3000
|
|
27
|
+
NEXT_PUBLIC_API_URL: http://localhost:5001
|
|
28
|
+
|
|
14
29
|
steps:
|
|
15
30
|
- name: Checkout
|
|
16
31
|
uses: actions/checkout@v4
|
|
17
32
|
|
|
18
|
-
- name: Setup Node.js
|
|
19
|
-
uses: actions/setup-node@v4
|
|
20
|
-
with:
|
|
21
|
-
node-version: '20'
|
|
22
|
-
|
|
23
33
|
- name: Setup pnpm
|
|
24
34
|
uses: pnpm/action-setup@v4
|
|
35
|
+
|
|
36
|
+
- name: Setup Node.js
|
|
37
|
+
uses: actions/setup-node@v4
|
|
25
38
|
with:
|
|
26
|
-
version:
|
|
39
|
+
node-version: '24'
|
|
40
|
+
cache: 'pnpm'
|
|
27
41
|
|
|
28
42
|
- name: Install dependencies
|
|
29
|
-
run: pnpm install
|
|
43
|
+
run: pnpm install
|
|
30
44
|
|
|
31
45
|
- name: Build server
|
|
32
46
|
run: pnpm build
|
|
@@ -50,5 +64,10 @@ jobs:
|
|
|
50
64
|
./gradlew assembleRelease
|
|
51
65
|
if: hashFiles('apps/mobile/android/build.gradle') != ''
|
|
52
66
|
|
|
67
|
+
- name: Start Docker containers
|
|
68
|
+
run: |
|
|
69
|
+
chmod +x ./start.sh
|
|
70
|
+
./start.sh
|
|
71
|
+
|
|
53
72
|
- name: Run tests
|
|
54
|
-
run: pnpm test
|
|
73
|
+
run: pnpm test:server
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gitignore Utilities
|
|
3
|
+
*
|
|
4
|
+
* Shared functions for checking and updating .gitignore entries.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Check if an entry exists in .gitignore
|
|
8
|
+
*/
|
|
9
|
+
export declare function isGitignored(rootDir: string, entry: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Append a line to .gitignore if not already present.
|
|
12
|
+
* Returns true if the entry was added, false if already present.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ensureGitignored(rootDir: string, entry: string): boolean;
|
|
15
|
+
//# sourceMappingURL=gitignore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore.d.ts","sourceRoot":"","sources":["../../src/utils/gitignore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAYxE"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Gitignore Utilities
|
|
4
|
+
*
|
|
5
|
+
* Shared functions for checking and updating .gitignore entries.
|
|
5
6
|
*/
|
|
6
7
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
8
|
if (k2 === undefined) k2 = k;
|
|
@@ -37,34 +38,37 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
38
|
};
|
|
38
39
|
})();
|
|
39
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.
|
|
41
|
+
exports.isGitignored = isGitignored;
|
|
42
|
+
exports.ensureGitignored = ensureGitignored;
|
|
41
43
|
const fs = __importStar(require("fs"));
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
44
|
+
const path = __importStar(require("path"));
|
|
45
|
+
/**
|
|
46
|
+
* Check if an entry exists in .gitignore
|
|
47
|
+
*/
|
|
48
|
+
function isGitignored(rootDir, entry) {
|
|
49
|
+
const gitignorePath = path.join(rootDir, '.gitignore');
|
|
50
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
const content = fs.readFileSync(gitignorePath, 'utf8');
|
|
54
|
+
const lines = content.split('\n').map((l) => l.trim());
|
|
55
|
+
return lines.includes(entry);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Append a line to .gitignore if not already present.
|
|
59
|
+
* Returns true if the entry was added, false if already present.
|
|
60
|
+
*/
|
|
61
|
+
function ensureGitignored(rootDir, entry) {
|
|
62
|
+
if (isGitignored(rootDir, entry)) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
const gitignorePath = path.join(rootDir, '.gitignore');
|
|
66
|
+
let content = '';
|
|
67
|
+
if (fs.existsSync(gitignorePath)) {
|
|
68
|
+
content = fs.readFileSync(gitignorePath, 'utf8');
|
|
69
|
+
}
|
|
70
|
+
const separator = content.length > 0 && !content.endsWith('\n') ? '\n' : '';
|
|
71
|
+
fs.appendFileSync(gitignorePath, separator + entry + '\n');
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=gitignore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore.js","sourceRoot":"","sources":["../../src/utils/gitignore.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQH,oCAQC;AAMD,4CAYC;AAhCD,uCAAyB;AACzB,2CAA6B;AAE7B;;GAEG;AACH,SAAgB,YAAY,CAAC,OAAe,EAAE,KAAa;IACzD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACvD,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,OAAe,EAAE,KAAa;IAC7D,IAAI,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvD,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;IACD,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5E,EAAE,CAAC,cAAc,CAAC,aAAa,EAAE,SAAS,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local config scanfix for Factiii Pipeline plugin
|
|
3
|
-
* Warns if stack.local.yml is missing (per-developer, gitignored config)
|
|
4
|
-
*/
|
|
5
|
-
import type { Fix } from '../../../../types/index.js';
|
|
6
|
-
export declare const localConfigFixes: Fix[];
|
|
7
|
-
//# sourceMappingURL=local-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"local-config.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/pipelines/factiii/scanfix/local-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAiB,GAAG,EAA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