Skip to content

Commit

Permalink
Merge pull request #8 from iamvishnusankar/development
Browse files Browse the repository at this point in the history
Remove deepmerge and added @corex/deepmerge
  • Loading branch information
iamvishnusankar committed Aug 10, 2020
2 parents 140dccf + f8a0b92 commit e90ffd2
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 14 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test
on:
pull_request:
branches:
- master
- development

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Github Checkout
uses: actions/checkout@v2
- name: Install & Build & Test
run: |
yarn install --production=false
yarn lint
yarn test
env:
NODE_ENV: test
CI: true
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.next
public
dist
13 changes: 13 additions & 0 deletions azure-pipeline/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,16 @@ steps:
- bash: |
yarn ywc publish
displayName: Publish Packages
# Github Release
- task: GitHubRelease@1
displayName: Github Release
inputs:
gitHubConnection: 'iamvishnusankar'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v$(Build.BuildNumber)'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'
2 changes: 1 addition & 1 deletion packages/next-sitemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"lint": "tsc --noEmit --declaration"
},
"dependencies": {
"deepmerge": "^4.2.2"
"@corex/deepmerge": "^2.2.7"
}
}
10 changes: 4 additions & 6 deletions packages/next-sitemap/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs'
import allPath from '../path'
import { IConfig } from '../interface'
import deepmerge from 'deepmerge'
import merge from '@corex/deepmerge'

export const defaultConfig: Partial<IConfig> = {
rootDir: 'public',
Expand All @@ -20,12 +20,10 @@ export const defaultConfig: Partial<IConfig> = {
},
}

const overwriteMerge = (_: any[], sourceArray: any[], __: any) => sourceArray

export const withDefaultConfig = (config: Partial<IConfig>) =>
deepmerge(defaultConfig, config, {
arrayMerge: overwriteMerge,
})
merge([defaultConfig, config], {
arrayMergeType: 'overwrite',
}) as IConfig

export const loadConfig = (): IConfig => {
if (fs.existsSync(allPath.CONFIG_FILE)) {
Expand Down
10 changes: 4 additions & 6 deletions packages/next-sitemap/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"extends": "../../tsconfig.workspace.json",
"extends": "@corex/tsconfig",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"noEmit": false,
"module": "CommonJS",
"target": "ESNext"
}
"outDir": "dist"
},
"include": ["src"]
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8934,4 +8934,4 @@ yargs@^15.3.1:
string-width "^4.2.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^18.1.2"
yargs-parser "^18.1.2"

0 comments on commit e90ffd2

Please sign in to comment.