Skip to content

Commit

Permalink
feat: aio app install command (complement to aio app pack) (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
shazron committed May 10, 2023
1 parent 2134f1e commit d520556
Show file tree
Hide file tree
Showing 19 changed files with 883 additions and 43 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"fixtureFile": true,
"fixtureJson": true,
"fixtureHjson": true,
"fixtureYaml": true,
"fakeFileSystem": true
},
"settings": {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"pure-http": "^3",
"serve-static": "^1.14.1",
"term-size": "^2.2.1",
"unzipper": "^0.10.11",
"upath": "^2",
"which": "^3.0.0",
"yeoman-environment": "^3.2.0"
Expand Down
157 changes: 157 additions & 0 deletions schema/app.config.yaml.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://adobe.io/schemas/app-builder/app.config.yaml.json/v1",
"type": "object",
"properties": {
"application": { "$ref": "#/definitions/application" },
"extensions": { "$ref": "#/definitions/extensions" }
},
"oneOf": [
{
"required": ["application"],
"allOf": [
{ "not": { "required": ["extensions"] } }
]
},
{
"required": ["extensions"],
"allOf": [
{ "not": { "required": ["application"] } }
]
}
],
"definitions": {
"application": {
"type": "object",
"properties": {
"runtimeManifest": { "$ref": "#/definitions/runtimeManifest" },
"actions": { "type": "string" },
"unitTest": { "type": "string" },
"e2eTest": { "type": "string" },
"dist": { "type": "string" },
"tvmurl": { "type": "string" },
"awsaccesskeyid": { "type": "string" },
"awssecretaccesskey": { "type": "string" },
"s3bucket": { "type": "string" },
"events": { "type": "object" },
"hostname": { "type": "string" },
"htmlcacheduration": { "type": "number" },
"jscacheduration": { "type": "number" },
"csscacheduration": { "type": "number" },
"imagecacheduration": { "type": "number" },
"hooks": { "$ref": "#/definitions/hooks" },
"web": { "$ref": "#/definitions/web" }
},
"required": ["runtimeManifest"]
},
"extensions": {
"type": "object",
"patternProperties": {
"^[A-Za-z0-9-_/\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff]{1,20}$": {
"$ref": "#/definitions/extension"
}
},
"additionalProperties": false
},
"extension": {
"type": "object",
"properties": {
"$include": { "type": "string" }
}
},
"web": {
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"response-headers": { "type": "object" }
}
}
]
},
"runtimeManifest": {
"type": "object",
"properties": {
"packages": { "$ref": "#/definitions/packages" }
},
"required": ["packages"]
},
"packages": {
"type": "object",
"patternProperties": {
"^[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff]{1,20}$": {
"$ref": "#/definitions/package"
}
},
"additionalProperties": false
},
"package": {
"type": "object",
"properties": {
"license": { "type": "string" },
"actions": { "$ref": "#/definitions/actions" }
}
},
"actions": {
"type": "object",
"patternProperties": {
"^[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff]{1,20}$": {
"$ref": "#/definitions/action"
}
},
"additionalProperties": false
},
"action": {
"type": "object",
"properties": {
"function": { "type": "string" },
"web": { "type": "string" },
"runtime": { "type": "string" },
"inputs": { "$ref": "#/definitions/inputs" },
"annotations": { "$ref": "#/definitions/annotations" }
},
"required": ["function", "runtime"]
},
"inputs": {
"type": "object",
"patternProperties": {
"^[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff]{1,20}$": {
"type": ["string", "boolean"]
}
},
"additionalProperties": false
},
"annotations": {
"type": "object",
"patternProperties": {
"^[A-Za-z0-9-_\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff]{1,20}$": {
"type": ["string", "boolean"]
}
},
"additionalProperties": false
},
"hooks": {
"type": "object",
"properties": {
"pre-app-build": { "type": "string" },
"post-app-build": { "type": "string" },
"build-actions": { "type": "string" },
"build-static": { "type": "string" },
"pre-app-deploy": { "type": "string" },
"post-app-deploy": { "type": "string" },
"deploy-actions": { "type": "string" },
"deploy-static": { "type": "string" },
"pre-app-undeploy": { "type": "string" },
"post-app-undeploy": { "type": "string" },
"undeploy-actions": { "type": "string" },
"undeploy-static": { "type": "string" },
"pre-app-run": { "type": "string" },
"post-app-run": { "type": "string" },
"serve-static": { "type": "string" }
}
}
}
}
107 changes: 107 additions & 0 deletions schema/deploy.yaml.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://adobe.io/schemas/app-builder/deploy.yaml.json/v1",
"type": "object",
"properties": {
"application": { "$ref": "#/definitions/application" },
"workspaces": { "$ref": "#/definitions/workspaces" },
"meshConfig": { "$ref": "#/definitions/meshConfig" },
"extensions": { "$ref": "#/definitions/extensions" },
"apis": { "$ref": "#/definitions/apis" },
"runtime": {
"type": "boolean",
"default": true
}
},
"required": ["application", "workspaces", "runtime"],
"definitions": {
"application": {
"type": "object",
"properties": {
"id": { "type": "string" },
"version": { "type": "string" }
},
"required": ["id", "version"]
},
"workspaces": {
"type": "array",
"items": { "$ref": "#/definitions/workspace" },
"default": []
},
"meshConfig": {
"type": "object",
"properties": {
"meshConfig": { "$ref": "#/definitions/meshConfigNested" },
"meshId": {
"type": "string"
},
"lastUpdatedBy": { "type": "object" },
"lastUpdated": {
"type": "string",
"pattern": "(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)((-(\\d{2}):(\\d{2})|Z)?)"
},
"meshStatus": { "type": "string" }
},
"required": ["meshConfig", "meshId"]
},
"meshConfigNested": {
"type": "object",
"properties": {
"sources": {
"type": "array",
"items": { "$ref": "#/definitions/meshConfigSource" },
"default": []
}
}
},
"meshConfigSource": {
"type": "object",
"properties": {
"name": { "type": "string" },
"handler": { "$ref": "#/definitions/meshConfigSourceHandler" }
},
"required": ["name", "handler"]
},
"meshConfigSourceHandler": {
"type": "object",
"properties": {
"graphql": { "$ref": "#/definitions/graphql" }
}
},
"graphql": {
"type": "object",
"properties": {
"handler": {
"type": "string",
"format": "uri"
}
}
},
"workspace": {
"type": "string",
"pattern": "^[A-Za-z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff]{1,20}$"
},
"extensions": {
"type": "array",
"items": { "$ref": "#/definitions/extension" }
},
"extension": {
"type": "object",
"properties": {
"extensionPointId": { "type": "string" }
},
"required": ["extensionPointId"]
},
"apis": {
"type": "array",
"items": { "$ref": "#/definitions/api" }
},
"api": {
"type": "object",
"properties": {
"code": { "type": "string" }
},
"required": ["code"]
}
}
}
19 changes: 19 additions & 0 deletions schema/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright 2023 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

const { USER_CONFIG_FILE, DEPLOY_CONFIG_FILE, IMPORT_CONFIG_FILE } = require('../src/lib/defaults')

module.exports = {
[IMPORT_CONFIG_FILE]: require('./config.schema.json'),
[USER_CONFIG_FILE]: require('./app.config.yaml.schema.json'),
[DEPLOY_CONFIG_FILE]: require('./deploy.yaml.schema.json')
}
Loading

0 comments on commit d520556

Please sign in to comment.