Skip to content

Commit

Permalink
chore(anu-monorepo): add edge release channel script (jd-solanki#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpreston321 authored Jan 2, 2023
1 parent d29d613 commit 65d555d
Show file tree
Hide file tree
Showing 12 changed files with 958 additions and 350 deletions.
144 changes: 112 additions & 32 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,138 @@
name: Check build on various systems and node versions
name: CI

on:
push:
paths-ignore:
- "docs/**"
branches: main
pull_request:
paths-ignore:
- "docs/**"
branches: main

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node-version: [16.x, 18.x]
os: [ubuntu-latest, windows-latest]
node: [16]

timeout-minutes: 10

name: Node ${{ matrix.node-version }} on ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
uses: pnpm/action-setup@v2
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
node-version: ${{ matrix.node }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Build ANU
run: pnpm build

- name: Cache dist
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
path: packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [16]

timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install
- name: Build anu
run: pnpm run build

- name: Run unit tests
run: npm run test -- --reporter=junit --outputFile=../../test-results.xml
run: pnpm run --filter=anu-vue test --reporter=junit --outputFile=../../test-results.xml

- name: Add tests results to artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: test-results-${{ runner.os }}-${{ matrix.node-version }}
name: test-results-${{ runner.os }}-${{ matrix.node }}
path: test-results.xml

lint:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [16]

timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint

build-release:
if: |
github.event_name == 'push' &&
!contains(github.event.head_commit.message, '[skip-release]') &&
!contains(github.event.head_commit.message, 'chore') &&
!contains(github.event.head_commit.message, 'docs')
needs:
- build
- test
- lint
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [16]

timeout-minutes: 20

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Restore dist cache
uses: actions/cache@v3
with:
path: packages/*/dist
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}

- name: Release Edge
run: ./scripts/release-edge.sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@typescript-eslint/parser": "^5.47.0",
"@vue-macros/volar": "^0.5.6",
"bumpp": "^8.2.1",
"defu": "^6.1.1",
"eslint": "^8.30.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-import-resolver-typescript": "^3.5.2",
Expand All @@ -38,8 +39,11 @@
"fast-glob": "^3.2.12",
"fs-extra": "^11.1.0",
"globby": "^13.1.3",
"jiti": "^1.16.0",
"pathe": "^1.0.0",
"pnpm": "^7.19.0",
"rimraf": "^3.0.2",
"semver": "^7.3.8",
"taze": "^0.8.5",
"tsx": "^3.12.1",
"typescript": "^4.9.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/anu-vue/src/components/alert/AAlert.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import type { ExtractPropTypes } from 'vue'
import { useInternalBooleanState } from '@/composables/useInternalBooleanState'
import { useLayer, useProps as useLayerProps } from '@/composables/useLayer'
import { configurable as configurableProp, spacing as spacingProp } from '@/composables/useProps'
import { useSpacing } from '@/composables/useSpacing'
import type { ExtractPropTypes } from 'vue'
const props = defineProps({
spacing: spacingProp,
Expand Down
4 changes: 2 additions & 2 deletions packages/anu-vue/src/components/card/ACard.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import { ATypography } from '../typography'
import { cardProps } from './props'
import { isTypographyUsed } from '@/components/typography/utils'
import { ConfigurableValue, useConfigurable } from '@/composables/useConfigurable'
import { useLayer } from '@/composables/useLayer'
import { useSpacing } from '@/composables/useSpacing'
import { ATypography } from '../typography'
import { cardProps } from './props'
const props = defineProps(cardProps)
Expand Down
8 changes: 4 additions & 4 deletions packages/anu-vue/src/components/menu/AMenu.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts" setup>
import { ACard } from '@/components'
import { useInternalBooleanState } from '@/composables/useInternalBooleanState'
import { useTeleport } from '@/composables/useTeleport'
import type { Middleware, Placement, Strategy } from '@floating-ui/dom'
import { autoUpdate, computePosition, flip, shift } from '@floating-ui/dom'
import { onClickOutside, useEventListener, useMounted } from '@vueuse/core'
import type { PropType } from 'vue'
import { getCurrentInstance, nextTick, onBeforeUnmount, onMounted, ref, Teleport, Transition, watch } from 'vue'
import { Teleport, Transition, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
import { sameWidth as sameWidthMiddleware } from './middlewares'
import { useTeleport } from '@/composables/useTeleport'
import { useInternalBooleanState } from '@/composables/useInternalBooleanState'
import { ACard } from '@/components'
const props = defineProps({
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/anu-vue/src/components/typography/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ConfigurableValue } from '@/composables/useConfigurable'
import type { Ref, Slots, ToRef } from 'vue'
import type { TypographyProps } from './props'
import type { ConfigurableValue } from '@/composables/useConfigurable'

export const isTypographyUsed = (props: { [K in keyof TypographyProps]: ToRef<TypographyProps[K]> }, slots: Slots) => {
const { title, subtitle, text } = props
Expand Down
7 changes: 4 additions & 3 deletions packages/anu-vue/src/composables/useGroupModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export function useGroupModel<T>(params: ComposableParams<T>) {
// If multiple selection is enabled
if (unref(multi)) {
// If value is not set (Means previously multi was false) => Initialize new set and assign it to value
if (!(value.value instanceof Set)) { value.value = new Set([option]) }

// Else toggle option in set
if (!(value.value instanceof Set)) {
value.value = new Set([option])
}
else {
// Else toggle option in set
if (value.value.has(option))
value.value.delete(option)
else value.value.add(option)
Expand Down
4 changes: 3 additions & 1 deletion packages/anu-vue/src/composables/useLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export const useLayer = () => {
classes.push('typography-subtitle-opacity-100 typography-text-opacity-100')

// Add classes based on variant
if (propVariant === 'text') { classes.push('text-$a-layer-color') }
if (propVariant === 'text') {
classes.push('text-$a-layer-color')
}
else {
if (propVariant === 'fill')
classes.push('bg-$a-layer-color')
Expand Down
Loading

0 comments on commit 65d555d

Please sign in to comment.