gritty 7.2.0 → 8.0.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/ChangeLog CHANGED
@@ -1,3 +1,16 @@
1
+ 2024.03.12, v8.0.0
2
+
3
+ feature:
4
+ - f1b8576 gritty: drop support of node < 18
5
+ - 6c1356c gritty: madrun v10.0.1
6
+ - 0b9fb47 gritty: css-minimizer-webpack-plugin v6.0.0
7
+ - 7475087 gritty: supertape v10.4.0
8
+ - 3d8ca38 gritty: eslint-plugin-putout v22.4.1
9
+ - 5b36dc7 gritty: putout v35.7.3
10
+ - edddf41 gritty: xterm-addon-webgl v0.16.0
11
+ - 4d813b6 gritty: xterm-addon-fit v0.8.0
12
+ - 8b8aef7 gritty: c8 v9.1.0
13
+
1
14
  2023.08.07, v7.2.0
2
15
 
3
16
  feature:
package/README.md CHANGED
@@ -55,9 +55,9 @@ Start `gritty`, and go to url `http://localhost:1337`
55
55
  #### gritty(element [, options])
56
56
 
57
57
  ```js
58
- const prefix = '/gritty'; // default
58
+ const prefix = '/gritty';
59
59
  const env = {}; // default
60
- const fontFamily = 'Courier'; // default
60
+ const fontFamily = 'Courier';
61
61
 
62
62
  gritty('body', {
63
63
  prefix,
@@ -73,7 +73,7 @@ gritty('body', {
73
73
  `Gritty` could be used as middleware:
74
74
 
75
75
  ```js
76
- const prefix = '/gritty'; // default
76
+ const prefix = '/gritty';
77
77
 
78
78
  const auth = (accept, reject) => (username, password) => {
79
79
  accept();
@@ -90,7 +90,7 @@ gritty.listen(socket, {
90
90
  Middleware function:
91
91
 
92
92
  ```js
93
- const prefix = '/gritty'; // default
93
+ const prefix = '/gritty';
94
94
 
95
95
  gritty({
96
96
  prefix,
@@ -107,7 +107,6 @@ And use it this way:
107
107
 
108
108
  ```js
109
109
  // server.js
110
-
111
110
  const gritty = require('gritty');
112
111
  const http = require('http');
113
112
  const express = require('express');
package/bin/gritty.js CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  'use strict';
4
4
 
5
+ const {join} = require('node:path');
6
+ const process = require('node:process');
5
7
  const args = require('yargs-parser')(process.argv.slice(2), {
6
8
  boolean: [
7
9
  'version',
@@ -9,12 +11,8 @@ const args = require('yargs-parser')(process.argv.slice(2), {
9
11
  'auto-restart',
10
12
  'path',
11
13
  ],
12
- number: [
13
- 'port',
14
- ],
15
- string: [
16
- 'command',
17
- ],
14
+ number: ['port'],
15
+ string: ['command'],
18
16
  alias: {
19
17
  help: 'h',
20
18
  version: 'v',
@@ -47,7 +45,6 @@ function main(args) {
47
45
  }
48
46
 
49
47
  function path() {
50
- const {join} = require('path');
51
48
  console.log(join(__dirname, '..'));
52
49
  }
53
50
 
@@ -62,7 +59,7 @@ function start(options) {
62
59
 
63
60
  check(port);
64
61
 
65
- const DIR = __dirname + '/../';
62
+ const DIR = `${__dirname}/../`;
66
63
 
67
64
  const gritty = require('../');
68
65
  const http = require('http');
@@ -73,10 +70,11 @@ function start(options) {
73
70
  const app = express();
74
71
  const server = http.createServer(app);
75
72
 
76
- const ip = process.env.IP /* c9 */
77
- || '0.0.0.0';
73
+ const c9 = process.env.IP;
74
+ const ip = c9 || '0.0.0.0';
78
75
 
79
- app.use(gritty())
76
+ app
77
+ .use(gritty())
80
78
  .use(express.static(DIR));
81
79
 
82
80
  const socket = io(server);
@@ -86,7 +84,8 @@ function start(options) {
86
84
  autoRestart,
87
85
  });
88
86
 
89
- server.listen(port, ip)
87
+ server
88
+ .listen(port, ip)
90
89
  .on('error', squad(exit, getMessage));
91
90
 
92
91
  console.log(`url: http://localhost:${port}`);
@@ -118,4 +117,3 @@ function exit(msg) {
118
117
  console.error(msg);
119
118
  process.exit(-1);
120
119
  }
121
-
package/css/style.css CHANGED
@@ -2,7 +2,8 @@ html {
2
2
  height: 100%;
3
3
  }
4
4
 
5
- body, .gritty {
5
+ body,
6
+ .gritty {
6
7
  height: 100%;
7
8
  margin: 0;
8
9
  }