Skip to content

Commit 9e3de9c

Browse files
committed
Merge branch 'kazuho/experiments/diet-npm-package' (fix #309)
2 parents 6a52c7c + 7758c45 commit 9e3de9c

12 files changed

Lines changed: 6119 additions & 4925 deletions

File tree

.npmignore

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# temporary files
2-
32
*~
43
*.swp
54
*.zip
@@ -11,29 +10,33 @@ bootstrap/
1110
.jsx
1211
tmp/
1312

14-
# products
15-
16-
try/
13+
# files in git but not from npm
14+
.npmignore
15+
.travis.yml
16+
.proverc
17+
complete/
1718
doc/
19+
example/
20+
extlib/
21+
gruntfile.js
22+
idl2jsx/
23+
Makefile
24+
release-engineering.md
25+
src/
26+
submodules/
27+
t/
28+
tool/
29+
try/
30+
web/
31+
xt/
1832

1933
# npm-related files
20-
2134
npm-debug.log
2235
package/
2336
jsx-*.tgz
2437

2538
# no need to include node modules
26-
2739
node_modules/
2840

29-
# extlib stuff
30-
31-
.packlist
32-
.meta
33-
darwin-*
34-
linux-*
35-
*:*
36-
3741
# git stuff
38-
3942
.git*

Makefile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ test: all test-debug test-optimized-minified show-todo
4646

4747
test-all: test test-optimized
4848

49-
test-debug: test-core test-misc-core
49+
test-debug: test-core test-misc
5050

5151
test-optimized:
5252
JSX_OPTS="--optimize release,-no-log,-no-assert" $(MAKE) test-core
@@ -61,11 +61,21 @@ test-transformed-optimized:
6161
JSX_OPTS="--enable-cps-transform --optimize release,-no-log,-no-assert" $(MAKE) test-core
6262

6363
test-core:
64-
$(PROVE) --jobs "$(JOBS)" t/run/*.jsx t/compile_error/*.jsx t/lib/*.jsx t/src/*.jsx t/web/*.jsx
64+
$(PROVE) --jobs "$(JOBS)" t/run/*.jsx t/compile_error/*.jsx t/lib/*.jsx t/optimize/*.jsx t/complete/*.jsx
6565

66-
test-misc-core:
67-
$(PROVE) --jobs "$(JOBS)" t/*.t t/optimize/*.jsx t/complete/*.jsx
66+
test-misc:
67+
$(PROVE) --jobs "$(JOBS)" t/*.t t/src/*.jsx t/web/*.jsx
6868

69+
test-npm: all
70+
perl -MFile::Temp=tempdir -e 'system("make _test-npm NPM_TEMPDIR=" . tempdir(CLEANUP => 1)) == 0 or exit 1'
71+
72+
_test-npm:
73+
PKG=$(shell npm pack)
74+
PWD=$(shell pwd)
75+
echo '{}' > $(NPM_TEMPDIR)/package.json
76+
(cd $(NPM_TEMPDIR) && npm install $(PWD)/$(PKG))
77+
JSX_COMPILER=$(NPM_TEMPDIR)/node_modules/.bin/jsx $(MAKE) test-core
78+
rm -f $(PKG)
6979

7080
test-bench:
7181
$(PROVE) -v xt/optimize-bench/*.jsx
@@ -92,10 +102,12 @@ web.jsx:
92102
show-todo:
93103
find t -name '*.todo.*' | grep -v '~'
94104

95-
publish:
96-
time $(MAKE) test-all COMPILER_COMPILE_OPTS="--release $(COMPILER_COMPILE_OPTS)"
105+
publish: publish-test
97106
npm publish
98107

108+
publish-test:
109+
time $(MAKE) test-all test-npm COMPILER_COMPILE_OPTS="--release $(COMPILER_COMPILE_OPTS)"
110+
99111
update-assets: update-bootstrap update-codemirror
100112

101113
update-codemirror:
@@ -124,4 +136,4 @@ clean:
124136
rm -rf bin/*
125137
rm -rf jsx-*.tgz
126138

127-
.PHONY: setup test test-debug test-release test-core test-misc-core web server doc meta instal-deps
139+
.PHONY: deps compiler compiler-core meta doc bootstrap-compiler test test-all test-debug test-optimized test-optimized-minified test-transformed test-transformed-optimized test-core test-misc test-npm _test-npm test-bench v8bench web server web.jsx show-todo publish publish-test update-assets update-codemirror update-bootstrap clean

src/jsemitter.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2995,7 +2995,7 @@ abstract class _BootstrapBuilder {
29952995
}
29962996

29972997
function addBootstrap(code : string) : string {
2998-
code += this._emitter._platform.load(this._emitter._platform.getRoot() + "/src/js/launcher.js");
2998+
code += this._emitter._platform.load(this._emitter._platform.getRoot() + "/lib/js/rt/launcher.js");
29992999

30003000
var args;
30013001
switch (this._executableFor) {
@@ -3022,7 +3022,7 @@ abstract class _BootstrapBuilder {
30223022
abstract function _getLauncher() : string;
30233023

30243024
function _wrapOnLoad(code : string) : string {
3025-
var wrapper = this._emitter._platform.load(this._emitter._platform.getRoot() + "/src/js/web-launcher.js");
3025+
var wrapper = this._emitter._platform.load(this._emitter._platform.getRoot() + "/lib/js/rt/web-launcher.js");
30263026
return wrapper.replace(/\/\/--CODE--\/\//, code);
30273027
}
30283028

@@ -3237,7 +3237,7 @@ class JavaScriptEmitter implements Emitter {
32373237
// headers
32383238
this._output += "// generatedy by JSX compiler " + Meta.IDENTIFIER + "\n";
32393239
this._output += this._fileHeader;
3240-
this._output += this._platform.load(this._platform.getRoot() + "/src/js/bootstrap.js");
3240+
this._output += this._platform.load(this._platform.getRoot() + "/lib/js/rt/bootstrap.js");
32413241

32423242
var stash = (this.getStash(_NoDebugCommand.IDENTIFIER) as _NoDebugCommand.Stash);
32433243
this._emit("JSX.DEBUG = "+(stash == null || stash.debugValue ? "true" : "false")+";\n", null);
@@ -3501,7 +3501,7 @@ class JavaScriptEmitter implements Emitter {
35013501
}
35023502
output += this._output + "\n";
35033503
if (this._enableProfiler) {
3504-
output += this._platform.load(this._platform.getRoot() + "/src/js/profiler.js");
3504+
output += this._platform.load(this._platform.getRoot() + "/lib/js/rt/profiler.js");
35053505
}
35063506
if (this._bootstrapBuilder != null) {
35073507
output = this._bootstrapBuilder.addBootstrap(output);

src/jsx-command.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ class JSXCommand {
421421
return 1;
422422
}
423423
if (compiler.compile()) {
424-
new DocumentGenerator(compiler, platform.getRoot() + "/src/doc", outputFile)
424+
new DocumentGenerator(compiler, platform.getRoot() + "/etc/doc-template", outputFile)
425425
.setResourceFiles(["style.css"])
426426
.setPathFilter(function (sourcePath) {
427427
if (sourcePath.indexOf("system:") == 0) {

0 commit comments

Comments
 (0)