Skip to content

Commit

Permalink
Release workflow added
Browse files Browse the repository at this point in the history
  • Loading branch information
vikas-cldcvr committed Oct 10, 2022
1 parent 9168850 commit 3ab62c5
Show file tree
Hide file tree
Showing 21 changed files with 746 additions and 70 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/eight-badgers-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cldcvr/flow-core": major
---

Beta version to test changeset
22 changes: 0 additions & 22 deletions .github/workflows/publish.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches:
- vikas/public-package
paths:
- '**/package.json'

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2

- name: Setup Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
"storybook": "start-storybook -p 6007",
"start": "yarn storybook",
"build-storybook": "build-storybook",
"prebuild-flow-core": "cd packages/custom-elements-manifest-vue && yarn build",
"prebuild-flow-core": "cd packages/custom-elements-manifest-to-types && yarn build",
"build-flow-core": "cd packages/flow-core && yarn compile",
"build-lib": "yarn build-flow-core",
"build-types-generator": "cd packages/custom-elements-manifest-to-types && yarn build",
"build-packages": "yarn build-types-generator && yarn build-flow-core",
"release": "yarn build-packages && yarn changeset publish",
"prepare": "husky install",
"test": "yarn loki test"
},
Expand Down Expand Up @@ -59,5 +61,8 @@
"mobile": false
}
}
},
"dependencies": {
"@changesets/cli": "^2.25.0"
}
}
3 changes: 3 additions & 0 deletions packages/custom-elements-manifest-to-types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# custom-elements-manifest-to-types

Utility which converts [custom-elements-manifest](https://github.com/webcomponents/custom-elements-manifest) into Vue2,Vue3, React template type definitions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Package } from "custom-elements-manifest/schema";
import { transformSchema } from "../index";
import customElements1 from "./custom-elements1.json";

describe("custom-elements-manifest-vue", () => {
describe("custom-elements-manifest-to-types", () => {
it("transforms custom-elemenets-1.json schema", () => {
expect(transformSchema(customElements1 as Package, "vue2")).toMatchInlineSnapshot(`
"/* eslint-disable */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "custom-elements-manifest-vue",
"name": "@cldcvr/custom-elements-manifest-to-types",
"version": "1.0.0",
"main": "dist/index.js",
"license": "MIT",
Expand All @@ -16,6 +16,7 @@
},
"scripts": {
"test": "jest --clearCache",
"build": "tsc"
"build": "tsc",
"prepublishOnly": "yarn build"
}
}
3 changes: 0 additions & 3 deletions packages/custom-elements-manifest-vue/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion packages/flow-core/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ HERE=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$HERE"

yarn analyze
cd "../custom-elements-manifest-vue"
cd "../custom-elements-manifest-to-types"
yarn build
cd .. && cd "./flow-core"

Expand Down
40 changes: 20 additions & 20 deletions packages/flow-core/custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -1941,52 +1941,52 @@
},
{
"kind": "javascript-module",
"path": "src/modules/config/index.ts",
"declarations": [
{
"kind": "variable",
"name": "ConfigUtil",
"type": {
"text": "object"
},
"default": "{\n getConfig() {\n return config;\n },\n setConfig(cfg: Partial<FlowCoreConfig>) {\n config = { ...config, ...cfg };\n if (cfg.theme) {\n this.initTheme();\n }\n },\n initTheme() {\n const themeStyleElement = document.querySelector(\n `style[id^=\"flow-theme-${config.theme}\"]`\n );\n if (!themeStyleElement) {\n const themeElement = initThemeTag();\n\n if (themeElement) {\n const themeCSS = getThemeStyle(\n `[flow-element][theme=\"${config.theme}\"]`\n );\n\n if (themeCSS) {\n themeElement.appendChild(document.createTextNode(themeCSS));\n } else {\n console.error(\n `Theme ${config.theme} CSS file/selector not found! \\n Please check if css is imported 'import \"@cldcvr/flow-core/dist/style.css\"'`\n );\n }\n }\n }\n },\n}"
}
],
"path": "src/mixins/svg/loader.ts",
"declarations": [],
"exports": [
{
"kind": "js",
"name": "ConfigUtil",
"name": "default",
"declaration": {
"name": "ConfigUtil",
"module": "src/modules/config/index.ts"
"module": "src/mixins/svg/loader.ts"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/mixins/svg/loader.ts",
"path": "src/mixins/svg/notFound.ts",
"declarations": [],
"exports": [
{
"kind": "js",
"name": "default",
"declaration": {
"module": "src/mixins/svg/loader.ts"
"module": "src/mixins/svg/notFound.ts"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/mixins/svg/notFound.ts",
"declarations": [],
"path": "src/modules/config/index.ts",
"declarations": [
{
"kind": "variable",
"name": "ConfigUtil",
"type": {
"text": "object"
},
"default": "{\n getConfig() {\n return config;\n },\n setConfig(cfg: Partial<FlowCoreConfig>) {\n config = { ...config, ...cfg };\n if (cfg.theme) {\n this.initTheme();\n }\n },\n initTheme() {\n const themeStyleElement = document.querySelector(\n `style[id^=\"flow-theme-${config.theme}\"]`\n );\n if (!themeStyleElement) {\n const themeElement = initThemeTag();\n\n if (themeElement) {\n const themeCSS = getThemeStyle(\n `[flow-element][theme=\"${config.theme}\"]`\n );\n\n if (themeCSS) {\n themeElement.appendChild(document.createTextNode(themeCSS));\n } else {\n console.error(\n `Theme ${config.theme} CSS file/selector not found! \\n Please check if css is imported 'import \"@cldcvr/flow-core/dist/style.css\"'`\n );\n }\n }\n }\n },\n}"
}
],
"exports": [
{
"kind": "js",
"name": "default",
"name": "ConfigUtil",
"declaration": {
"module": "src/mixins/svg/notFound.ts"
"name": "ConfigUtil",
"module": "src/modules/config/index.ts"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion packages/flow-core/generate-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const vue3TypesFileName = `${__dirname}/dist/types/vue3.ts`;
const vue2TypesFileName = `${__dirname}/dist/types/vue2.ts`;
const reactTypesFileName = `${__dirname}/dist/types/react.ts`;

const { transformSchema } = require("custom-elements-manifest-vue");
const { transformSchema } = require("./../custom-elements-manifest-to-types");

const vue2Types = transformSchema(customElementsJSON, "vue2", "./src/index");
const vue3Types = transformSchema(customElementsJSON, "vue3", "./src/index");
Expand Down
12 changes: 9 additions & 3 deletions packages/flow-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cldcvr/flow-core",
"version": "1.0.0-beta5",
"version": "1.0.0-beta11",
"description": "Core package of flow design system",
"module": "dist/flow-core.es.js",
"main": "dist/flow-core.cjs.js",
Expand Down Expand Up @@ -57,12 +57,18 @@
},
"repository": {
"type": "git",
"url": "https://github.com/cldcvr/flow-core.git",
"url": "git+ssh://github.com/cldcvr/flow-core.git",
"directory": "packages/flow-core"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org"
},
"customElements": "custom-elements.json"
"customElements": "custom-elements.json",
"bugs": {
"url": "https://github.com/cldcvr/flow-core/issues"
},
"homepage": "https://github.com/cldcvr/flow-core#readme",
"author": "",
"license": "MIT"
}
Loading

0 comments on commit 3ab62c5

Please sign in to comment.