@annoto/widget-api 3.60.0-alpha.1 → 3.64.0-alpha.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.
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const yargs = require('yargs/yargs');
5
+ const { hideBin } = require('yargs/helpers');
6
+
7
+ /**
8
+ * Execute multiple commands in sequence
9
+ * @param {string[]} commands - Array of commands to execute
10
+ * @param {string} description - Description of the overall operation
11
+ */
12
+ function executeCommands(commands, description) {
13
+ console.log(`\nšŸ“š ${description}`);
14
+
15
+ for (const command of commands) {
16
+ console.log(`Executing: ${command}`);
17
+ try {
18
+ execSync(command, {
19
+ stdio: 'inherit',
20
+ cwd: process.cwd(),
21
+ });
22
+ } catch (error) {
23
+ console.error(`āŒ ${description} failed at command: ${command}`);
24
+ process.exit(1);
25
+ }
26
+ }
27
+ console.log(`āœ… ${description} completed successfully\n`);
28
+ }
29
+
30
+ /**
31
+ * Documentation commands
32
+ */
33
+ const docCommands = {
34
+ html() {
35
+ executeCommands(
36
+ ['npx rimraf docs', 'typedoc lib/ --theme default --watch'],
37
+ 'Generate HTML documentation for preview using typedoc and open the result in a browser.'
38
+ );
39
+ },
40
+
41
+ publish() {
42
+ executeCommands(
43
+ ['npx rimraf docs', 'typedoc lib/ --theme default', 'node scripts/ghpages.js'],
44
+ 'Generating HTML documentation using typedoc and publishing to GitHub pages'
45
+ );
46
+ },
47
+
48
+ json() {
49
+ executeCommands(
50
+ ['npm run build', 'rimraf docs', 'typedoc lib/ --json docs/typedoc.json'],
51
+ 'Generating JSON documentation using typedoc'
52
+ );
53
+ },
54
+ };
55
+
56
+ // Yargs configuration
57
+ const argv = yargs(hideBin(process.argv))
58
+ .usage('Usage: $0 <command>')
59
+ .command('html', 'Generate HTML documentation for preview using typedoc', {}, () =>
60
+ docCommands.html()
61
+ )
62
+ .command('publish', 'Generate HTML documentation and publish to GitHub pages', {}, () =>
63
+ docCommands.publish()
64
+ )
65
+ .command('json', 'Generate JSON documentation using typedoc', {}, () => docCommands.json())
66
+ .demandCommand(1, 'You need to specify a command')
67
+ .help('h')
68
+ .alias('h', 'help')
69
+ .example('$0 html', 'Generate HTML documentation')
70
+ .example('$0 publish', 'Publish documentation to GitHub pages')
71
+ .example('$0 json', 'Generate JSON documentation').argv;
@@ -0,0 +1,14 @@
1
+ const ghpages = require('gh-pages');
2
+
3
+
4
+ const repo = 'https://github.com/Annoto/widget-api.git';
5
+
6
+ ghpages.publish('docs', {
7
+ repo,
8
+ }, (err) => {
9
+ if (err) {
10
+ return console.error(err);
11
+ }
12
+
13
+ console.log('gh-pages: published to ', repo);
14
+ });
package/.eslintrc.js DELETED
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- extends: '../../.eslintrc.js',
3
- env: {
4
- browser: true,
5
- },
6
- parserOptions: {
7
- project: 'tsconfig.json',
8
- sourceType: 'module',
9
- },
10
- };