-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Elmer Bulthuis
authored
Jul 31, 2024
1 parent
5893e20
commit bdd05a4
Showing
53 changed files
with
565 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = ["packages/cargo/jns42-core", "packages/cargo/jns42-generator"] | ||
members = ["packages/cargo/*"] | ||
|
||
[profile.release] | ||
lto = true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ allOf: | |
- properties: | ||
name: | ||
type: string | ||
examples: | ||
- name: Piet |
1 change: 1 addition & 0 deletions
1
fixtures/testing/models.json → fixtures/specifications/models.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": ["string", "boolean"], | ||
"examples": ["hi", true] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "string", | ||
"examples": "a" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/usr/bin/env node | ||
|
||
import cp from "child_process"; | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
const dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
const workspaceRoot = path.resolve(dirname); | ||
|
||
const options = { | ||
shell: true, | ||
stdio: "inherit", | ||
env: process.env, | ||
cwd: workspaceRoot, | ||
}; | ||
|
||
const packages = [ | ||
["schema-draft-04", "http://json-schema.org/draft-04/schema#"], | ||
// ["schema-draft-06", "http://json-schema.org/draft-06/schema#"], | ||
// ["schema-draft-07", "http://json-schema.org/draft-07/schema#"], | ||
// ["schema-draft-2019-09", "https://json-schema.org/draft/2019-09/schema"], | ||
["schema-draft-2020-12", "https://json-schema.org/draft/2020-12/schema"], | ||
// ["schema-swagger-v2", "http://swagger.io/v2/schema.json#/definitions/schema"], | ||
["schema-oas-v3-0", "https://spec.openapis.org/oas/3.0/schema/2021-09-28#/definitions/Schema"], | ||
["schema-oas-v3-1", "https://spec.openapis.org/oas/3.1/dialect/base"], | ||
["swagger-v2", "http://swagger.io/v2/schema.json#"], | ||
["oas-v3-0", "https://spec.openapis.org/oas/3.0/schema/2021-09-28"], | ||
["oas-v3-1", "https://spec.openapis.org/oas/3.1/schema/2022-10-07"], | ||
]; | ||
|
||
cp.execFileSync("cargo", ["build"], options); | ||
cp.execFileSync("npm", ["run", "--workspaces", "build"], options); | ||
|
||
for (const [name, location] of packages) { | ||
cp.execFileSync("cargo", [ | ||
"run", | ||
"--package", | ||
"jns42-generator", | ||
"package", | ||
location, | ||
"--package-directory", | ||
path.join(workspaceRoot, "generated", "cargo", name), | ||
"--package-name", | ||
name, | ||
"--package-version", | ||
"0.1.0", | ||
]); | ||
|
||
cp.execFileSync("node", [ | ||
path.join(workspaceRoot, "packages", "npm", "jns42-generator", "bundled", "program.js"), | ||
"package", | ||
location, | ||
"--package-directory", | ||
path.join(workspaceRoot, "generated", "npm", name), | ||
"--package-name", | ||
name, | ||
"--package-version", | ||
"0.1.0", | ||
]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cd $(dirname $0) | ||
|
||
export NODE_ENV=development | ||
|
||
set +e | ||
|
||
ERROR=0 | ||
|
||
export DIRECTORY=/tmp/jns42/$RANDOM | ||
|
||
for F in $(ls fixtures/specifications); do | ||
export N=${F%.*}; | ||
|
||
echo $N; | ||
|
||
if ! cargo run --package jns42-generator package \ | ||
fixtures/specifications/$F \ | ||
--package-directory $DIRECTORY/$N \ | ||
--package-name $N \ | ||
--package-version "0.0.0" \ | ||
; then | ||
ERROR=1; | ||
fi; | ||
|
||
if ! ( cd $DIRECTORY/$N ; cargo test); then | ||
ERROR=1; | ||
fi; | ||
|
||
done; | ||
|
||
rm -rf $DIRECTORY | ||
|
||
exit $ERROR | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cd $(dirname $0) | ||
|
||
export NODE_ENV=development | ||
|
||
npm run build --workspaces --if-present | ||
|
||
set +e | ||
|
||
ERROR=0 | ||
|
||
export DIRECTORY=/tmp/jns42/$RANDOM | ||
|
||
for F in $(ls fixtures/specifications); do | ||
export N=${F%.*}; | ||
|
||
echo $N; | ||
|
||
if ! node ./packages/npm/jns42-generator/bundled/program.js package \ | ||
fixtures/specifications/$F \ | ||
--package-directory $DIRECTORY/$N \ | ||
--package-name $N \ | ||
--package-version "0.0.0" \ | ||
; then | ||
ERROR=1; | ||
fi; | ||
|
||
if ! ( cd $DIRECTORY/$N ; npm install ; npm test); then | ||
ERROR=1; | ||
fi; | ||
|
||
done; | ||
|
||
rm -rf $DIRECTORY | ||
|
||
exit $ERROR |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.