@liascript/exporter 2.6.44--0.17.7 → 2.6.44--0.17.8
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/assets/capacitor/{index.7c29f1f8.js → index.77092ea5.js} +2 -2
- package/dist/assets/capacitor/{index.ac58c346.js → index.7c990c90.js} +2 -2
- package/dist/assets/{scorm2004/index.3855b56a.css → capacitor/index.d32274ee.css} +1 -1
- package/dist/assets/capacitor/index.html +1 -1
- package/dist/assets/indexeddb/index.338caa69.js +1 -0
- package/dist/assets/{xapi/index.d1b052a6.js → indexeddb/index.37fff01c.js} +1 -1
- package/dist/assets/{capacitor/index.3855b56a.css → indexeddb/index.d32274ee.css} +1 -1
- package/dist/assets/indexeddb/index.html +1 -1
- package/dist/assets/indexeddb/{jszip.min.63142cc8.js → jszip.min.4fbcc13f.js} +1 -1
- package/dist/assets/pdf/index.2a155247.js +1 -0
- package/dist/assets/pdf/{index.c81a848e.css → index.d4376f7a.css} +1 -1
- package/dist/assets/pdf/index.f1056b07.js +1 -0
- package/dist/assets/pdf/index.html +1 -1
- package/dist/assets/scorm1.2/index.4459769d.js +1 -0
- package/dist/assets/scorm1.2/index.472f9b84.js +1 -0
- package/dist/assets/scorm1.2/{index.3855b56a.css → index.d32274ee.css} +1 -1
- package/dist/assets/scorm1.2/index.html +1 -1
- package/dist/assets/{web/jszip.min.63142cc8.js → scorm1.2/jszip.min.4fbcc13f.js} +1 -1
- package/dist/assets/scorm2004/index.88bf9b7c.js +1 -0
- package/dist/assets/scorm2004/index.93c61dcb.js +1 -0
- package/dist/assets/{indexeddb/index.3855b56a.css → scorm2004/index.d32274ee.css} +1 -1
- package/dist/assets/scorm2004/index.html +1 -1
- package/dist/assets/web/index.2d3e116d.js +1 -0
- package/dist/assets/web/index.99fe9bd1.js +1 -0
- package/dist/assets/web/index.d32274ee.css +1 -0
- package/dist/assets/web/index.html +1 -1
- package/dist/assets/{scorm1.2/jszip.min.63142cc8.js → web/jszip.min.4fbcc13f.js} +1 -1
- package/dist/assets/web/{jszip.min.19c66d77.js → jszip.min.eaecf580.js} +1 -1
- package/dist/assets/xapi/index.bceeb4a9.js +1 -0
- package/dist/assets/xapi/index.cdc6535a.js +1 -0
- package/dist/assets/xapi/index.d32274ee.css +1 -0
- package/dist/assets/xapi/index.html +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/.github/workflows/test-action.yml +0 -231
- package/action/README.md +0 -263
- package/action/dist/action.js +0 -293
- package/action/dist/index.js +0 -28372
- package/action/dist/inputs.js +0 -173
- package/action/dist/utils.js +0 -320
- package/action/examples/matrix-build.yml +0 -64
- package/action/examples/multi-course.yml +0 -39
- package/action/examples/single-course.yml +0 -42
- package/action/package-lock.json +0 -5286
- package/action/package.json +0 -32
- package/action/src/action.ts +0 -306
- package/action/src/inputs.ts +0 -237
- package/action/src/utils.ts +0 -314
- package/action/tsconfig.json +0 -32
- package/dist/assets/indexeddb/index.08d2ff9e.js +0 -1
- package/dist/assets/indexeddb/index.0b473014.js +0 -1
- package/dist/assets/pdf/index.736768e2.js +0 -1
- package/dist/assets/pdf/index.7c8f0682.js +0 -1
- package/dist/assets/scorm1.2/index.c9f06556.js +0 -1
- package/dist/assets/scorm1.2/index.f31e5689.js +0 -1
- package/dist/assets/scorm2004/index.42e8223c.js +0 -1
- package/dist/assets/scorm2004/index.773e56c6.js +0 -1
- package/dist/assets/web/index.2913fc8a.js +0 -1
- package/dist/assets/web/index.3855b56a.css +0 -1
- package/dist/assets/web/index.4b421cf7.js +0 -1
- package/dist/assets/xapi/index.0ef29ba3.js +0 -1
- package/dist/assets/xapi/index.3855b56a.css +0 -1
- /package/dist/assets/{scorm1.2 → capacitor}/jszip.min.eaecf580.js +0 -0
- /package/dist/assets/{capacitor → scorm1.2}/jszip.min.19c66d77.js +0 -0
package/action/dist/inputs.js
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.logInputs = exports.validateInputs = exports.parseInputs = void 0;
|
|
27
|
-
const core = __importStar(require("@actions/core"));
|
|
28
|
-
/**
|
|
29
|
-
* Helper function to safely get boolean inputs, handling empty/undefined values
|
|
30
|
-
*/
|
|
31
|
-
function getBooleanInput(name, defaultValue = false) {
|
|
32
|
-
const input = core.getInput(name);
|
|
33
|
-
return input ? core.getBooleanInput(name) : defaultValue;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Parse and validate GitHub Action inputs into LiaScript Exporter arguments
|
|
37
|
-
*/
|
|
38
|
-
function parseInputs() {
|
|
39
|
-
// Core required inputs
|
|
40
|
-
const inputFile = core.getInput('input-file', { required: true });
|
|
41
|
-
const format = core.getInput('format', { required: true });
|
|
42
|
-
// Optional core inputs
|
|
43
|
-
const outputName = core.getInput('output-name') || 'output';
|
|
44
|
-
const coursePath = core.getInput('course-path');
|
|
45
|
-
// Validate format
|
|
46
|
-
const validFormats = [
|
|
47
|
-
'scorm1.2', 'scorm2004', 'pdf', 'web', 'ims', 'xapi', 'rdf', 'json', 'project'
|
|
48
|
-
];
|
|
49
|
-
if (!validFormats.includes(format.toLowerCase())) {
|
|
50
|
-
throw new Error(`Invalid format '${format}'. Valid formats: ${validFormats.join(', ')}`);
|
|
51
|
-
}
|
|
52
|
-
// Build the arguments object
|
|
53
|
-
const args = {
|
|
54
|
-
input: inputFile,
|
|
55
|
-
readme: inputFile,
|
|
56
|
-
output: outputName,
|
|
57
|
-
format: format.toLowerCase(),
|
|
58
|
-
path: coursePath,
|
|
59
|
-
key: core.getInput('responsive-voice-key') || undefined,
|
|
60
|
-
style: core.getInput('style') || undefined,
|
|
61
|
-
// SCORM settings
|
|
62
|
-
'scorm-organization': core.getInput('scorm-organization') || undefined,
|
|
63
|
-
'scorm-masteryScore': core.getInput('scorm-mastery-score') || undefined,
|
|
64
|
-
'scorm-typicalDuration': core.getInput('scorm-typical-duration') || 'PT0H5M0S',
|
|
65
|
-
'scorm-iframe': getBooleanInput('scorm-iframe'),
|
|
66
|
-
'scorm-embed': getBooleanInput('scorm-embed'),
|
|
67
|
-
'scorm-alwaysActive': getBooleanInput('scorm-always-active'),
|
|
68
|
-
// IMS settings
|
|
69
|
-
'ims-indexeddb': getBooleanInput('ims-indexeddb'),
|
|
70
|
-
// Web settings
|
|
71
|
-
'web-zip': getBooleanInput('web-zip', true),
|
|
72
|
-
'web-indexeddb': getBooleanInput('web-indexeddb'),
|
|
73
|
-
'web-iframe': getBooleanInput('web-iframe'),
|
|
74
|
-
// PDF settings
|
|
75
|
-
'pdf-scale': core.getInput('pdf-scale') || '1',
|
|
76
|
-
'pdf-printBackground': getBooleanInput('pdf-print-background'),
|
|
77
|
-
'pdf-landscape': getBooleanInput('pdf-landscape'),
|
|
78
|
-
'pdf-format': core.getInput('pdf-format') || 'A4',
|
|
79
|
-
'pdf-stylesheet': core.getInput('pdf-stylesheet') || undefined,
|
|
80
|
-
'pdf-theme': core.getInput('pdf-theme') || 'default',
|
|
81
|
-
// RDF settings
|
|
82
|
-
'rdf-format': core.getInput('rdf-format') || 'json-ld',
|
|
83
|
-
'rdf-url': core.getInput('rdf-url') || undefined,
|
|
84
|
-
'rdf-type': core.getInput('rdf-type') || 'Course',
|
|
85
|
-
'rdf-license': core.getInput('rdf-license') || undefined,
|
|
86
|
-
'rdf-educationalLevel': core.getInput('rdf-educational-level') || undefined,
|
|
87
|
-
// xAPI settings
|
|
88
|
-
'xapi-endpoint': core.getInput('xapi-endpoint') || undefined,
|
|
89
|
-
'xapi-auth': core.getInput('xapi-auth') || undefined,
|
|
90
|
-
'xapi-actor': core.getInput('xapi-actor') || undefined,
|
|
91
|
-
'xapi-course-id': core.getInput('xapi-course-id') || undefined,
|
|
92
|
-
'xapi-course-title': core.getInput('xapi-course-title') || undefined,
|
|
93
|
-
'xapi-debug': getBooleanInput('xapi-debug'),
|
|
94
|
-
'xapi-zip': getBooleanInput('xapi-zip'),
|
|
95
|
-
};
|
|
96
|
-
return args;
|
|
97
|
-
}
|
|
98
|
-
exports.parseInputs = parseInputs;
|
|
99
|
-
/**
|
|
100
|
-
* Validate required inputs based on format
|
|
101
|
-
*/
|
|
102
|
-
function validateInputs(args) {
|
|
103
|
-
// Format-specific validations
|
|
104
|
-
switch (args.format) {
|
|
105
|
-
case 'xapi':
|
|
106
|
-
if (args['xapi-endpoint'] && !isValidUrl(args['xapi-endpoint'])) {
|
|
107
|
-
throw new Error('xapi-endpoint must be a valid URL');
|
|
108
|
-
}
|
|
109
|
-
break;
|
|
110
|
-
case 'rdf':
|
|
111
|
-
if (args['rdf-url'] && !isValidUrl(args['rdf-url'])) {
|
|
112
|
-
throw new Error('rdf-url must be a valid URL');
|
|
113
|
-
}
|
|
114
|
-
if (args['rdf-license'] && !isValidUrl(args['rdf-license'])) {
|
|
115
|
-
throw new Error('rdf-license must be a valid URL');
|
|
116
|
-
}
|
|
117
|
-
break;
|
|
118
|
-
case 'pdf':
|
|
119
|
-
if (args['pdf-scale']) {
|
|
120
|
-
const scale = parseFloat(args['pdf-scale']);
|
|
121
|
-
if (isNaN(scale) || scale <= 0 || scale > 2) {
|
|
122
|
-
throw new Error('pdf-scale must be a number between 0 and 2');
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
126
|
-
case 'scorm1.2':
|
|
127
|
-
case 'scorm2004':
|
|
128
|
-
if (args['scorm-masteryScore']) {
|
|
129
|
-
const score = parseInt(args['scorm-masteryScore'], 10);
|
|
130
|
-
if (isNaN(score) || score < 0 || score > 100) {
|
|
131
|
-
throw new Error('scorm-mastery-score must be a number between 0 and 100');
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
exports.validateInputs = validateInputs;
|
|
138
|
-
/**
|
|
139
|
-
* Helper function to validate URLs
|
|
140
|
-
*/
|
|
141
|
-
function isValidUrl(url) {
|
|
142
|
-
try {
|
|
143
|
-
new URL(url);
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
catch {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Log the parsed inputs for debugging
|
|
152
|
-
*/
|
|
153
|
-
function logInputs(args) {
|
|
154
|
-
core.info(`input: ${args.input}`);
|
|
155
|
-
core.info(`format: ${args.format}`);
|
|
156
|
-
core.info(`output: ${args.output}`);
|
|
157
|
-
if (args.path)
|
|
158
|
-
core.info(`path: ${args.path}`);
|
|
159
|
-
// Log non-default settings
|
|
160
|
-
Object.entries(args).forEach(([key, value]) => {
|
|
161
|
-
if (key.includes('-') && value !== undefined && value !== false && value !== '') {
|
|
162
|
-
// Simple masking for sensitive fields
|
|
163
|
-
if (key.includes('key') || key.includes('auth')) {
|
|
164
|
-
core.info(`${key}: ***`);
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
core.info(`${key}: ${value}`);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
exports.logInputs = logInputs;
|
|
173
|
-
//# sourceMappingURL=inputs.js.map
|
package/action/dist/utils.js
DELETED
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ensureOutputDirectory = exports.logEnvironmentInfo = exports.generateOutputName = exports.findOutputFiles = exports.getFileSize = exports.validateFiles = exports.resolvePaths = exports.isURL = void 0;
|
|
27
|
-
const path = __importStar(require("path"));
|
|
28
|
-
const fs = __importStar(require("fs"));
|
|
29
|
-
const core = __importStar(require("@actions/core"));
|
|
30
|
-
/**
|
|
31
|
-
* Check if a string is a URL
|
|
32
|
-
*/
|
|
33
|
-
function isURL(input) {
|
|
34
|
-
try {
|
|
35
|
-
new URL(input);
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.isURL = isURL;
|
|
43
|
-
/**
|
|
44
|
-
* Resolve file paths and set up the working directory structure
|
|
45
|
-
*/
|
|
46
|
-
function resolvePaths(args) {
|
|
47
|
-
const resolvedArgs = { ...args };
|
|
48
|
-
// Convert input file to absolute path
|
|
49
|
-
if (!path.isAbsolute(args.input) && !isURL(args.input)) {
|
|
50
|
-
resolvedArgs.input = path.resolve(process.cwd(), args.input);
|
|
51
|
-
}
|
|
52
|
-
// Set course path if not provided
|
|
53
|
-
if (!args.path && !isURL(args.input)) {
|
|
54
|
-
resolvedArgs.path = path.dirname(resolvedArgs.input);
|
|
55
|
-
}
|
|
56
|
-
else if (args.path && !path.isAbsolute(args.path)) {
|
|
57
|
-
resolvedArgs.path = path.resolve(process.cwd(), args.path);
|
|
58
|
-
}
|
|
59
|
-
// Set readme path relative to course path
|
|
60
|
-
if (resolvedArgs.path && !isURL(resolvedArgs.input)) {
|
|
61
|
-
resolvedArgs.readme = path.relative(resolvedArgs.path, resolvedArgs.input);
|
|
62
|
-
if (resolvedArgs.readme.startsWith('../')) {
|
|
63
|
-
// If input file is outside course path, use the full path
|
|
64
|
-
resolvedArgs.readme = resolvedArgs.input;
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
resolvedArgs.readme = './' + resolvedArgs.readme;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return resolvedArgs;
|
|
71
|
-
}
|
|
72
|
-
exports.resolvePaths = resolvePaths;
|
|
73
|
-
/**
|
|
74
|
-
* Validate that required files exist
|
|
75
|
-
*/
|
|
76
|
-
function validateFiles(args) {
|
|
77
|
-
if (!isURL(args.input)) {
|
|
78
|
-
if (!fs.existsSync(args.input)) {
|
|
79
|
-
throw new Error(`Input file does not exist: ${args.input}`);
|
|
80
|
-
}
|
|
81
|
-
const stat = fs.statSync(args.input);
|
|
82
|
-
if (!stat.isFile()) {
|
|
83
|
-
throw new Error(`Input path is not a file: ${args.input}`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
// Validate course path if provided
|
|
87
|
-
if (args.path && !fs.existsSync(args.path)) {
|
|
88
|
-
throw new Error(`Course path does not exist: ${args.path}`);
|
|
89
|
-
}
|
|
90
|
-
// Validate PDF stylesheet if provided
|
|
91
|
-
if (args['pdf-stylesheet']) {
|
|
92
|
-
const stylesheetPath = path.isAbsolute(args['pdf-stylesheet'])
|
|
93
|
-
? args['pdf-stylesheet']
|
|
94
|
-
: path.resolve(args.path || path.dirname(args.input), args['pdf-stylesheet']);
|
|
95
|
-
if (!fs.existsSync(stylesheetPath)) {
|
|
96
|
-
throw new Error(`PDF stylesheet does not exist: ${stylesheetPath}`);
|
|
97
|
-
}
|
|
98
|
-
// Update with resolved path
|
|
99
|
-
args['pdf-stylesheet'] = stylesheetPath;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.validateFiles = validateFiles;
|
|
103
|
-
/**
|
|
104
|
-
* Get file size in bytes
|
|
105
|
-
*/
|
|
106
|
-
function getFileSize(filePath) {
|
|
107
|
-
try {
|
|
108
|
-
const stats = fs.statSync(filePath);
|
|
109
|
-
return stats.size;
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
core.warning(`Could not get file size for ${filePath}: ${error}`);
|
|
113
|
-
return 0;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exports.getFileSize = getFileSize;
|
|
117
|
-
/**
|
|
118
|
-
* Find output files based on format and output name
|
|
119
|
-
*/
|
|
120
|
-
function findOutputFiles(args) {
|
|
121
|
-
// The CLI creates output files in the current working directory
|
|
122
|
-
const outputDir = process.cwd();
|
|
123
|
-
const outputName = args.output;
|
|
124
|
-
const outputFiles = [];
|
|
125
|
-
core.info(`Looking for output files in: ${outputDir}`);
|
|
126
|
-
let expectedFile;
|
|
127
|
-
let description;
|
|
128
|
-
switch (args.format) {
|
|
129
|
-
case 'scorm1.2':
|
|
130
|
-
expectedFile = path.join(outputDir, `${outputName}.zip`);
|
|
131
|
-
description = 'SCORM 1.2';
|
|
132
|
-
break;
|
|
133
|
-
case 'scorm2004':
|
|
134
|
-
expectedFile = path.join(outputDir, `${outputName}.zip`);
|
|
135
|
-
description = 'SCORM 2004';
|
|
136
|
-
break;
|
|
137
|
-
case 'pdf':
|
|
138
|
-
expectedFile = path.join(outputDir, `${outputName}.pdf`);
|
|
139
|
-
description = 'PDF';
|
|
140
|
-
break;
|
|
141
|
-
case 'web':
|
|
142
|
-
// Web format can be either a directory or zip file depending on web-zip option
|
|
143
|
-
if (args['web-zip']) {
|
|
144
|
-
expectedFile = path.join(outputDir, `${outputName}.zip`);
|
|
145
|
-
description = 'web ZIP';
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
expectedFile = path.join(outputDir, outputName);
|
|
149
|
-
description = 'web directory';
|
|
150
|
-
}
|
|
151
|
-
break;
|
|
152
|
-
case 'ims':
|
|
153
|
-
expectedFile = path.join(outputDir, `${outputName}.zip`);
|
|
154
|
-
description = 'IMS';
|
|
155
|
-
break;
|
|
156
|
-
case 'xapi':
|
|
157
|
-
expectedFile = path.join(outputDir, `${outputName}.zip`);
|
|
158
|
-
description = 'xAPI';
|
|
159
|
-
break;
|
|
160
|
-
case 'rdf':
|
|
161
|
-
// RDF format has multiple possible extensions
|
|
162
|
-
const rdfPatterns = getRdfOutputPatterns(args);
|
|
163
|
-
for (const pattern of rdfPatterns) {
|
|
164
|
-
const rdfFile = path.join(outputDir, pattern);
|
|
165
|
-
if (fs.existsSync(rdfFile)) {
|
|
166
|
-
outputFiles.push(rdfFile);
|
|
167
|
-
core.info(`Found RDF file: ${rdfFile}`);
|
|
168
|
-
return outputFiles;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
core.warning(`No RDF files found with patterns: ${rdfPatterns.join(', ')}`);
|
|
172
|
-
return outputFiles;
|
|
173
|
-
case 'project':
|
|
174
|
-
// Project format can generate multiple files
|
|
175
|
-
const projectFiles = findProjectOutputFiles(args, outputDir);
|
|
176
|
-
if (projectFiles.length > 0) {
|
|
177
|
-
outputFiles.push(...projectFiles);
|
|
178
|
-
for (const file of projectFiles) {
|
|
179
|
-
core.info(`Found project file: ${file}`);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
core.warning(`No project files found in ${outputDir}`);
|
|
184
|
-
}
|
|
185
|
-
return outputFiles;
|
|
186
|
-
default:
|
|
187
|
-
expectedFile = path.join(outputDir, `${outputName}.json`);
|
|
188
|
-
description = 'JSON';
|
|
189
|
-
break;
|
|
190
|
-
}
|
|
191
|
-
// Check for the expected file
|
|
192
|
-
if (fs.existsSync(expectedFile)) {
|
|
193
|
-
// For web format, handle both directory and zip cases
|
|
194
|
-
if (args.format === 'web') {
|
|
195
|
-
if (args['web-zip']) {
|
|
196
|
-
// Web ZIP format - expect a file
|
|
197
|
-
if (fs.statSync(expectedFile).isFile()) {
|
|
198
|
-
outputFiles.push(expectedFile);
|
|
199
|
-
core.info(`Found ${description}: ${expectedFile}`);
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
core.warning(`Expected web ZIP file but found directory: ${expectedFile}`);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
// Web directory format - expect a directory
|
|
207
|
-
if (fs.statSync(expectedFile).isDirectory()) {
|
|
208
|
-
outputFiles.push(expectedFile);
|
|
209
|
-
core.info(`Found ${description}: ${expectedFile}`);
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
core.warning(`Expected web directory but found file: ${expectedFile}`);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
outputFiles.push(expectedFile);
|
|
218
|
-
core.info(`Found ${description} file: ${expectedFile}`);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
core.warning(`Expected ${description} file not found: ${expectedFile}`);
|
|
223
|
-
// List what files are actually in the directory for debugging
|
|
224
|
-
try {
|
|
225
|
-
const actualFiles = fs.readdirSync(outputDir);
|
|
226
|
-
core.info(`Files in output directory: ${actualFiles.slice(0, 10).join(', ')}${actualFiles.length > 10 ? '...' : ''}`);
|
|
227
|
-
}
|
|
228
|
-
catch (error) {
|
|
229
|
-
core.warning(`Could not list output directory: ${error}`);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return outputFiles;
|
|
233
|
-
}
|
|
234
|
-
exports.findOutputFiles = findOutputFiles;
|
|
235
|
-
/**
|
|
236
|
-
* Get RDF output patterns based on format setting
|
|
237
|
-
*/
|
|
238
|
-
function getRdfOutputPatterns(args) {
|
|
239
|
-
const format = args['rdf-format'] || 'json-ld';
|
|
240
|
-
switch (format) {
|
|
241
|
-
case 'json-ld':
|
|
242
|
-
return [`${args.output}.jsonld`, `${args.output}.json`];
|
|
243
|
-
case 'n-quads':
|
|
244
|
-
return [`${args.output}.nq`, `${args.output}.txt`];
|
|
245
|
-
default:
|
|
246
|
-
return [`${args.output}.json`, `${args.output}.jsonld`, `${args.output}.nq`];
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Find project format output files (complex logic for project exports)
|
|
251
|
-
*/
|
|
252
|
-
function findProjectOutputFiles(args, baseDir) {
|
|
253
|
-
const projectFiles = [];
|
|
254
|
-
// Project format can generate multiple files based on settings
|
|
255
|
-
const possibleExtensions = ['.zip', '.pdf', '.json', '.jsonld'];
|
|
256
|
-
const possiblePrefixes = [args.output, 'project', 'course'];
|
|
257
|
-
for (const prefix of possiblePrefixes) {
|
|
258
|
-
for (const ext of possibleExtensions) {
|
|
259
|
-
const file = path.join(baseDir, prefix + ext);
|
|
260
|
-
if (fs.existsSync(file)) {
|
|
261
|
-
projectFiles.push(file);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
// Also look for directories
|
|
266
|
-
const possibleDirs = [`${args.output}/`, 'project/', 'courses/'];
|
|
267
|
-
for (const dir of possibleDirs) {
|
|
268
|
-
const dirPath = path.join(baseDir, dir);
|
|
269
|
-
if (fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory()) {
|
|
270
|
-
projectFiles.push(dirPath);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
return projectFiles;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Generate output filename based on input file and format if not specified
|
|
277
|
-
*/
|
|
278
|
-
function generateOutputName(args) {
|
|
279
|
-
if (args.output !== 'output') {
|
|
280
|
-
return args.output; // User specified output name
|
|
281
|
-
}
|
|
282
|
-
// Generate from input file
|
|
283
|
-
let baseName;
|
|
284
|
-
if (isURL(args.input)) {
|
|
285
|
-
baseName = 'course'; // Simple fallback for URLs
|
|
286
|
-
}
|
|
287
|
-
else {
|
|
288
|
-
// Extract from file path
|
|
289
|
-
baseName = path.basename(args.input, path.extname(args.input));
|
|
290
|
-
if (baseName.toLowerCase() === 'readme') {
|
|
291
|
-
// Use parent directory name for README files
|
|
292
|
-
baseName = path.basename(path.dirname(args.input));
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
// Basic sanitization
|
|
296
|
-
baseName = baseName.replace(/[^a-zA-Z0-9-_]/g, '-').replace(/-+/g, '-');
|
|
297
|
-
return baseName || 'course';
|
|
298
|
-
}
|
|
299
|
-
exports.generateOutputName = generateOutputName;
|
|
300
|
-
/**
|
|
301
|
-
* Log system information for debugging
|
|
302
|
-
*/
|
|
303
|
-
function logEnvironmentInfo() {
|
|
304
|
-
core.info(`Node.js version: ${process.version}`);
|
|
305
|
-
core.info(`Platform: ${process.platform}`);
|
|
306
|
-
core.info(`Architecture: ${process.arch}`);
|
|
307
|
-
core.info(`Working directory: ${process.cwd()}`);
|
|
308
|
-
}
|
|
309
|
-
exports.logEnvironmentInfo = logEnvironmentInfo;
|
|
310
|
-
/**
|
|
311
|
-
* Ensure output directory exists
|
|
312
|
-
*/
|
|
313
|
-
function ensureOutputDirectory() {
|
|
314
|
-
const outputDir = process.cwd();
|
|
315
|
-
if (!fs.existsSync(outputDir)) {
|
|
316
|
-
fs.mkdirSync(outputDir, { recursive: true });
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
exports.ensureOutputDirectory = ensureOutputDirectory;
|
|
320
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
name: Release Course Packages
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
tags:
|
|
5
|
-
- 'v*'
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
build-and-release:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
|
|
11
|
-
steps:
|
|
12
|
-
- name: Checkout repository
|
|
13
|
-
uses: actions/checkout@v4
|
|
14
|
-
|
|
15
|
-
- name: Extract tag name
|
|
16
|
-
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
17
|
-
|
|
18
|
-
- name: Export to SCORM 1.2
|
|
19
|
-
id: export-scorm
|
|
20
|
-
uses: LiaScript/LiaScript-Exporter@master
|
|
21
|
-
with:
|
|
22
|
-
input-file: 'README.md'
|
|
23
|
-
format: 'scorm1.2'
|
|
24
|
-
output-name: 'course-${{ env.TAG_NAME }}-scorm1.2'
|
|
25
|
-
scorm-organization: 'My Organization'
|
|
26
|
-
scorm-mastery-score: '80'
|
|
27
|
-
|
|
28
|
-
- name: Export to PDF
|
|
29
|
-
id: export-pdf
|
|
30
|
-
uses: LiaScript/LiaScript-Exporter@master
|
|
31
|
-
with:
|
|
32
|
-
input-file: 'README.md'
|
|
33
|
-
format: 'pdf'
|
|
34
|
-
output-name: 'course-${{ env.TAG_NAME }}'
|
|
35
|
-
pdf-format: 'A4'
|
|
36
|
-
pdf-landscape: false
|
|
37
|
-
|
|
38
|
-
- name: Export to Web
|
|
39
|
-
id: export-web
|
|
40
|
-
uses: LiaScript/LiaScript-Exporter@master
|
|
41
|
-
with:
|
|
42
|
-
input-file: 'README.md'
|
|
43
|
-
format: 'web'
|
|
44
|
-
output-name: 'course-${{ env.TAG_NAME }}-web'
|
|
45
|
-
web-zip: true
|
|
46
|
-
web-indexeddb: true
|
|
47
|
-
|
|
48
|
-
- name: Create Release
|
|
49
|
-
uses: softprops/action-gh-release@v1
|
|
50
|
-
with:
|
|
51
|
-
files: |
|
|
52
|
-
${{ steps.export-scorm.outputs.output-file }}
|
|
53
|
-
${{ steps.export-pdf.outputs.output-file }}
|
|
54
|
-
${{ steps.export-web.outputs.output-file }}
|
|
55
|
-
body: |
|
|
56
|
-
Course packages for ${{ env.TAG_NAME }}
|
|
57
|
-
|
|
58
|
-
- SCORM 1.2 package for LMS deployment
|
|
59
|
-
- PDF version for offline reading
|
|
60
|
-
- Web package for standalone hosting
|
|
61
|
-
draft: false
|
|
62
|
-
prerelease: false
|
|
63
|
-
env:
|
|
64
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
name: Multi-Course Export
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [ main ]
|
|
5
|
-
pull_request:
|
|
6
|
-
branches: [ main ]
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
export:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
|
|
12
|
-
strategy:
|
|
13
|
-
matrix:
|
|
14
|
-
course:
|
|
15
|
-
- { path: 'course1/README.md', name: 'basic-course' }
|
|
16
|
-
- { path: 'course2/README.md', name: 'advanced-course' }
|
|
17
|
-
- { path: 'course3/README.md', name: 'expert-course' }
|
|
18
|
-
format: ['scorm1.2', 'pdf', 'web']
|
|
19
|
-
|
|
20
|
-
steps:
|
|
21
|
-
- name: Checkout repository
|
|
22
|
-
uses: actions/checkout@v4
|
|
23
|
-
|
|
24
|
-
- name: Export ${{ matrix.course.name }} to ${{ matrix.format }}
|
|
25
|
-
id: export
|
|
26
|
-
uses: LiaScript/LiaScript-Exporter@master
|
|
27
|
-
with:
|
|
28
|
-
input-file: ${{ matrix.course.path }}
|
|
29
|
-
format: ${{ matrix.format }}
|
|
30
|
-
output-name: '${{ matrix.course.name }}-${{ matrix.format }}'
|
|
31
|
-
scorm-organization: 'LiaScript Courses'
|
|
32
|
-
pdf-theme: 'default'
|
|
33
|
-
web-zip: true
|
|
34
|
-
|
|
35
|
-
- name: Upload ${{ matrix.course.name }}-${{ matrix.format }}
|
|
36
|
-
uses: actions/upload-artifact@v4
|
|
37
|
-
with:
|
|
38
|
-
name: ${{ matrix.course.name }}-${{ matrix.format }}
|
|
39
|
-
path: ${{ steps.export.outputs.output-file }}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
name: Export Single Course
|
|
2
|
-
on:
|
|
3
|
-
workflow_dispatch:
|
|
4
|
-
inputs:
|
|
5
|
-
format:
|
|
6
|
-
description: 'Export format'
|
|
7
|
-
required: true
|
|
8
|
-
default: 'scorm1.2'
|
|
9
|
-
type: choice
|
|
10
|
-
options:
|
|
11
|
-
- scorm1.2
|
|
12
|
-
- scorm2004
|
|
13
|
-
- pdf
|
|
14
|
-
- web
|
|
15
|
-
- ims
|
|
16
|
-
- xapi
|
|
17
|
-
- rdf
|
|
18
|
-
|
|
19
|
-
jobs:
|
|
20
|
-
export:
|
|
21
|
-
runs-on: ubuntu-latest
|
|
22
|
-
|
|
23
|
-
steps:
|
|
24
|
-
- name: Checkout repository
|
|
25
|
-
uses: actions/checkout@v4
|
|
26
|
-
|
|
27
|
-
- name: Export course to ${{ inputs.format }}
|
|
28
|
-
id: export
|
|
29
|
-
uses: LiaScript/LiaScript-Exporter@master
|
|
30
|
-
with:
|
|
31
|
-
input-file: 'README.md'
|
|
32
|
-
format: ${{ inputs.format }}
|
|
33
|
-
output-name: 'my-course'
|
|
34
|
-
scorm-organization: 'My Organization'
|
|
35
|
-
pdf-format: 'A4'
|
|
36
|
-
web-zip: true
|
|
37
|
-
|
|
38
|
-
- name: Upload exported course
|
|
39
|
-
uses: actions/upload-artifact@v4
|
|
40
|
-
with:
|
|
41
|
-
name: course-${{ inputs.format }}
|
|
42
|
-
path: ${{ steps.export.outputs.output-file }}
|