@suffolklitlab/alkiln 5.14.0 → 5.15.0
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/.github/workflows/github_server.yml +1 -1
- package/.github/workflows/playground.yml +2 -1
- package/CHANGELOG.md +29 -0
- package/action.yml +26 -10
- package/action_for_github_server/action.yml +31 -27
- package/docs/4_environments.md +2 -2
- package/docs/artifacts_folder_name.md +121 -71
- package/lib/docassemble/server_install.js +0 -2
- package/lib/docassemble/setup.js +1 -3
- package/lib/docassemble/takedown.js +2 -2
- package/lib/globals.js +10 -0
- package/lib/run_cucumber.js +40 -53
- package/lib/scope.js +32 -0
- package/lib/setup/TestGenerator.js +1757 -0
- package/lib/setup/artifacts.js +20 -0
- package/lib/setup/generate.js +42 -0
- package/lib/setup/get_Gherkin_AST.js +26 -0
- package/lib/setup/validate.js +89 -0
- package/lib/steps.js +53 -19
- package/lib/utils/Log.js +302 -149
- package/lib/utils/get_error_stacks.js +16 -0
- package/lib/utils/reports.js +43 -23
- package/lib/utils/session_vars.js +77 -57
- package/lib/utils/set_sources_paths.js +98 -0
- package/package.json +18 -7
- package/tests/log_codes/check_codes.sh +17 -13
- package/tests/log_codes/log_code_expected_instances.txt +58 -0
- package/tests/unit_tests/constrained_random_answers/invalid.fixtures.js +178 -0
- package/tests/unit_tests/constrained_random_answers/invalid.test.js +251 -0
- package/tests/unit_tests/constrained_random_answers/valid.fixtures.js +957 -0
- package/tests/unit_tests/constrained_random_answers/valid.test.js +563 -0
- package/tests/unit_tests/log.test.js +17 -41
- package/_alkiln_meta/gherkin_parsed_example.json +0 -1546
- package/_alkiln_meta/shift_logs.js +0 -75
- /package/docs/{expected_inernal_results.md → expected_internal_results.md} +0 -0
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
function shift_logs(folderPath, startNum, endNum) {
|
|
5
|
-
// Validate inputs
|
|
6
|
-
if (!folderPath || typeof folderPath !== 'string') {
|
|
7
|
-
throw new Error('Invalid folder path provided');
|
|
8
|
-
}
|
|
9
|
-
if (!startNum || !endNum || isNaN(startNum) || isNaN(endNum)) {
|
|
10
|
-
throw new Error('Invalid number range provided');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Process directory recursively
|
|
14
|
-
function processDirectory(dirPath) {
|
|
15
|
-
// Read all files in the folder
|
|
16
|
-
const files = fs.readdirSync(dirPath);
|
|
17
|
-
|
|
18
|
-
files.forEach(file => {
|
|
19
|
-
const some_path = path.join(dirPath, file);
|
|
20
|
-
const stats = fs.statSync(some_path);
|
|
21
|
-
|
|
22
|
-
if (stats.isDirectory()) {
|
|
23
|
-
// Recursively process subdirectories
|
|
24
|
-
processDirectory(some_path);
|
|
25
|
-
} else if (stats.isFile()) {
|
|
26
|
-
// Only process supported file paths
|
|
27
|
-
if ( some_path.startsWith(`.`) || some_path.startsWith(`alkiln`) || some_path.startsWith(`_`)) {
|
|
28
|
-
console.log(`not editing`, some_path);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (some_path.match(/(node_modules)|(_alkiln)|(package)|(shrinkwrap)|(runtime)|(alkiln\-)$/)) {
|
|
32
|
-
console.log(`not editing`, some_path);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let content = fs.readFileSync(some_path, 'utf8');
|
|
37
|
-
|
|
38
|
-
// Create regex pattern for ALK followed by digits
|
|
39
|
-
const pattern = /\bALK0(\d+)\b/g;
|
|
40
|
-
|
|
41
|
-
// Process matches and adjust numbers
|
|
42
|
-
content = content.replace(pattern, (match, numStr) => {
|
|
43
|
-
console.log(`match in ${ some_path }:`, JSON.stringify(match) );
|
|
44
|
-
|
|
45
|
-
const num = parseInt(numStr);
|
|
46
|
-
// Only modify numbers within our target range
|
|
47
|
-
if (num >= startNum && num <= endNum) {
|
|
48
|
-
console.log(`Changing match: previous content:`);
|
|
49
|
-
console.log( content );
|
|
50
|
-
return `ALK0${num + 1}`;
|
|
51
|
-
}
|
|
52
|
-
return match;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// Write back the modified content
|
|
56
|
-
fs.writeFileSync(some_path, content);
|
|
57
|
-
console.log(`Processed file: ${file}`);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
processDirectory(folderPath)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Example usage
|
|
66
|
-
try {
|
|
67
|
-
shift_logs(`.`, 236, 276); //'./your_folder', 123, 456);
|
|
68
|
-
console.log('Sequence fixing completed');
|
|
69
|
-
} catch (error) {
|
|
70
|
-
console.error('Error:', error.message);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
function check_types({ folderPath, startNum, endNum }) {
|
|
75
|
-
}
|
|
File without changes
|