From fcd25e3ca58f0a7031c1c496380058f7a40f3390 Mon Sep 17 00:00:00 2001 From: caele Date: Mon, 15 Jan 2024 13:04:03 +0100 Subject: [PATCH] chore: specs and stuff --- .github/workflows/build.yml | 2 +- api-spec/props.conf.js | 48 ++++++++++++++++++++ api-specifications/properties.json | 72 ++++++++++++++++++++++++++++++ core/package.json | 6 ++- src/ext/initial-properties.js | 12 ++++- src/old_index.js | 28 ------------ src/utils/initialize.js | 2 +- 7 files changed, 137 insertions(+), 33 deletions(-) create mode 100644 api-spec/props.conf.js create mode 100644 api-specifications/properties.json delete mode 100644 src/old_index.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13c652e..633eccb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ on: jobs: build: - uses: qlik-oss/sn-gh-workflows/.github/workflows/build.yaml@v1 + uses: qlik-oss/sn-gh-workflows/.github/workflows/build.yaml@v2 secrets: inherit with: release: ${{ inputs.release || false}} diff --git a/api-spec/props.conf.js b/api-spec/props.conf.js new file mode 100644 index 0000000..f888b23 --- /dev/null +++ b/api-spec/props.conf.js @@ -0,0 +1,48 @@ +const path = require("path"); + +const pkg = require(path.resolve(__dirname, "../package.json")); // eslint-disable-line + +module.exports = { + fromJsdoc: { + glob: ["./src/ext/initial-properties.js"], + api: { + stability: "stable", + visibility: "public", + properties: { + "x-qlik-visibility": "public", + }, + name: `${pkg.name}:properties`, + version: pkg.version, + description: "Variance waterfall generic object definition", + }, + output: { + sort: { + alpha: false, + }, + file: "./api-specifications/properties.json", + }, + parse: { + types: { + GenericObjectProperties: { + url: "https://qlik.dev/apis/json-rpc/qix/schemas#%23%2Fdefinitions%2Fschemas%2Fentries%2FGenericObjectProperties", + }, + undefined: {}, + "EngineAPI.ValueExpression": { + url: "https://qlik.dev/apis/json-rpc/qix/schemas#%23%2Fdefinitions%2Fschemas%2Fentries%2FValueExpression", + }, + "EngineAPI.HyperCubeDef": { + url: "https://qlik.dev/apis/json-rpc/qix/schemas#%23%2Fdefinitions%2Fschemas%2Fentries%2FListObjectDef", + }, + }, + }, + }, + toDts: { + spec: "./api-specifications/properties.json", + output: { + file: "./types/index.d.ts", + }, + dependencies: { + references: ["qlik-engineapi"], + }, + }, +}; diff --git a/api-specifications/properties.json b/api-specifications/properties.json new file mode 100644 index 0000000..759592a --- /dev/null +++ b/api-specifications/properties.json @@ -0,0 +1,72 @@ +{ + "scriptappy": "1.1.0", + "info": { + "name": "@nebula/sn-variance-waterfall:properties", + "description": "Variance waterfall generic object definition", + "version": "0.0.1", + "license": "MIT", + "stability": "stable", + "x-qlik-visibility": "public" + }, + "entries": { + "properties": { + "extends": [ + { + "type": "GenericObjectProperties" + } + ], + "entries": { + "version": { + "description": "Current version of this generic object definition", + "type": "string" + }, + "qHyperCubeDef": { + "description": "Extends `HyperCubeDef`, see Engine API: `HyperCubeDef`.", + "extends": [ + { + "type": "EngineAPI.HyperCubeDef" + } + ], + "kind": "object" + }, + "showTitles": { + "optional": true, + "defaultValue": false, + "type": "boolean" + }, + "title": { + "optional": true, + "defaultValue": "", + "type": "string" + }, + "subtitle": { + "optional": true, + "defaultValue": "", + "type": "string" + }, + "footnote": { + "optional": true, + "defaultValue": "", + "type": "string" + }, + "disableNavMenu": { + "optional": true, + "defaultValue": false, + "type": "boolean" + }, + "showDetails": { + "optional": true, + "defaultValue": true, + "type": "boolean" + }, + "showDetailsExpression": { + "optional": true, + "defaultValue": false, + "type": "boolean" + } + }, + "kind": "object" + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/core/package.json b/core/package.json index 5ec4cee..161a2a0 100644 --- a/core/package.json +++ b/core/package.json @@ -1,6 +1,10 @@ { "module": "esm/index.js", "peerDependencies": { - "@nebula.js/stardust": ">=2.0.0" + "@nebula.js/stardust": ">=4.6.1", + "hammerjs": "^2.0.8", + "picasso-plugin-hammer": ">=2.2.5", + "picasso-plugin-q": ">=2.2.5", + "picasso.js": ">=2.2.5" } } diff --git a/src/ext/initial-properties.js b/src/ext/initial-properties.js index 2df4833..227d5fb 100644 --- a/src/ext/initial-properties.js +++ b/src/ext/initial-properties.js @@ -1,12 +1,18 @@ // TODO: Fill in the rest of the json spec -export default { +/** + * @type {object} + * @extends {GenericObjectProperties} + * @entry + */ +const properties = { /** * Current version of this generic object definition * @type {string} */ version: process.env.PACKAGE_VERSION, /** - * @typedef + * Extends `HyperCubeDef`, see Engine API: `HyperCubeDef`. + * @extends {EngineAPI.HyperCubeDef} */ qHyperCubeDef: { qDimensions: [], @@ -105,3 +111,5 @@ export default { dock: "near", }, }; + +export default properties; \ No newline at end of file diff --git a/src/old_index.js b/src/old_index.js deleted file mode 100644 index f092958..0000000 --- a/src/old_index.js +++ /dev/null @@ -1,28 +0,0 @@ -import initialProperties from "./legacy/initial-properties.js"; -import template from "./template.html"; -import definition from "./legacy/definition.js"; -import controller from "./legacy/controller.js"; -import paint from "./legacy/paint.js"; -import resize from "./legacy/resize.js"; -import support from "./legacy/support.js"; -import { initVarianceCube } from "./legacy/dataset.js"; - -export default { - initialProperties: initialProperties, - template: template, - support: support, - definition: definition, - controller: controller, - paint: paint, - resize: resize, - setSnapshotData: async function (snapshotLayout) { - snapshotLayout.snapshotData.varianceCube = await initVarianceCube( - this, - snapshotLayout - ); - return snapshotLayout; - }, - clearSelectedValues() { - this.$scope.chartBrush.clear(); - }, -}; diff --git a/src/utils/initialize.js b/src/utils/initialize.js index f4ea048..110b6de 100644 --- a/src/utils/initialize.js +++ b/src/utils/initialize.js @@ -33,7 +33,7 @@ export default function init({ const chart = pic.chart({ element, updated: () => { - //$scope.updated = true; // NEED TO CHECK WHAT THESE ARE FOR? + //$scope.updated = true; // TODO: NEED TO CHECK WHAT THESE ARE FOR? }, beforeUpdated: () => { //$scope.updated = false;