@@ -44,6 +44,12 @@ install -m 0755 "$OUTPUT/npm/artifacts/jsonschema-$VERSION-windows-x86_64/bin/js
44
44
" $OUTPUT /npm/staging/jsonschema-windows-x86_64.exe"
45
45
install -m 0644 " $( pwd) /README.markdown" " $OUTPUT /npm/staging/README.md"
46
46
47
+ # To boost NPM ranking
48
+ # See https://github.com/npms-io/npms-analyzer/blob/master/lib/analyze/evaluate/quality.js
49
+ install -m 0644 " $( pwd) /LICENSE" " $OUTPUT /npm/staging/LICENSE"
50
+ install -m 0644 " $( pwd) /.gitignore" " $OUTPUT /npm/staging/.gitignore"
51
+ echo " /build" > " $OUTPUT /npm/staging/.npmignore"
52
+
47
53
cat << EOF > "$OUTPUT /npm/staging/package.json"
48
54
{
49
55
"name": "@sourcemeta/jsonschema",
@@ -53,14 +59,28 @@ cat << EOF > "$OUTPUT/npm/staging/package.json"
53
59
"bin": {
54
60
"jsonschema": "cli.js"
55
61
},
62
+ "scripts": {
63
+ "test": "eslint cli.js && node cli.js"
64
+ },
56
65
"license": "AGPL-3.0",
57
66
"homepage": "https://github.com/sourcemeta/jsonschema",
58
- "author": "Juan Cruz Viotti <[email protected] >",
67
+ "author": {
68
+
69
+ "name": "Sourcemeta",
70
+ "url": "https://wwwsourcemeta.com"
71
+ },
72
+ "os": [ "darwin", "linux", "win32" ],
73
+ "cpu": [ "x64", "arm64" ],
74
+ "engines": {
75
+ "node": ">=16"
76
+ },
77
+ "funding": "https://github.com/sponsors/sourcemeta",
59
78
"keywords": [
60
79
"jsonschema", "json", "schema", "json-schema",
61
80
"cli", "\$ ref", "dereference", "reference", "resolve",
62
- "json-pointer", "validator", "bundle",
63
- "lint", "format"
81
+ "json-pointer", "validator", "validation", "bundle",
82
+ "json-schema-validator", "json-schema-validation",
83
+ "lint", "format", "draft"
64
84
],
65
85
"bugs": {
66
86
"url": "https://github.com/sourcemeta/jsonschema/issues"
@@ -71,6 +91,11 @@ cat << EOF > "$OUTPUT/npm/staging/package.json"
71
91
},
72
92
"publishConfig": {
73
93
"access": "public"
94
+ },
95
+ "devDependencies": {
96
+ "@eslint/js": "^9.23.0",
97
+ "eslint": "^9.23.0",
98
+ "globals": "^16.0.0"
74
99
}
75
100
}
76
101
EOF
@@ -103,10 +128,29 @@ const result = child_process.spawnSync(EXECUTABLE,
103
128
process.exit(result.status);
104
129
EOF
105
130
106
- # (3) Try packaging
131
+ cat << 'EOF ' > "$OUTPUT/npm/staging/eslint.config.mjs"
132
+ import { defineConfig } from "eslint/config";
133
+ import globals from "globals";
134
+ import js from "@eslint/js";
135
+
136
+ export default defineConfig([
137
+ { files: ["**/*.{js,mjs,cjs}"] },
138
+ { files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } },
139
+ { files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.node } },
140
+ { files: ["**/*.{js,mjs,cjs}"], plugins: { js }, extends: ["js/recommended"] },
141
+ ]);
142
+ EOF
143
+
144
+ # (3) Run checks
145
+ cd " $OUTPUT /npm/staging"
146
+ npm install
147
+ npm test
148
+ cd -
149
+
150
+ # (4) Try packaging
107
151
cd " $OUTPUT /npm"
108
152
npm pack ./staging
109
153
cd -
110
154
111
- # (4 ) Deploy to NPM
155
+ # (5 ) Deploy to NPM
112
156
npm publish " $OUTPUT /npm/staging"
0 commit comments