@zappdev/cli 0.1.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/README.md +55 -0
- package/dist/zapp-cli.js +9471 -0
- package/native/src/app/app.zc +490 -0
- package/native/src/event/event.zc +24 -0
- package/native/src/event/events.zc +70 -0
- package/native/src/platform/darwin/backend.zc +923 -0
- package/native/src/platform/darwin/backend_bootstrap.zc +9 -0
- package/native/src/platform/darwin/bootstrap.zc +9 -0
- package/native/src/platform/darwin/engine_jsc.zc +86 -0
- package/native/src/platform/darwin/engine_qjs.zc +92 -0
- package/native/src/platform/darwin/platform.zc +156 -0
- package/native/src/platform/darwin/webview.zc +550 -0
- package/native/src/platform/darwin/webview_bootstrap.zc +9 -0
- package/native/src/platform/darwin/window.zc +1223 -0
- package/native/src/platform/darwin/worker/common.zc +223 -0
- package/native/src/platform/darwin/worker/core/base64_core.zc +29 -0
- package/native/src/platform/darwin/worker/core/crypto_core.zc +19 -0
- package/native/src/platform/darwin/worker/core/encoding_core.zc +32 -0
- package/native/src/platform/darwin/worker/core/fetch_core.zc +145 -0
- package/native/src/platform/darwin/worker/core/url_core.zc +69 -0
- package/native/src/platform/darwin/worker/core/websocket_core.zc +179 -0
- package/native/src/platform/darwin/worker/dispatch.zc +55 -0
- package/native/src/platform/darwin/worker/jsc/base64_jsc.zc +39 -0
- package/native/src/platform/darwin/worker/jsc/crypto_jsc.zc +49 -0
- package/native/src/platform/darwin/worker/jsc/encoding_jsc.zc +86 -0
- package/native/src/platform/darwin/worker/jsc/fetch_jsc.zc +149 -0
- package/native/src/platform/darwin/worker/jsc/url_jsc.zc +54 -0
- package/native/src/platform/darwin/worker/jsc/websocket_jsc.zc +127 -0
- package/native/src/platform/darwin/worker/jsc.zc +670 -0
- package/native/src/platform/darwin/worker/mod.zc +30 -0
- package/native/src/platform/darwin/worker/qjs/fetch_qjs.zc +233 -0
- package/native/src/platform/darwin/worker/qjs/qjs_macros.zc +23 -0
- package/native/src/platform/darwin/worker/qjs/websocket_qjs.zc +223 -0
- package/native/src/platform/darwin/worker/qjs.zc +1053 -0
- package/native/src/platform/darwin/worker/timers.zc +149 -0
- package/native/src/platform/darwin/worker/timers_qjs.zc +209 -0
- package/native/src/platform/platform.zc +64 -0
- package/native/src/platform/shared/log.zc +156 -0
- package/native/src/platform/shared/worker/qjs/base64_qjs.zc +38 -0
- package/native/src/platform/shared/worker/qjs/crypto_qjs.zc +44 -0
- package/native/src/platform/shared/worker/qjs/encoding_qjs.zc +95 -0
- package/native/src/platform/shared/worker/qjs/url_qjs.zc +65 -0
- package/native/src/platform/shared/worker_registry.zc +206 -0
- package/native/src/platform/window.zc +446 -0
- package/native/src/platform/windows/backend.zc +452 -0
- package/native/src/platform/windows/backend_bootstrap.zc +9 -0
- package/native/src/platform/windows/bootstrap.zc +9 -0
- package/native/src/platform/windows/engine_qjs.zc +60 -0
- package/native/src/platform/windows/platform.zc +387 -0
- package/native/src/platform/windows/webview.zc +1175 -0
- package/native/src/platform/windows/webview_bootstrap.zc +9 -0
- package/native/src/platform/windows/window.zc +1271 -0
- package/native/src/platform/windows/worker/common.zc +409 -0
- package/native/src/platform/windows/worker/core/base64_core.zc +52 -0
- package/native/src/platform/windows/worker/core/crypto_core.zc +34 -0
- package/native/src/platform/windows/worker/core/encoding_core.zc +60 -0
- package/native/src/platform/windows/worker/core/fetch_core.zc +274 -0
- package/native/src/platform/windows/worker/core/url_core.zc +216 -0
- package/native/src/platform/windows/worker/core/websocket_core.zc +343 -0
- package/native/src/platform/windows/worker/dispatch.zc +34 -0
- package/native/src/platform/windows/worker/mod.zc +46 -0
- package/native/src/platform/windows/worker/qjs/fetch_qjs.zc +255 -0
- package/native/src/platform/windows/worker/qjs/websocket_qjs.zc +263 -0
- package/native/src/platform/windows/worker/qjs.zc +1049 -0
- package/native/src/platform/windows/worker/timers_qjs.zc +288 -0
- package/native/src/platform/worker.zc +8 -0
- package/native/src/service/service.zc +228 -0
- package/native/vendor/quickjs-ng/.gitattributes +4 -0
- package/native/vendor/quickjs-ng/.github/dependabot.yml +7 -0
- package/native/vendor/quickjs-ng/.github/workflows/ci.yml +812 -0
- package/native/vendor/quickjs-ng/.github/workflows/docs.yml +49 -0
- package/native/vendor/quickjs-ng/.github/workflows/release.yml +162 -0
- package/native/vendor/quickjs-ng/.github/workflows/test-docs.yml +23 -0
- package/native/vendor/quickjs-ng/.github/workflows/tsan.yml +32 -0
- package/native/vendor/quickjs-ng/.github/workflows/valgrind.yml +33 -0
- package/native/vendor/quickjs-ng/.gitmodules +5 -0
- package/native/vendor/quickjs-ng/CMakeLists.txt +553 -0
- package/native/vendor/quickjs-ng/LICENSE +24 -0
- package/native/vendor/quickjs-ng/Makefile +149 -0
- package/native/vendor/quickjs-ng/amalgam.js +53 -0
- package/native/vendor/quickjs-ng/api-test.c +927 -0
- package/native/vendor/quickjs-ng/builtin-array-fromasync.h +119 -0
- package/native/vendor/quickjs-ng/builtin-array-fromasync.js +36 -0
- package/native/vendor/quickjs-ng/builtin-iterator-zip-keyed.h +332 -0
- package/native/vendor/quickjs-ng/builtin-iterator-zip-keyed.js +194 -0
- package/native/vendor/quickjs-ng/builtin-iterator-zip.h +337 -0
- package/native/vendor/quickjs-ng/builtin-iterator-zip.js +210 -0
- package/native/vendor/quickjs-ng/ctest.c +17 -0
- package/native/vendor/quickjs-ng/cutils.h +2013 -0
- package/native/vendor/quickjs-ng/cxxtest.cc +2 -0
- package/native/vendor/quickjs-ng/dtoa.c +1619 -0
- package/native/vendor/quickjs-ng/dtoa.h +87 -0
- package/native/vendor/quickjs-ng/examples/fib.c +67 -0
- package/native/vendor/quickjs-ng/examples/fib_module.js +10 -0
- package/native/vendor/quickjs-ng/examples/hello.js +1 -0
- package/native/vendor/quickjs-ng/examples/hello_module.js +6 -0
- package/native/vendor/quickjs-ng/examples/meson.build +17 -0
- package/native/vendor/quickjs-ng/examples/pi_bigint.js +118 -0
- package/native/vendor/quickjs-ng/examples/point.c +154 -0
- package/native/vendor/quickjs-ng/examples/test_fib.js +8 -0
- package/native/vendor/quickjs-ng/examples/test_point.js +43 -0
- package/native/vendor/quickjs-ng/fuzz.c +51 -0
- package/native/vendor/quickjs-ng/gen/function_source.c +81 -0
- package/native/vendor/quickjs-ng/gen/hello.c +53 -0
- package/native/vendor/quickjs-ng/gen/hello_module.c +106 -0
- package/native/vendor/quickjs-ng/gen/repl.c +3053 -0
- package/native/vendor/quickjs-ng/gen/standalone.c +324 -0
- package/native/vendor/quickjs-ng/gen/test_fib.c +81 -0
- package/native/vendor/quickjs-ng/libregexp-opcode.h +58 -0
- package/native/vendor/quickjs-ng/libregexp.c +2687 -0
- package/native/vendor/quickjs-ng/libregexp.h +98 -0
- package/native/vendor/quickjs-ng/libunicode-table.h +4707 -0
- package/native/vendor/quickjs-ng/libunicode.c +1746 -0
- package/native/vendor/quickjs-ng/libunicode.h +126 -0
- package/native/vendor/quickjs-ng/list.h +107 -0
- package/native/vendor/quickjs-ng/lre-test.c +73 -0
- package/native/vendor/quickjs-ng/meson.build +684 -0
- package/native/vendor/quickjs-ng/meson_options.txt +6 -0
- package/native/vendor/quickjs-ng/qjs-wasi-reactor.c +208 -0
- package/native/vendor/quickjs-ng/qjs.c +748 -0
- package/native/vendor/quickjs-ng/qjsc.c +673 -0
- package/native/vendor/quickjs-ng/quickjs-atom.h +267 -0
- package/native/vendor/quickjs-ng/quickjs-c-atomics.h +54 -0
- package/native/vendor/quickjs-ng/quickjs-libc.c +4986 -0
- package/native/vendor/quickjs-ng/quickjs-libc.h +79 -0
- package/native/vendor/quickjs-ng/quickjs-opcode.h +369 -0
- package/native/vendor/quickjs-ng/quickjs.c +60259 -0
- package/native/vendor/quickjs-ng/quickjs.h +1419 -0
- package/native/vendor/quickjs-ng/repl.js +1927 -0
- package/native/vendor/quickjs-ng/run-test262.c +2417 -0
- package/native/vendor/quickjs-ng/standalone.js +129 -0
- package/native/vendor/quickjs-ng/tests/assert.js +49 -0
- package/native/vendor/quickjs-ng/tests/bug1221.js +16 -0
- package/native/vendor/quickjs-ng/tests/bug1296.js +12 -0
- package/native/vendor/quickjs-ng/tests/bug1297.js +22 -0
- package/native/vendor/quickjs-ng/tests/bug1301.js +21 -0
- package/native/vendor/quickjs-ng/tests/bug1302.js +24 -0
- package/native/vendor/quickjs-ng/tests/bug1305.js +26 -0
- package/native/vendor/quickjs-ng/tests/bug1318.js +54 -0
- package/native/vendor/quickjs-ng/tests/bug1352.js +8 -0
- package/native/vendor/quickjs-ng/tests/bug1354.js +6 -0
- package/native/vendor/quickjs-ng/tests/bug1355.js +58 -0
- package/native/vendor/quickjs-ng/tests/bug1368.js +9 -0
- package/native/vendor/quickjs-ng/tests/bug39/1.js +6 -0
- package/native/vendor/quickjs-ng/tests/bug39/2.js +6 -0
- package/native/vendor/quickjs-ng/tests/bug39/3.js +7 -0
- package/native/vendor/quickjs-ng/tests/bug488-upstream.js +7 -0
- package/native/vendor/quickjs-ng/tests/bug633/0.js +7 -0
- package/native/vendor/quickjs-ng/tests/bug633/1.js +4 -0
- package/native/vendor/quickjs-ng/tests/bug633/2.js +4 -0
- package/native/vendor/quickjs-ng/tests/bug633/3.js +4 -0
- package/native/vendor/quickjs-ng/tests/bug645/0.js +4 -0
- package/native/vendor/quickjs-ng/tests/bug645/1.js +9 -0
- package/native/vendor/quickjs-ng/tests/bug645/2.js +7 -0
- package/native/vendor/quickjs-ng/tests/bug648.js +13 -0
- package/native/vendor/quickjs-ng/tests/bug652.js +4 -0
- package/native/vendor/quickjs-ng/tests/bug741.js +19 -0
- package/native/vendor/quickjs-ng/tests/bug775.js +7 -0
- package/native/vendor/quickjs-ng/tests/bug776.js +7 -0
- package/native/vendor/quickjs-ng/tests/bug832.js +2 -0
- package/native/vendor/quickjs-ng/tests/bug858.js +26 -0
- package/native/vendor/quickjs-ng/tests/bug904.js +6 -0
- package/native/vendor/quickjs-ng/tests/bug988.js +7 -0
- package/native/vendor/quickjs-ng/tests/bug999.js +3 -0
- package/native/vendor/quickjs-ng/tests/destructured-export.js +8 -0
- package/native/vendor/quickjs-ng/tests/detect_module/0.js +1 -0
- package/native/vendor/quickjs-ng/tests/detect_module/1.js +2 -0
- package/native/vendor/quickjs-ng/tests/detect_module/2.js +1 -0
- package/native/vendor/quickjs-ng/tests/detect_module/3.js +8 -0
- package/native/vendor/quickjs-ng/tests/detect_module/4.js +3 -0
- package/native/vendor/quickjs-ng/tests/empty.js +0 -0
- package/native/vendor/quickjs-ng/tests/fixture_cyclic_import.js +2 -0
- package/native/vendor/quickjs-ng/tests/fixture_string_exports.js +12 -0
- package/native/vendor/quickjs-ng/tests/function_source.js +14 -0
- package/native/vendor/quickjs-ng/tests/microbench.js +1267 -0
- package/native/vendor/quickjs-ng/tests/null_or_undefined.js +38 -0
- package/native/vendor/quickjs-ng/tests/str-pad-leak.js +5 -0
- package/native/vendor/quickjs-ng/tests/test_bigint.js +107 -0
- package/native/vendor/quickjs-ng/tests/test_bjson.js +366 -0
- package/native/vendor/quickjs-ng/tests/test_builtin.js +1314 -0
- package/native/vendor/quickjs-ng/tests/test_closure.js +220 -0
- package/native/vendor/quickjs-ng/tests/test_cyclic_import.js +12 -0
- package/native/vendor/quickjs-ng/tests/test_domexception.js +35 -0
- package/native/vendor/quickjs-ng/tests/test_language.js +755 -0
- package/native/vendor/quickjs-ng/tests/test_loop.js +367 -0
- package/native/vendor/quickjs-ng/tests/test_queue_microtask.js +39 -0
- package/native/vendor/quickjs-ng/tests/test_std.js +340 -0
- package/native/vendor/quickjs-ng/tests/test_string_exports.js +25 -0
- package/native/vendor/quickjs-ng/tests/test_worker.js +43 -0
- package/native/vendor/quickjs-ng/tests/test_worker_module.js +30 -0
- package/native/vendor/quickjs-ng/tests.conf +14 -0
- package/native/vendor/quickjs-ng/unicode_download.sh +19 -0
- package/native/vendor/quickjs-ng/unicode_gen.c +3108 -0
- package/native/vendor/quickjs-ng/unicode_gen_def.h +310 -0
- package/native/vendor/quickjs-ng/update-version.sh +32 -0
- package/native/vendor/webview2/include/WebView2.h +60636 -0
- package/native/vendor/webview2/include/WebView2EnvironmentOptions.h +406 -0
- package/package.json +33 -0
- package/src/backend.ts +139 -0
- package/src/build-config.ts +87 -0
- package/src/build.ts +276 -0
- package/src/common.ts +195 -0
- package/src/config.ts +89 -0
- package/src/dev.ts +164 -0
- package/src/generate.ts +200 -0
- package/src/icons.ts +116 -0
- package/src/init.ts +190 -0
- package/src/package.ts +150 -0
- package/src/zapp-cli.ts +263 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#
|
|
2
|
+
# QuickJS Javascript Engine
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2017-2026 Fabrice Bellard
|
|
5
|
+
# Copyright (c) 2017-2024 Charlie Gordon
|
|
6
|
+
# Copyright (c) 2023-2026 Ben Noordhuis
|
|
7
|
+
# Copyright (c) 2023-2026 Saúl Ibarra Corretgé
|
|
8
|
+
#
|
|
9
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
# in the Software without restriction, including without limitation the rights
|
|
12
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
# furnished to do so, subject to the following conditions:
|
|
15
|
+
#
|
|
16
|
+
# The above copyright notice and this permission notice shall be included in
|
|
17
|
+
# all copies or substantial portions of the Software.
|
|
18
|
+
#
|
|
19
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
22
|
+
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
# THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
BUILD_DIR=build
|
|
28
|
+
BUILD_TYPE?=Release
|
|
29
|
+
INSTALL_PREFIX?=/usr/local
|
|
30
|
+
|
|
31
|
+
QJS=$(BUILD_DIR)/qjs
|
|
32
|
+
QJSC=$(BUILD_DIR)/qjsc
|
|
33
|
+
RUN262=$(BUILD_DIR)/run-test262
|
|
34
|
+
|
|
35
|
+
JOBS?=$(shell getconf _NPROCESSORS_ONLN)
|
|
36
|
+
ifeq ($(JOBS),)
|
|
37
|
+
JOBS := $(shell sysctl -n hw.ncpu)
|
|
38
|
+
endif
|
|
39
|
+
ifeq ($(JOBS),)
|
|
40
|
+
JOBS := $(shell nproc)
|
|
41
|
+
endif
|
|
42
|
+
ifeq ($(JOBS),)
|
|
43
|
+
JOBS := 4
|
|
44
|
+
endif
|
|
45
|
+
|
|
46
|
+
all: $(QJS)
|
|
47
|
+
|
|
48
|
+
amalgam: TEMP := $(shell mktemp -d)
|
|
49
|
+
amalgam: $(QJS)
|
|
50
|
+
$(QJS) amalgam.js $(TEMP)/quickjs-amalgam.c
|
|
51
|
+
cp quickjs.h quickjs-libc.h $(TEMP)
|
|
52
|
+
cd $(TEMP) && zip -9 quickjs-amalgam.zip quickjs-amalgam.c quickjs.h quickjs-libc.h
|
|
53
|
+
cp $(TEMP)/quickjs-amalgam.zip $(BUILD_DIR)
|
|
54
|
+
cd $(TEMP) && $(RM) quickjs-amalgam.zip quickjs-amalgam.c quickjs.h quickjs-libc.h
|
|
55
|
+
$(RM) -d $(TEMP)
|
|
56
|
+
|
|
57
|
+
fuzz:
|
|
58
|
+
clang -g -O1 -fsanitize=address,undefined,fuzzer -o fuzz fuzz.c
|
|
59
|
+
./fuzz
|
|
60
|
+
|
|
61
|
+
$(BUILD_DIR):
|
|
62
|
+
cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX)
|
|
63
|
+
|
|
64
|
+
$(QJS): $(BUILD_DIR)
|
|
65
|
+
cmake --build $(BUILD_DIR) -j $(JOBS)
|
|
66
|
+
|
|
67
|
+
$(QJSC): $(BUILD_DIR)
|
|
68
|
+
cmake --build $(BUILD_DIR) --target qjsc -j $(JOBS)
|
|
69
|
+
|
|
70
|
+
install: $(QJS) $(QJSC)
|
|
71
|
+
cmake --build $(BUILD_DIR) --target install
|
|
72
|
+
|
|
73
|
+
clean:
|
|
74
|
+
cmake --build $(BUILD_DIR) --target clean
|
|
75
|
+
|
|
76
|
+
codegen: $(QJSC)
|
|
77
|
+
$(QJSC) -ss -o gen/repl.c -m repl.js
|
|
78
|
+
$(QJSC) -ss -o gen/standalone.c -m standalone.js
|
|
79
|
+
$(QJSC) -e -o gen/function_source.c tests/function_source.js
|
|
80
|
+
$(QJSC) -e -o gen/hello.c examples/hello.js
|
|
81
|
+
$(QJSC) -e -o gen/hello_module.c -m examples/hello_module.js
|
|
82
|
+
$(QJSC) -e -o gen/test_fib.c -m examples/test_fib.js
|
|
83
|
+
$(QJSC) -C -ss -o builtin-array-fromasync.h builtin-array-fromasync.js
|
|
84
|
+
$(QJSC) -C -ss -o builtin-iterator-zip.h builtin-iterator-zip.js
|
|
85
|
+
$(QJSC) -C -ss -o builtin-iterator-zip-keyed.h builtin-iterator-zip-keyed.js
|
|
86
|
+
|
|
87
|
+
debug:
|
|
88
|
+
BUILD_TYPE=Debug $(MAKE)
|
|
89
|
+
|
|
90
|
+
distclean:
|
|
91
|
+
@rm -rf $(BUILD_DIR)
|
|
92
|
+
|
|
93
|
+
stats: $(QJS)
|
|
94
|
+
$(QJS) -qd
|
|
95
|
+
|
|
96
|
+
jscheck: CFLAGS=-I. -D_GNU_SOURCE -DJS_CHECK_JSVALUE -Wall -Werror -fsyntax-only -c -o /dev/null
|
|
97
|
+
jscheck:
|
|
98
|
+
$(CC) $(CFLAGS) api-test.c
|
|
99
|
+
$(CC) $(CFLAGS) ctest.c
|
|
100
|
+
$(CC) $(CFLAGS) fuzz.c
|
|
101
|
+
$(CC) $(CFLAGS) gen/function_source.c
|
|
102
|
+
$(CC) $(CFLAGS) gen/hello.c
|
|
103
|
+
$(CC) $(CFLAGS) gen/hello_module.c
|
|
104
|
+
$(CC) $(CFLAGS) gen/repl.c
|
|
105
|
+
$(CC) $(CFLAGS) gen/standalone.c
|
|
106
|
+
$(CC) $(CFLAGS) gen/test_fib.c
|
|
107
|
+
$(CC) $(CFLAGS) qjs.c
|
|
108
|
+
$(CC) $(CFLAGS) qjsc.c
|
|
109
|
+
$(CC) $(CFLAGS) quickjs-libc.c
|
|
110
|
+
$(CC) $(CFLAGS) quickjs.c
|
|
111
|
+
$(CC) $(CFLAGS) run-test262.c
|
|
112
|
+
|
|
113
|
+
# effectively .PHONY because it doesn't generate output
|
|
114
|
+
ctest: CFLAGS=-std=c11 -fsyntax-only -Wall -Wextra -Werror -pedantic
|
|
115
|
+
ctest: ctest.c quickjs.h
|
|
116
|
+
$(CC) $(CFLAGS) -DJS_NAN_BOXING=0 $<
|
|
117
|
+
$(CC) $(CFLAGS) -DJS_NAN_BOXING=1 $<
|
|
118
|
+
|
|
119
|
+
# effectively .PHONY because it doesn't generate output
|
|
120
|
+
cxxtest: CXXFLAGS=-std=c++11 -fsyntax-only -Wall -Wextra -Werror -pedantic
|
|
121
|
+
cxxtest: cxxtest.cc quickjs.h
|
|
122
|
+
$(CXX) $(CXXFLAGS) -DJS_NAN_BOXING=0 $<
|
|
123
|
+
$(CXX) $(CXXFLAGS) -DJS_NAN_BOXING=1 $<
|
|
124
|
+
|
|
125
|
+
test: $(QJS)
|
|
126
|
+
$(RUN262) -c tests.conf
|
|
127
|
+
|
|
128
|
+
test262: $(QJS)
|
|
129
|
+
$(RUN262) -m -c test262.conf -a
|
|
130
|
+
|
|
131
|
+
test262-fast: $(QJS)
|
|
132
|
+
$(RUN262) -m -c test262.conf -c test262-fast.conf -a
|
|
133
|
+
|
|
134
|
+
test262-update: $(QJS)
|
|
135
|
+
$(RUN262) -u -c test262.conf -a -t 1
|
|
136
|
+
|
|
137
|
+
test262-check: $(QJS)
|
|
138
|
+
$(RUN262) -m -c test262.conf -E -a
|
|
139
|
+
|
|
140
|
+
microbench: $(QJS)
|
|
141
|
+
$(QJS) tests/microbench.js
|
|
142
|
+
|
|
143
|
+
unicode_gen: $(BUILD_DIR)
|
|
144
|
+
cmake --build $(BUILD_DIR) --target unicode_gen
|
|
145
|
+
|
|
146
|
+
libunicode-table.h: unicode_gen
|
|
147
|
+
$(BUILD_DIR)/unicode_gen unicode $@
|
|
148
|
+
|
|
149
|
+
.PHONY: all amalgam ctest cxxtest debug fuzz jscheck install clean codegen distclean stats test test262 test262-update test262-check microbench unicode_gen $(QJS) $(QJSC)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {loadFile, writeFile} from "qjs:std"
|
|
2
|
+
|
|
3
|
+
const cutils_h = loadFile("cutils.h")
|
|
4
|
+
const dtoa_c = loadFile("dtoa.c")
|
|
5
|
+
const dtoa_h = loadFile("dtoa.h")
|
|
6
|
+
const libregexp_c = loadFile("libregexp.c")
|
|
7
|
+
const libregexp_h = loadFile("libregexp.h")
|
|
8
|
+
const libregexp_opcode_h = loadFile("libregexp-opcode.h")
|
|
9
|
+
const libunicode_c = loadFile("libunicode.c")
|
|
10
|
+
const libunicode_h = loadFile("libunicode.h")
|
|
11
|
+
const libunicode_table_h = loadFile("libunicode-table.h")
|
|
12
|
+
const list_h = loadFile("list.h")
|
|
13
|
+
const quickjs_atom_h = loadFile("quickjs-atom.h")
|
|
14
|
+
const quickjs_c = loadFile("quickjs.c")
|
|
15
|
+
const quickjs_c_atomics_h = loadFile("quickjs-c-atomics.h")
|
|
16
|
+
const quickjs_h = loadFile("quickjs.h")
|
|
17
|
+
const quickjs_libc_c = loadFile("quickjs-libc.c")
|
|
18
|
+
const quickjs_libc_h = loadFile("quickjs-libc.h")
|
|
19
|
+
const quickjs_opcode_h = loadFile("quickjs-opcode.h")
|
|
20
|
+
const gen_builtin_array_fromasync_h = loadFile("builtin-array-fromasync.h")
|
|
21
|
+
const gen_builtin_iterator_zip_h = loadFile("builtin-iterator-zip.h")
|
|
22
|
+
const gen_builtin_iterator_zip_keyed_h = loadFile("builtin-iterator-zip-keyed.h")
|
|
23
|
+
|
|
24
|
+
let source = "#if defined(QJS_BUILD_LIBC) && defined(__linux__) && !defined(_GNU_SOURCE)\n"
|
|
25
|
+
+ "#define _GNU_SOURCE\n"
|
|
26
|
+
+ "#endif\n"
|
|
27
|
+
+ quickjs_c_atomics_h
|
|
28
|
+
+ cutils_h
|
|
29
|
+
+ dtoa_h
|
|
30
|
+
+ list_h
|
|
31
|
+
+ libunicode_h // exports lre_is_id_start, used by libregexp.h
|
|
32
|
+
+ libregexp_h
|
|
33
|
+
+ libunicode_table_h
|
|
34
|
+
+ quickjs_h
|
|
35
|
+
+ quickjs_c
|
|
36
|
+
+ dtoa_c
|
|
37
|
+
+ libregexp_c
|
|
38
|
+
+ libunicode_c
|
|
39
|
+
+ "#ifdef QJS_BUILD_LIBC\n"
|
|
40
|
+
+ quickjs_libc_h
|
|
41
|
+
+ quickjs_libc_c
|
|
42
|
+
+ "#endif // QJS_BUILD_LIBC\n"
|
|
43
|
+
source = source.replace(/#include "quickjs-atom.h"/g, quickjs_atom_h)
|
|
44
|
+
source = source.replace(/#include "quickjs-opcode.h"/g, quickjs_opcode_h)
|
|
45
|
+
source = source.replace(/#include "libregexp-opcode.h"/g, libregexp_opcode_h)
|
|
46
|
+
source = source.replace(/#include "builtin-array-fromasync.h"/g,
|
|
47
|
+
gen_builtin_array_fromasync_h)
|
|
48
|
+
source = source.replace(/#include "builtin-iterator-zip.h"/g,
|
|
49
|
+
gen_builtin_iterator_zip_h)
|
|
50
|
+
source = source.replace(/#include "builtin-iterator-zip-keyed.h"/g,
|
|
51
|
+
gen_builtin_iterator_zip_keyed_h)
|
|
52
|
+
source = source.replace(/#include "[^"]+"/g, "")
|
|
53
|
+
writeFile(execArgv[2] ?? "quickjs-amalgam.c", source)
|