@appthreat/caxa 0.0.1 → 0.0.3
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/package.json +4 -2
- package/stubs/stub--darwin--arm64 +0 -0
- package/stubs/stub--darwin--x64 +0 -0
- package/stubs/stub--linux--arm +0 -0
- package/stubs/stub--linux--arm64 +0 -0
- package/stubs/stub--linux--x64 +0 -0
- package/stubs/stub--win32--x64 +0 -0
- package/.github/workflows/main.yml +0 -46
- package/examples/echo-command-line-parameters/index.mjs +0 -1
- package/examples/false/index.mjs +0 -1
- package/examples/native-modules/index.mjs +0 -50
- package/examples/native-modules/package-lock.json +0 -1028
- package/examples/native-modules/package.json +0 -8
- package/examples/web-application/package-lock.json +0 -1190
- package/examples/web-application/package.json +0 -14
- package/examples/web-application/source/index.mts +0 -11
- package/examples/web-application/tsconfig.json +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appthreat/caxa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Package Node.js applications into executable binaries",
|
|
5
5
|
"author": "Team AppThreat <cloud@appthreat.com>",
|
|
6
6
|
"homepage": "https://github.com/appthreat/caxa",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
],
|
|
18
18
|
"exports": "./build/index.mjs",
|
|
19
19
|
"types": "./build/index.d.mts",
|
|
20
|
-
"bin":
|
|
20
|
+
"bin": {
|
|
21
|
+
"caxa": "./build/index.mjs"
|
|
22
|
+
},
|
|
21
23
|
"scripts": {
|
|
22
24
|
"prepare": "cd ./source/ && tsc",
|
|
23
25
|
"prepare:stubs": "shx rm -f stubs/stub--win32--x64 && cross-env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags \"-s -w -extldflags=-Wl,-z,now,-z,relro\" -o stubs/stub--win32--x64 stubs/stub.go && shx echo >> stubs/stub--win32--x64 && shx echo CAXACAXACAXA >> stubs/stub--win32--x64 && shx rm -f stubs/stub--darwin--x64 && cross-env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags \"-s -w -extldflags=-Wl,-z,now,-z,relro\" -o stubs/stub--darwin--x64 stubs/stub.go && shx echo >> stubs/stub--darwin--x64 && shx echo CAXACAXACAXA >> stubs/stub--darwin--x64 && shx rm -f stubs/stub--darwin--arm64 && cross-env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags \"-s -w -extldflags=-Wl,-z,now,-z,relro\" -o stubs/stub--darwin--arm64 stubs/stub.go && shx echo >> stubs/stub--darwin--arm64 && shx echo CAXACAXACAXA >> stubs/stub--darwin--arm64 && shx rm -f stubs/stub--linux--x64 && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags \"-s -w -extldflags=-Wl,-z,now,-z,relro\" -o stubs/stub--linux--x64 stubs/stub.go && shx echo >> stubs/stub--linux--x64 && shx echo CAXACAXACAXA >> stubs/stub--linux--x64 && shx rm -f stubs/stub--linux--arm64 && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags \"-s -w -extldflags=-Wl,-z,now,-z,relro\" -o stubs/stub--linux--arm64 stubs/stub.go && shx echo >> stubs/stub--linux--arm64 && shx echo CAXACAXACAXA >> stubs/stub--linux--arm64 && shx rm -f stubs/stub--linux--arm && cross-env CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -ldflags \"-s -w -extldflags=-Wl,-z,now,-z,relro\" -o stubs/stub--linux--arm stubs/stub.go && shx echo >> stubs/stub--linux--arm && shx echo CAXACAXACAXA >> stubs/stub--linux--arm",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
name: npm test and release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
- release/*
|
|
8
|
-
tags:
|
|
9
|
-
- 'v*'
|
|
10
|
-
workflow_dispatch:
|
|
11
|
-
|
|
12
|
-
env:
|
|
13
|
-
REGISTRY: ghcr.io
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
test:
|
|
17
|
-
strategy:
|
|
18
|
-
matrix:
|
|
19
|
-
os: [windows, macos, ubuntu]
|
|
20
|
-
node-version: [20, 21]
|
|
21
|
-
runs-on: ${{ matrix.os }}-latest
|
|
22
|
-
steps:
|
|
23
|
-
- uses: actions/checkout@v4
|
|
24
|
-
- uses: actions/setup-node@v4
|
|
25
|
-
with:
|
|
26
|
-
node-version: ${{ matrix.node-version }}
|
|
27
|
-
- run: npm install-ci-test
|
|
28
|
-
|
|
29
|
-
npm-publish:
|
|
30
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
31
|
-
needs: test
|
|
32
|
-
runs-on: ubuntu-latest
|
|
33
|
-
permissions:
|
|
34
|
-
contents: read
|
|
35
|
-
packages: write
|
|
36
|
-
id-token: write
|
|
37
|
-
steps:
|
|
38
|
-
- uses: actions/checkout@v4
|
|
39
|
-
- uses: actions/setup-node@v4
|
|
40
|
-
with:
|
|
41
|
-
node-version: 21.x
|
|
42
|
-
registry-url: https://registry.npmjs.org/
|
|
43
|
-
- run: npm ci && npm publish --access=public --@cyclonedx:registry='https://registry.npmjs.org'
|
|
44
|
-
env:
|
|
45
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
46
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log(JSON.stringify(process.argv.slice(2), undefined, 2));
|
package/examples/false/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
process.exit(1);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import os from "node:os";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import fs from "fs-extra";
|
|
4
|
-
import cryptoRandomString from "crypto-random-string";
|
|
5
|
-
import { Database, sql } from "@leafac/sqlite";
|
|
6
|
-
import sharp from "sharp";
|
|
7
|
-
|
|
8
|
-
const temporaryDirectory = path.join(
|
|
9
|
-
os.tmpdir(),
|
|
10
|
-
"caxa/examples/native-modules",
|
|
11
|
-
cryptoRandomString({ length: 10, type: "alphanumeric" }).toLowerCase()
|
|
12
|
-
);
|
|
13
|
-
await fs.ensureDir(temporaryDirectory);
|
|
14
|
-
|
|
15
|
-
const database = new Database(path.join(temporaryDirectory, "database.db"));
|
|
16
|
-
database.migrate(
|
|
17
|
-
sql`CREATE TABLE "caxaExampleNativeModules" ("example" TEXT);`
|
|
18
|
-
);
|
|
19
|
-
database.run(
|
|
20
|
-
sql`INSERT INTO "caxaExampleNativeModules" ("example") VALUES (${"caxa native modules"})`
|
|
21
|
-
);
|
|
22
|
-
console.log(
|
|
23
|
-
"@leafac/sqlite:",
|
|
24
|
-
JSON.stringify(
|
|
25
|
-
database.get(
|
|
26
|
-
sql`
|
|
27
|
-
SELECT "example" FROM "caxaExampleNativeModules"
|
|
28
|
-
`
|
|
29
|
-
),
|
|
30
|
-
undefined,
|
|
31
|
-
2
|
|
32
|
-
)
|
|
33
|
-
);
|
|
34
|
-
database.close();
|
|
35
|
-
|
|
36
|
-
const imageFile = path.join(temporaryDirectory, "image.png");
|
|
37
|
-
await fs.writeFile(
|
|
38
|
-
imageFile,
|
|
39
|
-
await sharp({
|
|
40
|
-
create: {
|
|
41
|
-
width: 48,
|
|
42
|
-
height: 48,
|
|
43
|
-
channels: 4,
|
|
44
|
-
background: { r: 255, g: 0, b: 0, alpha: 0.5 },
|
|
45
|
-
},
|
|
46
|
-
})
|
|
47
|
-
.png()
|
|
48
|
-
.toBuffer()
|
|
49
|
-
);
|
|
50
|
-
console.log("sharp:", (await sharp(imageFile).metadata()).width);
|