Skip to content

Commit

Permalink
Merge pull request #1 from codetker/feat/optimize
Browse files Browse the repository at this point in the history
fix: 修复"Workspaces can only be enabled in private projects"的报错
  • Loading branch information
codetker authored Sep 9, 2024
2 parents fdeb303 + ad15e89 commit 3392d27
Show file tree
Hide file tree
Showing 8 changed files with 2,824 additions and 2,701 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/mr_publish_alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,49 @@ on:
branches:
- main
types: [opened, synchronize, reopened]

jobs:
publish-alpha:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository # insure repo
permissions:
contents: write
packages: write

steps:
# - name: Display debug information # to debug
# run: |
# echo "Current GitHub context:"
# echo "${{ toJson(github) }}"

- name: Checkout Branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: npx yarn

- name: Setup git userName
run: git config user.name 'codetker'
run: git config user.name 'yukilzw'

- name: Setup git userEmail
run: git config user.email 'codetker@sina.com'
run: git config user.email 'liuzhanwei@bytedance.com'

- name: Lerna Version alpha
run: npx lerna version prerelease --preid=alpha --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Lerna Publish Alpha
run: npx lerna publish from-package --dist-tag alpha --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 19 additions & 3 deletions .github/workflows/mr_run_jest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Jest

env:
ACTIONS_STEP_DEBUG: true

on:
pull_request:
branches:
Expand All @@ -11,19 +14,32 @@ jobs:
runs-on: ubuntu-latest

steps:
# - name: Display debug information # to debug
# run: |
# echo "Current GitHub context:"
# echo "${{ toJson(github) }}"

- name: Checkout Branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
# with:
# ref: ${{github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: "https://registry.npmjs.org"

- name: Cache node modules
uses: actions/cache@v4
with:
path: ~/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: npx yarn

- name: Run Jest
run: npx yarn test
run: npx yarn test --coverage
19 changes: 9 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
name: Publish Release
name: Publish Release

on:
push:
branches:
- main

jobs:

publish-release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- name: Checkout Branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Setup Node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: npx yarn

- name: Setup git userName
run: git config --global user.name 'codetker'
run: git config user.name 'yukilzw'

- name: Setup git userEmail
run: git config --global user.email 'codetker@sina.com'
run: git config user.email 'liuzhanwei@bytedance.com'

- name: Lerna Version
run: npx lerna version patch --yes
Expand All @@ -44,4 +43,4 @@ jobs:
run: npx lerna publish from-package --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
registry="https://registry.npmjs.org/"
registry="https://registry.npmjs.org/"

# registry "https://registry.npm.taobao.org" # Set this if you want to use taobao registry or install failed
3 changes: 3 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
registry "https://registry.npmjs.org/"

# registry "https://registry.npm.taobao.org" # Set this if you want to use taobao registry or install failed
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "a11y-cloud",
"private": true,
"workspaces": [
"packages/*",
"examples/*"
Expand Down
4 changes: 1 addition & 3 deletions packages/a11y-web-sdk/__tests__/sdk.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { MarkSDK } = require('../src/index');
import { codeGenerate } from '../../src/a11y-webpack-loader/code-generate';
import { codeGenerate } from '../../a11y-webpack-loader/src/code-generate';

test('renders initial test', () => {
const markSDK = new MarkSDK({
Expand All @@ -10,7 +10,6 @@ test('renders initial test', () => {
expect(markSDK.wsIO).toBeDefined();
});


const commonOptions = {
customProperty: 'a11y',
customIdProperty: `a11y-id`,
Expand Down Expand Up @@ -236,4 +235,3 @@ describe('code generate test', () => {
});`);
});
});

Loading

0 comments on commit 3392d27

Please sign in to comment.