Skip to content

Commit

Permalink
Merge pull request #248 from Shopify/rework-yaml-loading
Browse files Browse the repository at this point in the history
Add built-time validation to region yamls in TS
  • Loading branch information
kennygoff authored Jul 8, 2024
2 parents 8876e25 + bf28729 commit ee2cd36
Show file tree
Hide file tree
Showing 22 changed files with 485 additions and 165 deletions.
5 changes: 5 additions & 0 deletions lang/typescript/.changeset/rework-yaml-loading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/worldwide': minor
---

Rework yaml loading, add build-time validation, redudce bundle size
5 changes: 3 additions & 2 deletions lang/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ pnpm build

This will use Rollup to generate `dist/`, which is our bundled JS package.

Verify the npm package is bundled correctly with [publint](https://publint.dev/). This should only need to be done when changing `rollup.config.ts` to modify the bundle output:
Verify the npm package is bundled correctly with [publint](https://publint.dev/) or [are the types wrong](https://arethetypeswrong.github.io/). This should only need to be done when changing `rollup.config.ts` to modify the bundle output:

```sh
npx publint
pnpm package:publint
pnpm package:attw
```

### Other commands
Expand Down
12 changes: 8 additions & 4 deletions lang/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@
"build": "rollup -c rollup.config.ts --configPlugin typescript --bundleConfigAsCjs",
"clean": "rimraf ./dist",
"typecheck": "tsc --noEmit",
"lint": "eslint src *.config.ts",
"format": "prettier src *.config.ts --write",
"lint": "eslint src rollup-plugin-regions-yaml *.config.ts",
"format": "prettier src rollup-plugin-regions-yaml *.config.ts --write",
"test": "vitest run --config vitest.config.ts",
"test:watch": "vitest",
"release": "pnpm build && changeset publish --no-git-tag"
"release": "pnpm build && changeset publish --no-git-tag",
"package:publint": "npx publint",
"package:attw": "attw $(npm pack) && rimraf shopify-worldwide-*.tgz"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.15.3",
"@babel/core": "^7.24.5",
"@changesets/cli": "^2.27.3",
"@rollup/plugin-typescript": "^11.1.6",
Expand All @@ -61,7 +64,8 @@
"rollup-plugin-dts": "^6.1.1",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"vitest": "^1.6.0",
"zod": "^3.23.8"
},
"prettier": "@shopify/prettier-config"
}
Loading

0 comments on commit ee2cd36

Please sign in to comment.