Skip to content

Commit ff0263d

Browse files
committed
Merge branch 'pre'
2 parents ac35004 + c083af5 commit ff0263d

File tree

159 files changed

+16075
-63930
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+16075
-63930
lines changed

#!inf.json

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
#!/usr/bin/env inf
2+
{
3+
"#": "gi0.PINF.it/core/v0",
4+
5+
"#": {
6+
"/dist/firephp.build": "to.pinf.org.mozilla.web-ext",
7+
"runner": "it.pinf.org.mozilla.web-ext"
8+
},
9+
":builder:": "/dist/firephp.build @ builder/v1",
10+
":runner:": "runner @ runner/v1",
11+
12+
"gi0.PINF.it/build/v0 @ # /dist/firephp.build": (inf () >>>
13+
{
14+
"gi0.PINF.it/build/v0 @ # :builder: build() /": {
15+
"port": 9000,
16+
"manifest": {
17+
"name": "FirePHP (Official)",
18+
"version": "${version}",
19+
"description": "Log from PHP to a devtools panel.",
20+
"applications": {
21+
"gecko": {
22+
23+
"strict_min_version": "56.0"
24+
}
25+
},
26+
"icons": {
27+
"48": "./src/skin/Logo.png"
28+
},
29+
"permissions": [
30+
"activeTab",
31+
"storage",
32+
"webRequest",
33+
"webNavigation",
34+
"webRequestBlocking",
35+
"<all_urls>"
36+
],
37+
"content_security_policy": "script-src 'self'; style-src 'self'; object-src 'self'; img-src 'self'",
38+
"background": {
39+
"scripts": [
40+
{
41+
"background.js": {
42+
"gi0.PINF.it/build/v0 # /scripts # /background.js": {
43+
"@it.pinf.org.browserify # router/v1": {
44+
"src": "./src/background.js",
45+
"format": "pinf",
46+
"babel": {
47+
"presets": {
48+
"@babel/preset-env": {
49+
"targets": "last 1 Firefox versions"
50+
}
51+
}
52+
}
53+
}
54+
}
55+
}
56+
}
57+
]
58+
},
59+
"devtools": {
60+
"panels": [
61+
{
62+
"devtools/dist/index.js": {
63+
"label": "FirePHP",
64+
"icon": "./src/skin/Logo.png",
65+
"include": {
66+
"codemirror.js": "codemirror/lib/codemirror.js",
67+
"codemirror.css": "codemirror/lib/codemirror.css",
68+
"codemirror/addon/selection/active-line.js": "codemirror/addon/selection/active-line.js",
69+
"codemirror/mode/xml/xml.js": "codemirror/mode/xml/xml.js",
70+
"codemirror/mode/javascript/javascript.js": "codemirror/mode/javascript/javascript.js",
71+
"codemirror/mode/css/css.js": "codemirror/mode/css/css.js",
72+
"codemirror/mode/htmlmixed/htmlmixed.js": "codemirror/mode/htmlmixed/htmlmixed.js",
73+
"codemirror/mode/clike/clike.js": "codemirror/mode/clike/clike.js",
74+
"codemirror/mode/php/php.js": "codemirror/mode/php/php.js"
75+
},
76+
"code": {
77+
"gi0.PINF.it/build/v0 # /scripts/devtools # /": {
78+
"@fireconsole.rep.js # builder/v1": {
79+
"externalizeCss": true,
80+
"indexFilename": "index",
81+
"indexFormat": "js",
82+
"include": {
83+
"jquery": false,
84+
"regenerator-runtime": false,
85+
"riot.csp.js": true,
86+
"riot.js": false,
87+
"riot.min.js": false
88+
},
89+
"page": {
90+
"@layout": {
91+
"console": {
92+
"@console": {
93+
"@fireconsole": {
94+
}
95+
}
96+
},
97+
"menu": {
98+
"@menu": {}
99+
},
100+
"settings": {
101+
"@enabler": {}
102+
},
103+
"inspector": {
104+
"@inspector": {}
105+
},
106+
"editor": {
107+
"@editor": {}
108+
},
109+
"manage": {
110+
"@manage": {
111+
"settings": {
112+
"@settings": {}
113+
}
114+
}
115+
}
116+
}
117+
},
118+
"reps": {
119+
"layout": "./src/layout.rep.js",
120+
"menu": "./src/menu.rep.js",
121+
"summary": "./src/summary.rep.js",
122+
"settings": "./src/settings.rep.js",
123+
"manage": "./src/manage.rep.js",
124+
"inspector": "./src/inspector.rep.js",
125+
"editor": "./src/editor.rep.js",
126+
"console": "./src/console.rep.js",
127+
"enabler": "./src/enabler.rep.js"
128+
},
129+
"babel": {
130+
"presets": {
131+
"@babel/preset-env": {
132+
"targets": "last 1 Firefox versions"
133+
}
134+
}
135+
}
136+
}
137+
}
138+
}
139+
}
140+
}
141+
]
142+
}
143+
},
144+
"routes": {
145+
"^/$": (javascript (API) >>>
146+
147+
return function (req, res, next) {
148+
149+
if (
150+
req.headers["x-firephp-version"] ||
151+
/\sFirePHP\/([\.|\d]*)\s?/.test(req.headers["user-agent"])
152+
) {
153+
154+
function wrap (message) {
155+
return message.length + '|' + message + '|';
156+
}
157+
158+
res.writeHead(200, {
159+
'X-Wf-Protocol-1': 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2',
160+
'X-Wf-1-Plugin-1': 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.0.0master1106021548',
161+
'X-Wf-1-Structure-1': 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1',
162+
163+
// @see https://github.com/firephp/firephp/issues/16
164+
'X-Wf-1-1-1-1': wrap('[{"Type":"LOG","File":"/path/to/file","Line":10},"Hello World"]'),
165+
'X-Wf-1-1-1-2': wrap('[{"Type":"INFO","File":"\/christoph\/projects\/gi0.FireConsole.org\/rep.js\/examples\/03-FirePHPCore\/index.php","Line":75},"\\u0427\\u0442\\u043e-\\u0442\\u043e"]'),
166+
'X-Wf-1-1-1-3': wrap('[{"Type":"INFO","File":"\/christoph\/projects\/gi0.FireConsole.org\/rep.js\/examples\/03-FirePHPCore\/index.php","Line":76},"Od\\u00f3metro"]'),
167+
168+
'X-Wf-1-Index': '3'
169+
});
170+
171+
172+
res.end("FirePHP Core formatted messages sent in HTTP response headers.");
173+
} else {
174+
175+
res.end([
176+
"<p>No FirePHP HTTP request headers found.</p>",
177+
"<p><a href=\"http://127.0.0.1:8080/FirePHP.php\">http://127.0.0.1:8080/FirePHP.php</a></p>"
178+
].join("\\n"));
179+
}
180+
};
181+
<<<)
182+
}
183+
}
184+
}
185+
<<<),
186+
187+
"gi0.PINF.it/build/v0 @ # onCommand() test": (inf () >>>
188+
{
189+
"# run": (run.bash.origin.method.progress () >>>
190+
191+
BO_cecho "DEPRECATED: Tests are out of date. They were used to build up the extension." RED BOLD
192+
BO_cecho "TODO: Build new tests that run on top of build.\n" MAGENTA BOLD
193+
194+
# bash.origin.test tests
195+
<<<)
196+
}
197+
<<<),
198+
"gi0.PINF.it/build/v0 @ # onCommand() dev": (inf () >>>
199+
{
200+
"gi0.PINF.it/build/v0 @ # :runner: run() /dist/firephp.build": ""
201+
}
202+
<<<),
203+
"gi0.PINF.it/build/v0 @ # onCommand() build": (inf () >>>
204+
{
205+
"gi0.PINF.it/build/v0 @ # :runner: build() /dist/firephp.build": ""
206+
}
207+
<<<),
208+
"gi0.PINF.it/build/v0 @ # onCommand() publish": (inf () >>>
209+
{
210+
"# run": (run.bash.origin.script.method.progress () >>>
211+
212+
depend {
213+
"webext": "it.pinf.org.mozilla.web-ext # runner/v0"
214+
}
215+
216+
npm run build
217+
218+
if [ $(git rev-parse --abbrev-ref HEAD) == "master" ] ; then
219+
export MOZILLA_ADDONS_CHANNEL="listed"
220+
fi
221+
222+
pushd "dist/firephp.build" > /dev/null
223+
CALL_webext sign {
224+
"dist": "$(pwd)/../firephp.xpi",
225+
"manifest": {
226+
}
227+
}
228+
popd > /dev/null
229+
230+
if [ $(git rev-parse --abbrev-ref HEAD) == "master" ] ; then
231+
BO_cecho "Built extension (signed for addons listing) has been published for review by mozilla and can also be found at: dist/firephp.xpi" YELLOW BOLD
232+
else
233+
BO_cecho "Built extension (signed as self-hosted) can be found at: dist/firephp.xpi" YELLOW BOLD
234+
fi
235+
<<<)
236+
}
237+
<<<)
238+
}

.github/workflows/build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build
2+
on:
3+
- push
4+
jobs:
5+
Build:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
node-version:
10+
- 13.x
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Cache node modules
15+
uses: actions/cache@v2
16+
env:
17+
cache-name: cache-node-modules
18+
with:
19+
path: node_modules
20+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }}-${{ hashFiles('npm-shrinkwrap.json') }}
21+
restore-keys: |
22+
${{ runner.os }}-build-${{ env.cache-name }}-
23+
${{ runner.os }}-build-
24+
${{ runner.os }}-
25+
26+
- name: Install Dependencies
27+
run: npm install
28+
29+
- name: Build
30+
run: npm run build
31+
32+
- name: Upload extension as build artifact
33+
uses: actions/upload-artifact@v1
34+
with:
35+
name: firephp
36+
path: dist/firephp.zip
37+
38+
- name: Upload Release if tagging
39+
uses: fnkr/github-action-ghr@v1
40+
if: startsWith(github.ref, 'refs/tags/')
41+
env:
42+
GHR_PATH: dist/firephp.zip
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
*~.compiled.bash
55
.actual.*
66
node_modules/
7+
/package-lock.json
78
.rt/
89
~.rt_*
9-
/dist/firephp.zip
10-
/dist/firephp.build/.web-extension-id
10+
/dist/
1111
.~*
12-
/dist/firephp.build.zip
12+
/tests/*/.extension.built

.postbuild.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash.origin.script
2+
3+
# TODO: Move to '#!inf.json' once pinf.it/build/v0 executes instructions in sequence.
4+
5+
pushd "dist/firephp.build" > /dev/null
6+
7+
# Remove files that we do not need
8+
# TODO: Do this in a better way and coordinate with .gitignore
9+
rm -Rf scripts/devtools/dist/dist/riot.min.js
10+
rm -Rf scripts/devtools/dist/dist/riot.js
11+
rm -Rf scripts/devtools/dist/dist/babel-regenerator-runtime.js
12+
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/dist/domplate.browser.js
13+
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/dist/domplate-eval.browser.js
14+
rm -Rf lib/github.com~pinf~pinf-for-mozilla-web-ext/scripts/lib/pinf-loader-core.browser.js
15+
rm -Rf lib/github.com~pinf~pinf-for-mozilla-web-ext/scripts/lib/babel-regenerator-runtime.js
16+
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/*/*.preview.htm
17+
rm -Rf scripts/devtools/dist/dist/reps/insight.domplate.reps/dist/reps/reps.json
18+
rm -Rf scripts/devtools/dist/dist/reps/io.shields.img.rep.js
19+
rm -Rf scripts/devtools/dist/dist/reps/div.rep.js
20+
rm -Rf scripts/devtools/dist/dist/reps/golden-layout.rep.js
21+
rm -Rf skin/box.png
22+
rm -Rf run.config.json
23+
24+
# Remove signed archive as it needs to be re-signed
25+
rm -f ../firephp.build.xpi 2> /dev/null || true
26+
27+
popd > /dev/null
28+
29+
pushd "dist" > /dev/null
30+
31+
mv firephp.build firephp
32+
zip -r firephp.zip firephp/
33+
mv firephp firephp.build
34+
35+
popd > /dev/null
36+
37+
BO_cecho "\nBuilt extension source can be found at: dist/firephp.build/" YELLOW BOLD
38+
BO_cecho "This source can be loaded into a browser when running in extension development mode.\n" YELLOW BOLD

.prepare.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
# TODO: Get rid of this file once issues are fixed in underlying libraries.
4+
5+
[ ! -e '.~/gi0.PINF.it~build~v0' ] || rm -Rf '.~/gi0.PINF.it~build~v0'
6+
[ ! -e 'dist/firephp.build' ] || rm -Rf 'dist/firephp.build'
7+
8+
[ -e '.~lib.json' ] || node_modules/.bin/lib.json from node_modules > '.~lib.json'

0 commit comments

Comments
 (0)