@appthreat/caxa 0.0.2 → 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 +1 -1
- package/.github/workflows/main.yml +0 -54
- 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,54 +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: |
|
|
28
|
-
npm ci
|
|
29
|
-
npm test
|
|
30
|
-
npm run prepare
|
|
31
|
-
npm run prepare:stubs
|
|
32
|
-
|
|
33
|
-
npm-publish:
|
|
34
|
-
if: startsWith(github.ref, 'refs/tags/')
|
|
35
|
-
needs: test
|
|
36
|
-
runs-on: ubuntu-latest
|
|
37
|
-
permissions:
|
|
38
|
-
contents: read
|
|
39
|
-
packages: write
|
|
40
|
-
id-token: write
|
|
41
|
-
steps:
|
|
42
|
-
- uses: actions/checkout@v4
|
|
43
|
-
- uses: actions/setup-node@v4
|
|
44
|
-
with:
|
|
45
|
-
node-version: 21.x
|
|
46
|
-
registry-url: https://registry.npmjs.org/
|
|
47
|
-
- run: |
|
|
48
|
-
npm ci
|
|
49
|
-
npm run prepare
|
|
50
|
-
npm run prepare:stubs
|
|
51
|
-
npm publish --access=public --@cyclonedx:registry='https://registry.npmjs.org'
|
|
52
|
-
env:
|
|
53
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
54
|
-
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);
|