Skip to content

Commit

Permalink
fix: test parcel
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Aug 11, 2022
1 parent 599cd1e commit 8c8c633
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@
"src"
],
"scripts": {
"prebuild": "npm run clean",
"build": "tsdx build --tsconfig ./tsconfig.tsdx.json && parcel build",
"prebuild": "npm run clean && node scripts/preParcel.js",
"build": "npm run tsdx build && parcel build",
"clean": "rimraf lib",
"coverage": "npm test -- --coverage",
"dev": "next",
"format": "npm run prettier -- --write . && eslint --fix .",
"lint": "eslint --max-warnings 0 .",
"prepublishOnly": "npm run lint && npm run build && npm test",
"prepublishOnly": "npm run lint && npm run build && node scripts/postParcel",
"prettier": "npx prettier --ignore-path .gitignore",
"test": "jest",
"tsdx": "tsdx --tsconfig ./tsconfig.tsdx.json",
"type-check": "tsc --noEmit"
},
"browserslist": "chrome 59, safari 11, firefox 56, edge 14, ie 11",
Expand Down Expand Up @@ -96,10 +97,10 @@
"write-file-atomic": "^4.0.1"
},
"peerDependencies": {
"next": "^12.2",
"next": "^12.2.4",
"react": "^16.3 || ^17 || ^18",
"sanity": "dev-preview",
"styled-components": "^5.2.0"
"sanity": "^3.0.0-dev-preview.12",
"styled-components": "^5.3.5"
},
"engines": {
"node": ">=12"
Expand Down
3 changes: 2 additions & 1 deletion scripts/postParcel.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ async function main() {
console.log('Writing package.json...')
await writeFileAtomic(
path.resolve(__dirname, '../package.json'),
JSON.stringify(pkg, null, 2),
// eslint-disable-next-line prefer-template
JSON.stringify(pkg, null, 2) + '\n',
'utf8'
)
console.log('Finished!')
Expand Down
9 changes: 5 additions & 4 deletions scripts/preParcel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ async function main() {
const pkg = require('../package.json')
console.log('Modifying...')
Object.assign(pkg.peerDependencies, {
next: pkg.dependencies.next,
sanity: pkg.dependencies.sanity,
'styled-components': pkg.dependencies['styled-components'],
next: pkg.devDependencies.next,
sanity: pkg.devDependencies.sanity,
'styled-components': pkg.devDependencies['styled-components'],
})
console.log('Writing package.json...')
await writeFileAtomic(
path.resolve(__dirname, '../package.json'),
JSON.stringify(pkg, null, 2),
// eslint-disable-next-line prefer-template
JSON.stringify(pkg, null, 2) + '\n',
'utf8'
)
console.log('Finished!')
Expand Down

1 comment on commit 8c8c633

@vercel
Copy link

@vercel vercel bot commented on 8c8c633 Aug 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

next-sanity – ./

next-sanity.sanity.build
next-sanity-git-main.sanity.build
next.sanity.build

Please sign in to comment.