@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/action.js
DELETED
|
@@ -1,293 +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.run = void 0;
|
|
27
|
-
const core = __importStar(require("@actions/core"));
|
|
28
|
-
const path = __importStar(require("path"));
|
|
29
|
-
const inputs_1 = require("./inputs");
|
|
30
|
-
const utils_1 = require("./utils");
|
|
31
|
-
/**
|
|
32
|
-
* Main action execution function
|
|
33
|
-
*/
|
|
34
|
-
async function run() {
|
|
35
|
-
try {
|
|
36
|
-
core.info('Starting LiaScript Exporter Action');
|
|
37
|
-
// Parse and validate inputs
|
|
38
|
-
core.startGroup('Parsing inputs');
|
|
39
|
-
let args = (0, inputs_1.parseInputs)();
|
|
40
|
-
(0, inputs_1.logInputs)(args);
|
|
41
|
-
(0, inputs_1.validateInputs)(args);
|
|
42
|
-
core.endGroup();
|
|
43
|
-
// Generate output name if not specified
|
|
44
|
-
if (args.output === 'output') {
|
|
45
|
-
args.output = (0, utils_1.generateOutputName)(args);
|
|
46
|
-
core.info(`Generated output name: ${args.output}`);
|
|
47
|
-
}
|
|
48
|
-
// Resolve file paths
|
|
49
|
-
core.startGroup('Resolving paths');
|
|
50
|
-
args = (0, utils_1.resolvePaths)(args);
|
|
51
|
-
core.info(`Resolved input file: ${args.input}`);
|
|
52
|
-
core.info(`Resolved course path: ${args.path || 'not set'}`);
|
|
53
|
-
core.info(`Resolved readme path: ${args.readme}`);
|
|
54
|
-
(0, utils_1.validateFiles)(args);
|
|
55
|
-
core.endGroup();
|
|
56
|
-
// Ensure output directory exists
|
|
57
|
-
(0, utils_1.ensureOutputDirectory)();
|
|
58
|
-
// Install CLI dependencies
|
|
59
|
-
core.startGroup('Installing CLI dependencies');
|
|
60
|
-
const dependenciesInstalled = await installCliDependencies();
|
|
61
|
-
core.endGroup();
|
|
62
|
-
if (!dependenciesInstalled) {
|
|
63
|
-
core.setFailed('Failed to install CLI dependencies');
|
|
64
|
-
core.setOutput('success', 'false');
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
// Execute the export
|
|
68
|
-
core.startGroup(`Exporting to ${args.format}`);
|
|
69
|
-
const success = await executeExport(args);
|
|
70
|
-
core.endGroup();
|
|
71
|
-
if (success) {
|
|
72
|
-
// Find and set outputs
|
|
73
|
-
const outputFiles = (0, utils_1.findOutputFiles)(args);
|
|
74
|
-
if (outputFiles.length > 0) {
|
|
75
|
-
const primaryOutputFile = outputFiles[0];
|
|
76
|
-
const fileSize = (0, utils_1.getFileSize)(primaryOutputFile);
|
|
77
|
-
core.setOutput('output-file', primaryOutputFile);
|
|
78
|
-
core.setOutput('file-size', fileSize.toString());
|
|
79
|
-
core.setOutput('format', args.format);
|
|
80
|
-
core.setOutput('success', 'true');
|
|
81
|
-
core.info(`Successfully exported to: ${primaryOutputFile}`);
|
|
82
|
-
core.info(`File size: ${fileSize} bytes`);
|
|
83
|
-
if (outputFiles.length > 1) {
|
|
84
|
-
core.info(`Additional files generated: ${outputFiles.slice(1).join(', ')}`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
core.setFailed('Export completed but no output files found');
|
|
89
|
-
core.setOutput('success', 'false');
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
core.setFailed('Export failed');
|
|
94
|
-
core.setOutput('success', 'false');
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
99
|
-
core.setFailed(`Action failed: ${errorMessage}`);
|
|
100
|
-
core.setOutput('success', 'false');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
exports.run = run;
|
|
104
|
-
/**
|
|
105
|
-
* Install CLI dependencies in the main directory
|
|
106
|
-
*/
|
|
107
|
-
async function installCliDependencies() {
|
|
108
|
-
try {
|
|
109
|
-
const mainDir = path.resolve(__dirname, '../../');
|
|
110
|
-
const nodeModulesPath = path.join(mainDir, 'node_modules');
|
|
111
|
-
// Check if node_modules already exists and has content
|
|
112
|
-
try {
|
|
113
|
-
const fs = require('fs');
|
|
114
|
-
const nodeModulesExists = fs.existsSync(nodeModulesPath);
|
|
115
|
-
if (nodeModulesExists) {
|
|
116
|
-
const nodeModulesStats = fs.readdirSync(nodeModulesPath);
|
|
117
|
-
if (nodeModulesStats.length > 0) {
|
|
118
|
-
core.info(`Dependencies already installed in ${nodeModulesPath} (${nodeModulesStats.length} packages found)`);
|
|
119
|
-
return true;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
catch (checkError) {
|
|
124
|
-
core.info('Could not check existing node_modules, proceeding with installation');
|
|
125
|
-
}
|
|
126
|
-
core.info(`Installing CLI dependencies in: ${mainDir}`);
|
|
127
|
-
const { spawn } = require('child_process');
|
|
128
|
-
return new Promise((resolve, reject) => {
|
|
129
|
-
const child = spawn('npm', ['install', '--omit=dev', '--no-audit', '--no-fund'], {
|
|
130
|
-
cwd: mainDir,
|
|
131
|
-
stdio: ['pipe', 'pipe', 'pipe']
|
|
132
|
-
});
|
|
133
|
-
let stdout = '';
|
|
134
|
-
let stderr = '';
|
|
135
|
-
child.stdout?.on('data', (data) => {
|
|
136
|
-
const output = data.toString();
|
|
137
|
-
stdout += output;
|
|
138
|
-
// Log npm install progress
|
|
139
|
-
core.info(`npm install: ${output.trim()}`);
|
|
140
|
-
});
|
|
141
|
-
child.stderr?.on('data', (data) => {
|
|
142
|
-
const output = data.toString();
|
|
143
|
-
stderr += output;
|
|
144
|
-
// npm often sends normal output to stderr, so treat it as info unless it's clearly an error
|
|
145
|
-
if (output.toLowerCase().includes('error')) {
|
|
146
|
-
core.error(`npm install error: ${output.trim()}`);
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
core.info(`npm install: ${output.trim()}`);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
child.on('close', (code) => {
|
|
153
|
-
if (code === 0) {
|
|
154
|
-
core.info('CLI dependencies installed successfully');
|
|
155
|
-
resolve(true);
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
core.error(`npm install exited with code ${code}`);
|
|
159
|
-
if (stderr) {
|
|
160
|
-
core.error(`npm install error output: ${stderr}`);
|
|
161
|
-
}
|
|
162
|
-
resolve(false);
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
child.on('error', (error) => {
|
|
166
|
-
core.error(`Failed to run npm install: ${error.message}`);
|
|
167
|
-
reject(error);
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
catch (error) {
|
|
172
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
173
|
-
core.error(`Failed to install CLI dependencies: ${errorMessage}`);
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Execute the LiaScript export using the local CLI
|
|
179
|
-
*/
|
|
180
|
-
async function executeExport(args) {
|
|
181
|
-
try {
|
|
182
|
-
// Use the local CLI from this repository
|
|
183
|
-
const cliPath = path.resolve(__dirname, '../../dist/index.js');
|
|
184
|
-
core.info(`Using local CLI from: ${cliPath}`);
|
|
185
|
-
// Verify CLI exists
|
|
186
|
-
if (!require('fs').existsSync(cliPath)) {
|
|
187
|
-
throw new Error(`CLI not found at ${cliPath}. Please run 'npm run build' in the main directory first.`);
|
|
188
|
-
}
|
|
189
|
-
// Build command arguments for the local CLI
|
|
190
|
-
const cliArgs = buildCliArguments(args);
|
|
191
|
-
core.info(`CLI command: node ${path.basename(cliPath)} [${cliArgs.length} arguments]`);
|
|
192
|
-
// Execute the local CLI using spawn
|
|
193
|
-
const { spawn } = require('child_process');
|
|
194
|
-
return new Promise((resolve, reject) => {
|
|
195
|
-
const child = spawn('node', [cliPath, ...cliArgs], {
|
|
196
|
-
stdio: ['pipe', 'pipe', 'pipe']
|
|
197
|
-
});
|
|
198
|
-
let stdout = '';
|
|
199
|
-
let stderr = '';
|
|
200
|
-
child.stdout?.on('data', (data) => {
|
|
201
|
-
const output = data.toString();
|
|
202
|
-
stdout += output;
|
|
203
|
-
core.info(output.trim());
|
|
204
|
-
});
|
|
205
|
-
child.stderr?.on('data', (data) => {
|
|
206
|
-
const output = data.toString();
|
|
207
|
-
stderr += output;
|
|
208
|
-
// Filter out known benign messages
|
|
209
|
-
const trimmedOutput = output.trim();
|
|
210
|
-
if (!trimmedOutput)
|
|
211
|
-
return; // Skip empty lines
|
|
212
|
-
// Filter out "Error: null" and "null" messages from temporary directories (CLI internal, not actual errors)
|
|
213
|
-
if (trimmedOutput.startsWith('Error: null /tmp/lia') ||
|
|
214
|
-
trimmedOutput.startsWith('null /tmp/lia') ||
|
|
215
|
-
trimmedOutput.startsWith('Error: null /var/folders') ||
|
|
216
|
-
trimmedOutput.startsWith('null /var/folders')) {
|
|
217
|
-
core.info(`CLI temp: ${trimmedOutput}`);
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
// Log warnings and debug info, but don't treat as errors
|
|
221
|
-
if (output.toLowerCase().includes('warn')) {
|
|
222
|
-
core.warning(trimmedOutput);
|
|
223
|
-
}
|
|
224
|
-
else if (output.toLowerCase().includes('debug')) {
|
|
225
|
-
core.info(`DEBUG: ${trimmedOutput}`);
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
core.error(trimmedOutput);
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
child.on('close', (code) => {
|
|
232
|
-
if (code === 0) {
|
|
233
|
-
core.info('CLI execution completed successfully');
|
|
234
|
-
resolve(true);
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
core.error(`CLI exited with code ${code}`);
|
|
238
|
-
if (stderr) {
|
|
239
|
-
core.error(`Error output: ${stderr}`);
|
|
240
|
-
}
|
|
241
|
-
resolve(false);
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
child.on('error', (error) => {
|
|
245
|
-
core.error(`Failed to spawn CLI process: ${error.message}`);
|
|
246
|
-
reject(error);
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
catch (error) {
|
|
251
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
252
|
-
core.error(`Export execution failed: ${errorMessage}`);
|
|
253
|
-
return false;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Convert action arguments to CLI arguments
|
|
258
|
-
*/
|
|
259
|
-
function buildCliArguments(args) {
|
|
260
|
-
const cliArgs = [];
|
|
261
|
-
// Core arguments
|
|
262
|
-
cliArgs.push('--input', args.input);
|
|
263
|
-
cliArgs.push('--format', args.format);
|
|
264
|
-
cliArgs.push('--output', args.output);
|
|
265
|
-
if (args.path) {
|
|
266
|
-
cliArgs.push('--path', args.path);
|
|
267
|
-
}
|
|
268
|
-
if (args.style) {
|
|
269
|
-
cliArgs.push('--style', args.style);
|
|
270
|
-
}
|
|
271
|
-
if (args.key) {
|
|
272
|
-
cliArgs.push('--key', args.key);
|
|
273
|
-
}
|
|
274
|
-
// Add format-specific arguments
|
|
275
|
-
Object.entries(args).forEach(([key, value]) => {
|
|
276
|
-
if (key.includes('-') && value !== undefined && value !== false && value !== '') {
|
|
277
|
-
if (typeof value === 'boolean' && value === true) {
|
|
278
|
-
cliArgs.push(`--${key}`);
|
|
279
|
-
}
|
|
280
|
-
else if (typeof value === 'string' || typeof value === 'number') {
|
|
281
|
-
cliArgs.push(`--${key}`, String(value));
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
return cliArgs;
|
|
286
|
-
}
|
|
287
|
-
// Run the action if this file is executed directly
|
|
288
|
-
if (require.main === module) {
|
|
289
|
-
run().catch(error => {
|
|
290
|
-
core.setFailed(error.message);
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
//# sourceMappingURL=action.js.map
|