stage-browser 0.0.0-stage → 0.1.1

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.
Files changed (154) hide show
  1. package/README.md +136 -2
  2. package/build/icon.icns +0 -0
  3. package/build/icon.png +0 -0
  4. package/dist/bin/stage.js +111 -0
  5. package/dist/main/cli-args.js +28 -0
  6. package/dist/main/context-menu.js +68 -0
  7. package/dist/main/context.js +2 -0
  8. package/dist/main/extensions.js +78 -0
  9. package/dist/main/ipc.js +90 -0
  10. package/dist/main/main.js +279 -0
  11. package/dist/main/menu.js +140 -0
  12. package/dist/main/reveal.js +155 -0
  13. package/dist/main/selftest.js +490 -0
  14. package/dist/main/store.js +85 -0
  15. package/dist/main/suggest.js +43 -0
  16. package/dist/main/tabs.js +324 -0
  17. package/dist/main/url.js +38 -0
  18. package/dist/main/window.js +68 -0
  19. package/dist/preload/extension-compat.js +163 -0
  20. package/dist/preload/ui-preload.js +33 -0
  21. package/dist/shared/contract.js +6 -0
  22. package/dist/ui/app.js +653 -0
  23. package/dist/ui/index.html +41 -0
  24. package/dist/ui/mock.js +479 -0
  25. package/dist/ui/newtab.html +69 -0
  26. package/dist/ui/styles.css +410 -0
  27. package/node_modules/@types/chrome/LICENSE +21 -0
  28. package/node_modules/@types/chrome/README.md +15 -0
  29. package/node_modules/@types/chrome/chrome-cast/index.d.ts +1156 -0
  30. package/node_modules/@types/chrome/har-format/index.d.ts +6 -0
  31. package/node_modules/@types/chrome/index.d.ts +13786 -0
  32. package/node_modules/@types/chrome/package.json +99 -0
  33. package/node_modules/@types/filesystem/LICENSE +21 -0
  34. package/node_modules/@types/filesystem/README.md +15 -0
  35. package/node_modules/@types/filesystem/index.d.ts +564 -0
  36. package/node_modules/@types/filesystem/package.json +26 -0
  37. package/node_modules/@types/filewriter/LICENSE +21 -0
  38. package/node_modules/@types/filewriter/README.md +15 -0
  39. package/node_modules/@types/filewriter/index.d.ts +166 -0
  40. package/node_modules/@types/filewriter/package.json +25 -0
  41. package/node_modules/@types/har-format/LICENSE +21 -0
  42. package/node_modules/@types/har-format/README.md +15 -0
  43. package/node_modules/@types/har-format/index.d.ts +938 -0
  44. package/node_modules/@types/har-format/package.json +31 -0
  45. package/node_modules/adm-zip/LICENSE +21 -0
  46. package/node_modules/adm-zip/README.md +90 -0
  47. package/node_modules/adm-zip/adm-zip.js +1020 -0
  48. package/node_modules/adm-zip/headers/entryHeader.js +396 -0
  49. package/node_modules/adm-zip/headers/index.js +2 -0
  50. package/node_modules/adm-zip/headers/mainHeader.js +177 -0
  51. package/node_modules/adm-zip/methods/deflater.js +33 -0
  52. package/node_modules/adm-zip/methods/index.js +3 -0
  53. package/node_modules/adm-zip/methods/inflater.js +64 -0
  54. package/node_modules/adm-zip/methods/zipcrypto.js +175 -0
  55. package/node_modules/adm-zip/package.json +56 -0
  56. package/node_modules/adm-zip/types.d.ts +223 -0
  57. package/node_modules/adm-zip/util/constants.js +142 -0
  58. package/node_modules/adm-zip/util/decoder.js +5 -0
  59. package/node_modules/adm-zip/util/errors.js +66 -0
  60. package/node_modules/adm-zip/util/fattr.js +76 -0
  61. package/node_modules/adm-zip/util/index.js +5 -0
  62. package/node_modules/adm-zip/util/utils.js +481 -0
  63. package/node_modules/adm-zip/zipEntry.js +415 -0
  64. package/node_modules/adm-zip/zipFile.js +466 -0
  65. package/node_modules/debug/LICENSE +20 -0
  66. package/node_modules/debug/README.md +481 -0
  67. package/node_modules/debug/package.json +64 -0
  68. package/node_modules/debug/src/browser.js +272 -0
  69. package/node_modules/debug/src/common.js +292 -0
  70. package/node_modules/debug/src/index.js +10 -0
  71. package/node_modules/debug/src/node.js +263 -0
  72. package/node_modules/electron-chrome-web-store/README.md +143 -0
  73. package/node_modules/electron-chrome-web-store/dist/chrome-web-store.preload.js +299 -0
  74. package/node_modules/electron-chrome-web-store/dist/cjs/browser/index.js +1674 -0
  75. package/node_modules/electron-chrome-web-store/dist/esm/browser/index.mjs +950 -0
  76. package/node_modules/electron-chrome-web-store/dist/types/browser/api.d.ts +2 -0
  77. package/node_modules/electron-chrome-web-store/dist/types/browser/crx3.d.ts +20 -0
  78. package/node_modules/electron-chrome-web-store/dist/types/browser/id.d.ts +9 -0
  79. package/node_modules/electron-chrome-web-store/dist/types/browser/index.d.ts +62 -0
  80. package/node_modules/electron-chrome-web-store/dist/types/browser/installer.d.ts +29 -0
  81. package/node_modules/electron-chrome-web-store/dist/types/browser/loader.d.ts +18 -0
  82. package/node_modules/electron-chrome-web-store/dist/types/browser/types.d.ts +21 -0
  83. package/node_modules/electron-chrome-web-store/dist/types/browser/updater.d.ts +6 -0
  84. package/node_modules/electron-chrome-web-store/dist/types/browser/utils.d.ts +4 -0
  85. package/node_modules/electron-chrome-web-store/dist/types/common/constants.d.ts +44 -0
  86. package/node_modules/electron-chrome-web-store/dist/types/renderer/chrome-web-store.preload.d.ts +1 -0
  87. package/node_modules/electron-chrome-web-store/package.json +43 -0
  88. package/node_modules/ms/index.js +162 -0
  89. package/node_modules/ms/license.md +21 -0
  90. package/node_modules/ms/package.json +38 -0
  91. package/node_modules/ms/readme.md +59 -0
  92. package/node_modules/pbf/LICENSE +27 -0
  93. package/node_modules/pbf/README.md +293 -0
  94. package/node_modules/pbf/bin/pbf +17 -0
  95. package/node_modules/pbf/compile.js +441 -0
  96. package/node_modules/pbf/dist/pbf-dev.js +838 -0
  97. package/node_modules/pbf/dist/pbf.js +1 -0
  98. package/node_modules/pbf/index.d.ts +206 -0
  99. package/node_modules/pbf/index.js +830 -0
  100. package/node_modules/pbf/package.json +63 -0
  101. package/node_modules/protocol-buffers-schema/.travis.yml +7 -0
  102. package/node_modules/protocol-buffers-schema/LICENSE +21 -0
  103. package/node_modules/protocol-buffers-schema/README.md +122 -0
  104. package/node_modules/protocol-buffers-schema/example.js +11 -0
  105. package/node_modules/protocol-buffers-schema/example.proto +13 -0
  106. package/node_modules/protocol-buffers-schema/index.js +6 -0
  107. package/node_modules/protocol-buffers-schema/package.json +31 -0
  108. package/node_modules/protocol-buffers-schema/parse.js +769 -0
  109. package/node_modules/protocol-buffers-schema/stringify.js +206 -0
  110. package/node_modules/protocol-buffers-schema/test/fixtures/basic.json +90 -0
  111. package/node_modules/protocol-buffers-schema/test/fixtures/basic.proto +11 -0
  112. package/node_modules/protocol-buffers-schema/test/fixtures/comments.json +99 -0
  113. package/node_modules/protocol-buffers-schema/test/fixtures/comments.proto +19 -0
  114. package/node_modules/protocol-buffers-schema/test/fixtures/complex.json +125 -0
  115. package/node_modules/protocol-buffers-schema/test/fixtures/complex.proto +30 -0
  116. package/node_modules/protocol-buffers-schema/test/fixtures/enum.json +42 -0
  117. package/node_modules/protocol-buffers-schema/test/fixtures/enum.proto +8 -0
  118. package/node_modules/protocol-buffers-schema/test/fixtures/escaped-quotes.json +32 -0
  119. package/node_modules/protocol-buffers-schema/test/fixtures/escaped-quotes.proto +3 -0
  120. package/node_modules/protocol-buffers-schema/test/fixtures/extend.json +167 -0
  121. package/node_modules/protocol-buffers-schema/test/fixtures/extend.proto +19 -0
  122. package/node_modules/protocol-buffers-schema/test/fixtures/import.json +30 -0
  123. package/node_modules/protocol-buffers-schema/test/fixtures/import.proto +6 -0
  124. package/node_modules/protocol-buffers-schema/test/fixtures/map.json +33 -0
  125. package/node_modules/protocol-buffers-schema/test/fixtures/map.proto +3 -0
  126. package/node_modules/protocol-buffers-schema/test/fixtures/no-tags.proto +8 -0
  127. package/node_modules/protocol-buffers-schema/test/fixtures/oneof.json +41 -0
  128. package/node_modules/protocol-buffers-schema/test/fixtures/oneof.proto +6 -0
  129. package/node_modules/protocol-buffers-schema/test/fixtures/option.json +364 -0
  130. package/node_modules/protocol-buffers-schema/test/fixtures/option.proto +72 -0
  131. package/node_modules/protocol-buffers-schema/test/fixtures/options.json +47 -0
  132. package/node_modules/protocol-buffers-schema/test/fixtures/options.proto +8 -0
  133. package/node_modules/protocol-buffers-schema/test/fixtures/pheromon-trajectories.proto +8 -0
  134. package/node_modules/protocol-buffers-schema/test/fixtures/reserved.json +55 -0
  135. package/node_modules/protocol-buffers-schema/test/fixtures/reserved.proto +17 -0
  136. package/node_modules/protocol-buffers-schema/test/fixtures/search.json +30 -0
  137. package/node_modules/protocol-buffers-schema/test/fixtures/search.proto +5 -0
  138. package/node_modules/protocol-buffers-schema/test/fixtures/service.json +108 -0
  139. package/node_modules/protocol-buffers-schema/test/fixtures/service.proto +30 -0
  140. package/node_modules/protocol-buffers-schema/test/fixtures/valid-packed.proto +35 -0
  141. package/node_modules/protocol-buffers-schema/test/fixtures/version.json +90 -0
  142. package/node_modules/protocol-buffers-schema/test/fixtures/version.proto +13 -0
  143. package/node_modules/protocol-buffers-schema/test/index.js +157 -0
  144. package/node_modules/protocol-buffers-schema/tokenize.js +56 -0
  145. package/node_modules/resolve-protobuf-schema/.travis.yml +3 -0
  146. package/node_modules/resolve-protobuf-schema/LICENSE +21 -0
  147. package/node_modules/resolve-protobuf-schema/README.md +49 -0
  148. package/node_modules/resolve-protobuf-schema/index.js +50 -0
  149. package/node_modules/resolve-protobuf-schema/package.json +25 -0
  150. package/node_modules/resolve-protobuf-schema/test/a.proto +5 -0
  151. package/node_modules/resolve-protobuf-schema/test/b.proto +5 -0
  152. package/node_modules/resolve-protobuf-schema/test/c.proto +3 -0
  153. package/node_modules/resolve-protobuf-schema/test/index.js +49 -0
  154. package/package.json +64 -4
@@ -0,0 +1,56 @@
1
+ module.exports = function (sch) {
2
+ var noComments = function (line) {
3
+ var i = line.indexOf('//')
4
+ return i > -1 ? line.slice(0, i) : line
5
+ }
6
+
7
+ var noMultilineComments = function () {
8
+ var inside = false
9
+ return function (token) {
10
+ if (token === '/*') {
11
+ inside = true
12
+ return false
13
+ }
14
+ if (token === '*/') {
15
+ inside = false
16
+ return false
17
+ }
18
+ return !inside
19
+ }
20
+ }
21
+
22
+ var trim = function (line) {
23
+ return line.trim()
24
+ }
25
+
26
+ var removeQuotedLines = function (list) {
27
+ return function (str) {
28
+ var s = '$' + list.length + '$'
29
+ list.push(str)
30
+ return s
31
+ }
32
+ }
33
+
34
+ var restoreQuotedLines = function (list) {
35
+ var re = /^\$(\d+)\$$/
36
+ return function (line) {
37
+ var m = line.match(re)
38
+ return m ? list[+m[1]] : line
39
+ }
40
+ }
41
+
42
+ var replacements = []
43
+ return sch
44
+ .replace(/"(\\"|[^"\n])*?"|'(\\'|[^'\n])*?'/gm, removeQuotedLines(replacements))
45
+ .replace(/([;,{}()=:[\]<>]|\/\*|\*\/)/g, ' $1 ')
46
+ .split(/\n/)
47
+ .map(trim)
48
+ .filter(Boolean)
49
+ .map(noComments)
50
+ .map(trim)
51
+ .filter(Boolean)
52
+ .join('\n')
53
+ .split(/\s+|\n+/gm)
54
+ .filter(noMultilineComments())
55
+ .map(restoreQuotedLines(replacements))
56
+ }
@@ -0,0 +1,3 @@
1
+ language: node_js
2
+ node_js:
3
+ - "0.10"
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Mathias Buus
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,49 @@
1
+ # resolve-protobuf-schema
2
+
3
+ Read a protobuf schema from the disk, parse it and resolve all imports
4
+
5
+ ```
6
+ npm install resolve-protobuf-schema
7
+ ```
8
+
9
+ [![build status](http://img.shields.io/travis/mafintosh/resolve-protobuf-schema.svg?style=flat)](http://travis-ci.org/mafintosh/resolve-protobuf-schema)
10
+
11
+ ## Usage
12
+
13
+ Store the following example protobuf schema in `test.proto`
14
+
15
+ ```
16
+ message Test {
17
+ optional string test = 1;
18
+ }
19
+ ```
20
+
21
+ Then run
22
+
23
+ ``` js
24
+ var resolve = require('resolve-protobuf-schema')
25
+ console.log(resolve.sync('test.proto')) // prints the parsed schema
26
+ ```
27
+
28
+ Schema imports will resolved as well
29
+
30
+ ```
31
+ import "./test.proto"
32
+
33
+ message AnotherTest {
34
+ optional string test = 1;
35
+ }
36
+ ```
37
+
38
+ ``` js
39
+ console.log(resolve.sync('./another-test.proto')) // will print a combined parsed schema
40
+ ```
41
+
42
+ ## API
43
+
44
+ * `resolve(path, cb)` read and resolve a schema
45
+ * `resolve.sync(path)` sync version of `resolve`
46
+
47
+ ## License
48
+
49
+ MIT
@@ -0,0 +1,50 @@
1
+ var schema = require('protocol-buffers-schema')
2
+ var fs = require('fs')
3
+ var path = require('path')
4
+
5
+ var merge = function(a, b) {
6
+ a.messages = a.messages.concat(b.messages)
7
+ a.enums = a.enums.concat(b.enums)
8
+ return a
9
+ }
10
+
11
+ var readSync = function(filename) {
12
+ if (!/\.proto$/i.test(filename) && !fs.existsSync(filename)) filename += '.proto'
13
+
14
+ var sch = schema(fs.readFileSync(filename, 'utf-8'))
15
+ var imports = [].concat(sch.imports || [])
16
+
17
+ imports.forEach(function(i) {
18
+ sch = merge(sch, readSync(path.resolve(path.dirname(filename), i)))
19
+ })
20
+
21
+ return sch
22
+ }
23
+
24
+ var read = function(filename, cb) {
25
+ fs.exists(filename, function(exists) {
26
+ if (!exists && !/\.proto$/i.test(filename)) filename += '.proto'
27
+
28
+ fs.readFile(filename, 'utf-8', function(err, proto) {
29
+ if (err) return cb(err)
30
+
31
+ var sch = schema(proto)
32
+ var imports = [].concat(sch.imports || [])
33
+
34
+ var loop = function() {
35
+ if (!imports.length) return cb(null, sch)
36
+
37
+ read(path.resolve(path.dirname(filename), imports.shift()), function(err, ch) {
38
+ if (err) return cb(err)
39
+ sch = merge(sch, ch)
40
+ loop()
41
+ })
42
+ }
43
+
44
+ loop()
45
+ })
46
+ })
47
+ }
48
+
49
+ module.exports = read
50
+ module.exports.sync = readSync
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "resolve-protobuf-schema",
3
+ "version": "2.1.0",
4
+ "description": "Read a protobuf schema from the disk, parse it and resolve all imports",
5
+ "main": "index.js",
6
+ "dependencies": {
7
+ "protocol-buffers-schema": "^3.3.1"
8
+ },
9
+ "devDependencies": {
10
+ "tape": "^3.0.0"
11
+ },
12
+ "scripts": {
13
+ "test": "tape test/index.js"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/mafintosh/resolve-protobuf-schema.git"
18
+ },
19
+ "author": "Mathias Buus (@mafintosh)",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/mafintosh/resolve-protobuf-schema/issues"
23
+ },
24
+ "homepage": "https://github.com/mafintosh/resolve-protobuf-schema"
25
+ }
@@ -0,0 +1,5 @@
1
+ import "./b.proto";
2
+
3
+ message A {
4
+ optional string a = 1;
5
+ }
@@ -0,0 +1,5 @@
1
+ import "./c.proto";
2
+
3
+ message B {
4
+ optional string b = 1;
5
+ }
@@ -0,0 +1,3 @@
1
+ message C {
2
+ optional string c = 1;
3
+ }
@@ -0,0 +1,49 @@
1
+ var tape = require('tape')
2
+ var schema = require('../')
3
+
4
+ var test = function(name, fn) {
5
+ tape(name, function(t) {
6
+ fn(t, schema)
7
+ })
8
+ tape(name+' sync', function(t) {
9
+ fn(t, function(name, cb) {
10
+ cb(null, schema.sync(name))
11
+ })
12
+ })
13
+ }
14
+
15
+ test('c', function(t, schema) {
16
+ schema(__dirname+'/c.proto', function(err, sch) {
17
+ t.notOk(err, 'no err')
18
+ t.same(sch.messages.length, 1)
19
+ schema(__dirname+'/c', function(err, sch) {
20
+ t.notOk(err, 'no err')
21
+ t.same(sch.messages.length, 1)
22
+ t.end()
23
+ })
24
+ })
25
+ })
26
+
27
+ test('b imports c', function(t, schema) {
28
+ schema(__dirname+'/b.proto', function(err, sch) {
29
+ t.notOk(err, 'no err')
30
+ t.same(sch.messages.length, 2)
31
+ schema(__dirname+'/b', function(err, sch) {
32
+ t.notOk(err, 'no err')
33
+ t.same(sch.messages.length, 2)
34
+ t.end()
35
+ })
36
+ })
37
+ })
38
+
39
+ test('a imports b imports c', function(t, schema) {
40
+ schema(__dirname+'/a.proto', function(err, sch) {
41
+ t.notOk(err, 'no err')
42
+ t.same(sch.messages.length, 3)
43
+ schema(__dirname+'/a', function(err, sch) {
44
+ t.notOk(err, 'no err')
45
+ t.same(sch.messages.length, 3)
46
+ t.end()
47
+ })
48
+ })
49
+ })
package/package.json CHANGED
@@ -1,6 +1,66 @@
1
1
  {
2
2
  "name": "stage-browser",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "productName": "Stage",
4
+ "version": "0.1.1",
5
+ "description": "A minimal Chromium browser for screen sharing: the page fills the window, tabs hide until you reach for them.",
6
+ "main": "dist/main/main.js",
7
+ "scripts": {
8
+ "build": "rm -rf dist && tsc && cp src/ui/*.html src/ui/*.css dist/ui/ && chmod +x dist/bin/stage.js",
9
+ "typecheck": "tsc --noEmit && tsc -p scripts",
10
+ "prepare": "npm run build",
11
+ "start": "npm run build && electron .",
12
+ "selftest": "npm run build && STAGE_SELFTEST=1 electron .",
13
+ "ui:preview": "npm run build && node scripts/ui-preview.mts",
14
+ "cli:install": "sh scripts/install-cli.sh",
15
+ "lint": "oxlint --deny-warnings",
16
+ "lint:fix": "oxlint --fix"
17
+ },
18
+ "dependencies": {
19
+ "electron": "^45.4.1",
20
+ "electron-chrome-extensions": "^4.10.0",
21
+ "electron-chrome-web-store": "^0.13.0"
22
+ },
23
+ "bin": {
24
+ "stage": "dist/bin/stage.js"
25
+ },
26
+ "files": [
27
+ "dist/",
28
+ "build/icon.png",
29
+ "build/icon.icns",
30
+ "README.md"
31
+ ],
32
+ "os": [
33
+ "darwin"
34
+ ],
35
+ "engines": {
36
+ "node": ">=22"
37
+ },
38
+ "keywords": [
39
+ "browser",
40
+ "electron",
41
+ "chromium",
42
+ "screen-sharing",
43
+ "presentation",
44
+ "demo"
45
+ ],
46
+ "license": "MIT",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/andrewckor/stage-browser.git"
50
+ },
51
+ "homepage": "https://github.com/andrewckor/stage-browser#readme",
52
+ "bugs": {
53
+ "url": "https://github.com/andrewckor/stage-browser/issues"
54
+ },
55
+ "devDependencies": {
56
+ "@types/node": "^24.19.2",
57
+ "oxlint": "^1.94.0",
58
+ "typescript": "^7.0.2"
59
+ },
60
+ "overrides": {
61
+ "adm-zip": "^0.6.1"
62
+ },
63
+ "bundleDependencies": [
64
+ "electron-chrome-web-store"
65
+ ]
66
+ }