Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 42 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,18 @@ on:
- main
pull_request:
jobs:
ci:
name: "Lint and Test"
lint_test:
name: Lint and Test
runs-on: ubuntu-latest
steps:
# Install protoc for e2e:setup
- uses: arduino/setup-protoc@v2
with:
version: "24.4"
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
version: "23.4"
- uses: bufbuild/buf-setup-action@v1.25.0
- uses: tatethurston/github-actions/test@main
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: (cd packages/protoscript && pnpm package:build)
# run again to link bin that is now available after package:build
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm test:ci && pnpm codecov --token=$CODECOV_TOKEN
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
codecov_token: ${{ secrets.CODECOV_TOKEN }}
- name: Check for uncommited changes to generated files
run: |
pnpm regen
Expand All @@ -39,3 +29,39 @@ jobs:
echo "Failing build."
exit 1
fi
build_package:
name: Build Package
runs-on: ubuntu-latest
outputs:
package-name: package-${{ github.event.pull_request.number }}
steps:
- uses: tatethurston/github-actions/build@main
- name: NPM Pack
run: |
cd packages/protoscript
pnpm pack
mv *.tgz protoscript.tgz
- uses: actions/upload-artifact@v4
with:
name: package-${{ github.event.pull_request.number }}
path: packages/protoscript/*.tgz
if-no-files-found: error
retention-days: 1
overwrite: true
check_windows:
name: Windows CI Check
runs-on: windows-latest
needs: build_package
steps:
- uses: arduino/setup-protoc@v2
with:
version: "23.4"
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_package.outputs.package-name }}
- uses: actions/setup-node@v3
- name: Bin Check
run: |
npm install protoscript.tgz
touch dummy.proto
npx --no protoscript
17 changes: 5 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
name: Publish NPM Package
on:
release:
types: [created]
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: tatethurston/github-actions/publish@main
with:
node-version-file: ".nvmrc"
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
- run: pnpm install --frozen-lockfile
- run: cp README.md LICENSE CHANGELOG.md packages/protoscript
- run: cd packages/protoscript && pnpm package:build && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package_directory: packages/protoscript
npm_token: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.0.21

- Fix compiler path on Windows.

## v0.0.20

- Preserve protoscript import when well known types are imported. This corrects a regression in 0.0.19.
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@
}
},
"scripts": {
"build": "(pnpm package:copy:files && cd packages/protoscript && pnpm package:build)",
"build:wellknowntypes": "(cd ./packages/well-known-types && GENERATE_KNOWN_TYPES=1 pnpm protoscript && cp google/protobuf/* ../protoscript/src/runtime/well-known-types/)",
"e2e:build": "pnpm --filter './e2e/*' run build",
"e2e:protoscript": "pnpm --filter './e2e/*' exec protoscript",
"e2e:setup": "pnpm e2e:build && pnpm e2e:protoscript",
"examples:regen": "pnpm --filter './examples/*' exec protoscript",
"lint": "pnpm typecheck && prettier --check . && prettier-package-json --list-different '{,e2e/*,examples/*,packages/*,}package.json' && eslint .",
"lint:fix": "prettier --write . && prettier-package-json --write '{,e2e/*,examples/*,packages/*}package.json' && eslint --fix .",
"package:copy:files": "cp ./LICENSE ./README.md packages/protoscript",
"prepare": "husky install",
"regen": "pnpm build:wellknowntypes && pnpm examples:regen && pnpm e2e:protoscript",
"test": "jest",
"test:ci": "pnpm run e2e:setup && pnpm run test --coverage",
"test:ci": "pnpm install --frozen-lockfile && pnpm run e2e:setup && pnpm run test --coverage",
"typecheck": "pnpm --recursive run typecheck"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/protoscript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "protoscript",
"version": "0.0.20",
"version": "0.0.21",
"description": "A Protobuf runtime and code generation tool for JavaScript and TypeScript",
"license": "MIT",
"author": "Tate <tatethurston@gmail.com>",
Expand Down
2 changes: 1 addition & 1 deletion packages/protoscript/src/compiler.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
node .\node_modules\protoscript\compiler.js %*
node .\node_modules\protoscript\dist\compiler.js %*
3 changes: 1 addition & 2 deletions packages/protoscript/src/runtime/well-known-types/any.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ export interface Any {
*
* Note: this functionality is not currently available in the official
* protobuf release, and it is not used for type URLs beginning with
* type.googleapis.com. As of May 2023, there are no widely used type server
* implementations and no plans to implement one.
* type.googleapis.com.
*
* Schemes other than `http`, `https` (or the empty scheme) might be
* used with implementation specific semantics.
Expand Down
Loading