Skip to content

Commit

Permalink
feat: Add publish script (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian authored May 21, 2019
1 parent 3e07403 commit a8a1dd6
Show file tree
Hide file tree
Showing 18 changed files with 811 additions and 89 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist
node_modules
schemas/**/LICENSE
schemas/**/README.md
updated_files
24 changes: 24 additions & 0 deletions bin/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

UPDATE_FILE="updated_files"

set -e

cd "${0%/*}/../" || exit 1

if ! command -v "npm" > /dev/null; then
echo "npm not found. Exiting."
exit 1
fi

if ! npm whoami > /dev/null; then
echo "Error while checking npm authentication"
exit 1
fi

while IFS= read -r DIR; do
(
cd "./schemas/${DIR}" || exit 1
npm publish --access=public
)
done < "${UPDATE_FILE}"
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"schemastore-updater": "dist/cli.js"
},
"dependencies": {
"cli-interact": "0.1.9",
"commander": "2.20.0",
"fs-extra": "8.0.1",
"json-schema-to-typescript": "6.1.3",
Expand All @@ -15,7 +14,6 @@
"devDependencies": {
"@ffflorian/prettier-config": "0.0.4",
"@ffflorian/tslint-config": "0.2.1",
"@types/cli-interact": "0.1.0",
"@types/fs-extra": "7.0.0",
"@types/jsonabc": "2.3.1",
"@types/node": "~12",
Expand Down
226 changes: 226 additions & 0 deletions schemas/azure-iot-edge-deployment-2.0/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/

export type ModuleType = "docker";
export type CreateOptions = string;
export type Status = "running" | "stopped";
export type RestartPolicy = "never" | "on-failure" | "on-unhealthy" | "always";

export interface JSONSchemaForAzureIoTEdgeDeploymentVersion20 {
modulesContent: TheConfigurationForAllTheModules;
}
export interface TheConfigurationForAllTheModules {
$edgeAgent: ConfigurationForTheEdgeAgentModule;
$edgeHub: ConfigurationForTheEdgeHubModule;
/**
* This interface was referenced by `TheConfigurationForAllTheModules`'s JSON-Schema definition
* via the `patternProperty` "^[a-zA-Z0-9_-]+$".
*/
[k: string]: {
"properties.desired": {
[k: string]: any;
};
};
}
export interface ConfigurationForTheEdgeAgentModule {
"properties.desired": {
schemaVersion: string;
runtime: {
type: ModuleType;
settings: {
minDockerVersion?: string;
loggingOptions?: string;
registryCredentials?: {
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^.+$".
*/
[k: string]: {
username: string;
password: string;
address: string;
[k: string]: any;
};
};
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]:
| any[]
| boolean
| number
| null
| {
[k: string]: any;
}
| string;
};
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]:
| any[]
| boolean
| number
| null
| {
[k: string]: any;
}
| string;
};
systemModules: {
edgeAgent: {
type: ModuleType;
settings: ModuleSettings;
env?: Env;
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]:
| any[]
| boolean
| number
| null
| {
[k: string]: any;
}
| string;
};
edgeHub: TheEdgehubSchema;
};
modules: {
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[a-zA-Z0-9_-]+$".
*/
[k: string]: {
version?: string;
type: ModuleType;
status: Status;
restartPolicy: RestartPolicy;
env?: Env;
settings: ModuleSettings;
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]:
| any[]
| boolean
| number
| null
| {
[k: string]: any;
}
| string;
};
};
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]:
| any[]
| boolean
| number
| null
| {
[k: string]: any;
}
| string;
};
}
export interface ModuleSettings {
image: string;
createOptions?: CreateOptions;
/**
* This interface was referenced by `ModuleSettings`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]:
| any[]
| boolean
| number
| null
| {
[k: string]: any;
}
| string;
}
export interface Env {
/**
* This interface was referenced by `Env`'s JSON-Schema definition
* via the `patternProperty` "^[^\+#$\s\.]+$".
*/
[k: string]: {
value: number | string | boolean;
};
}
export interface TheEdgehubSchema {
type: ModuleType;
settings: ModuleSettings;
env?: Env;
status: Status;
restartPolicy: RestartPolicy;
/**
* This interface was referenced by `TheEdgehubSchema`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]:
| any[]
| boolean
| number
| null
| {
[k: string]: any;
}
| string;
}
export interface ConfigurationForTheEdgeHubModule {
"properties.desired": {
schemaVersion: string;
routes: {
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]: string;
};
storeAndForwardConfiguration?: {
timeToLiveSecs: number;
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]:
| any[]
| boolean
| number
| null
| {
[k: string]: any;
}
| string;
};
/**
* This interface was referenced by `undefined`'s JSON-Schema definition
* via the `patternProperty` "^[^\.\$# ]+$".
*/
[k: string]:
| any[]
| boolean
| number
| null
| {
[k: string]: any;
}
| string;
};
}
14 changes: 14 additions & 0 deletions schemas/azure-iot-edge-deployment-2.0/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"author": "Florian Keller <github@floriankeller.de>",
"dependencies": {},
"description": "TypeScript definitions for azure-iot-edge-deployment-2.0.",
"license": "MIT",
"main": "index.d.ts",
"name": "@schemastore/azure-iot-edge-deployment-2.0",
"repository": "https://github.com/ffflorian/schemastore-updater/tree/master/schemas/azure-iot-edge-deployment-2.0",
"scripts": {},
"typesPublisherContentHash": "0470fece2144520043a259102c1303e9e4ac7a3d4b675710087887762640d1a3",
"types": "index.d.ts",
"version": "0.0.1",
"typeScriptVersion": "2.2"
}
Loading

0 comments on commit a8a1dd6

Please sign in to comment.