diff --git a/.changeset/config.json b/.changeset/config.json index 705d3f31..c0899d7f 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -10,5 +10,8 @@ "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": [], + "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { + "updateInternalDependents": "always" + } } diff --git a/.changeset/strong-readers-help.md b/.changeset/strong-readers-help.md new file mode 100644 index 00000000..2a2b56ab --- /dev/null +++ b/.changeset/strong-readers-help.md @@ -0,0 +1,6 @@ +--- +"@raisins/stencil-docs-target": minor +"@raisins/schema": minor +--- + +Added support for feature enforcement tags on components diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3c70312c..ca175bbb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,4 +11,11 @@ ## Publishing -- Deploys are done manually for each package with independent versioning. +Deploys are managed with [changesets] + +- Use `npx changeset` to add a changeset entry describing a change made. + - _Be sure to mark any packages relying on the changed package to have a `patch` bump. If a package does not have a changeset, it will not get a version bump._ +- Run `npx changeset version` to preview the updates that will occur. + - __Do not commit this preview. The automatic PR will take care of this when it is time to publish.__ +- Once everything looks good, changes will be merged to the `main` branch, and an automatic PR will be created by changesets. +- Merging this automatic PR will officially update all package versions appropriately and publish the necessary packages. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c3f6f6ab..0fe5f080 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38852,7 +38852,7 @@ "version": "1.1.3", "license": "MIT", "dependencies": { - "@raisins/schema": "^1.0.0", + "@raisins/schema": "^1.0.1", "color2k": "^2.0.0", "css": "^3.0.0", "css-select": "^5.1.0", @@ -38986,7 +38986,8 @@ "license": "MIT", "dependencies": { "@raisins/core": "^1.1.3", - "@raisins/schema": "^1.0.0", + "@raisins/schema": "^1.0.1", + "@storybook/cli": "^7.0.21", "bunshi": "~2.0.2", "css-tree": "^1.1.3", "fast-equals": "^5.0.1", @@ -43623,7 +43624,7 @@ "version": "1.0.1", "license": "MIT", "dependencies": { - "@raisins/schema": "1.0.1" + "@raisins/schema": "^1.0.1" }, "devDependencies": { "@eslint/js": "^8.57.0", @@ -48365,7 +48366,7 @@ "@raisins/core": { "version": "file:packages/core", "requires": { - "@raisins/schema": "^1.0.0", + "@raisins/schema": "^1.0.1", "@saasquatch/scoped-autobindsteps": "^1.0.0", "@shoelace-style/react": "^2.0.0-beta.52", "@size-limit/preset-small-lib": "^5.0.4", @@ -48469,7 +48470,7 @@ "@eslint/js": "^8.57.0", "@mdx-js/react": "^2.1.1", "@raisins/core": "^1.1.3", - "@raisins/schema": "^1.0.0", + "@raisins/schema": "^1.0.1", "@size-limit/preset-small-lib": "^5.0.4", "@storybook/addons": "^7.0.21", "@storybook/cli": "^7.0.21", @@ -51803,7 +51804,7 @@ "version": "file:packages/stencil-docs-target", "requires": { "@eslint/js": "^8.57.0", - "@raisins/schema": "1.0.1", + "@raisins/schema": "^1.0.1", "@size-limit/preset-small-lib": "^5.0.4", "@stencil/core": "^2.8.1", "@types/jest": "^27.0.2", diff --git a/packages/core/package.json b/packages/core/package.json index ef19f7ef..b70bb1c1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -73,7 +73,7 @@ "typescript": "^3.9.10" }, "dependencies": { - "@raisins/schema": "^1.0.0", + "@raisins/schema": "^1.0.1", "color2k": "^2.0.0", "css": "^3.0.0", "css-select": "^5.1.0", diff --git a/packages/react/package.json b/packages/react/package.json index 274ce8a9..2b2f2e51 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -54,8 +54,9 @@ } ], "dependencies": { + "@storybook/cli": "^7.0.21", "@raisins/core": "^1.1.3", - "@raisins/schema": "^1.0.0", + "@raisins/schema": "^1.0.1", "bunshi": "~2.0.2", "css-tree": "^1.1.3", "fast-equals": "^5.0.1", diff --git a/packages/schema/schema.d.ts b/packages/schema/schema.d.ts index 99250753..79dff74c 100644 --- a/packages/schema/schema.d.ts +++ b/packages/schema/schema.d.ts @@ -92,6 +92,16 @@ export interface CustomElement { */ exampleGroup?: string; + /** + * Array of meaningful tags to enforce feature use within the raisins editor + */ + requiredFeatures?: string[]; + + /** + * Text to display in a tooltip when the element is disabled due to feature enforcement. + */ + featureTooltip?: string; + /** * States for previewing the internal state of components */ @@ -208,6 +218,16 @@ export interface Attribute { * If required is set to true this attribute must not be undefined. */ required?: boolean; + + /** + * Array of meaningful tags to enforce feature use within the raisins editor. + */ + requiredFeatures?: string[]; + + /** + * Text to display in a tooltip when the attribute is disabled due to feature enforcement. + */ + featureTooltip?: string; } export interface ComponentState { diff --git a/packages/stencil-docs-target/package.json b/packages/stencil-docs-target/package.json index 1adaf6b1..4c596f78 100644 --- a/packages/stencil-docs-target/package.json +++ b/packages/stencil-docs-target/package.json @@ -66,6 +66,6 @@ }, "homepage": "https://github.com/saasquatch/raisins", "dependencies": { - "@raisins/schema": "1.0.1" + "@raisins/schema": "^1.0.1" } } diff --git a/packages/stencil-docs-target/src/convertToRaisins.ts b/packages/stencil-docs-target/src/convertToRaisins.ts index b80ae4ef..7f8d2b3d 100644 --- a/packages/stencil-docs-target/src/convertToRaisins.ts +++ b/packages/stencil-docs-target/src/convertToRaisins.ts @@ -50,6 +50,8 @@ export function convertToGrapesJSMeta(docs: JsonDocs): schema.Module { // uiGroupSwitch: tagValue(p.docsTags, 'uiGroupSwitch'), uiOrder: jsonTagValue(p, 'uiOrder'), required: required(p), + requiredFeatures: jsonTagValue(p, 'requiredFeatures'), + featureTooltip: tagValue(p.docsTags, 'featureTooltip'), }; return attr; @@ -60,6 +62,8 @@ export function convertToGrapesJSMeta(docs: JsonDocs): schema.Module { title: uiName(comp) ?? comp.tag, slots: jsonTagValue(comp, 'slots') as schema.Slot[], attributes, + requiredFeatures: jsonTagValue(comp, 'requiredFeatures'), + featureTooltip: tagValue(comp.docsTags, 'featureTooltip'), exampleGroup: tagValue(comp.docsTags, 'exampleGroup'), examples: comp.docsTags .filter(d => d.name === 'example')