Skip to content

Commit

Permalink
build package
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Jan 28, 2025
1 parent c4e138c commit 4aa4fbc
Show file tree
Hide file tree
Showing 27 changed files with 3,331 additions and 756 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ runs:
shell: bash
run: |
cd common/plugin_transpiler
pnpm install --frozen-lockfile --filter @posthog/plugin-transpiler
pnpm install --frozen-lockfile --filter @posthog/plugin-transpiler...
pnpm run build
- name: Install Python dependencies
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ jobs:
- name: Build and install frontend build dependencies
if: needs.changes.outputs.shouldTriggerCypress == 'true'
run: |
pnpm install --frozen-lockfile --filter @posthog/frontend
pnpx nx deps:prepare frontend --verbose
pnpm install --frozen-lockfile --filter @posthog/frontend...
pnpx nx deps:build frontend --verbose
- name: Stop/Start stack with Docker Compose
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ jobs:
- name: Build and install frontend build dependencies
if: needs.changes.outputs.frontend == 'true'
run: |
pnpm install --frozen-lockfile --filter @posthog/frontend
pnpx nx deps:prepare frontend --verbose
pnpm install --frozen-lockfile --filter @posthog/frontend...
pnpx nx deps:build frontend --verbose
- name: Check formatting with prettier
Expand Down Expand Up @@ -157,8 +156,7 @@ jobs:
- name: Build and install frontend build dependencies
if: needs.changes.outputs.frontend == 'true'
run: |
pnpm install --frozen-lockfile --filter @posthog/frontend
pnpx nx deps:prepare frontend --verbose
pnpm install --frozen-lockfile --filter @posthog/frontend...
pnpx nx deps:build frontend --verbose
- name: Test with Jest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-hog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
node-version: 18
registry-url: https://registry.npmjs.org
- name: Install package.json dependencies
run: cd common/hogvm/typescript && pnpm install --filter @posthog/hogvm
run: cd common/hogvm/typescript && pnpm install --filter @posthog/hogvm...
- name: Publish the package in the npm registry
run: cd common/hogvm/typescript && npm publish --access public
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-plugin-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
cache: pnpm

- name: Install package.json dependencies with pnpm
run: pnpm install --frozen-lockfile --filter @posthog/plugin-server
run: pnpm install --frozen-lockfile --filter @posthog/plugin-server...

- name: Check formatting with prettier
run: pnpm prettier:check
Expand Down Expand Up @@ -259,8 +259,8 @@ jobs:
if: needs.changes.outputs.plugin-server == 'true'
run: |
cd plugin-server
pnpm install --frozen-lockfile --filter @posthog/plugin-server
pnpm build
pnpm install --frozen-lockfile --filter @posthog/plugin-server...
pnpx nx build plugin-server --verbose
- name: Wait for Clickhouse, Redis & Kafka
if: needs.changes.outputs.plugin-server == 'true'
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/storybook-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ jobs:

- name: Install dependencies and Chromatic
run: |
pnpm install --frozen-lockfile --filter @posthog/frontend
pnpx nx deps:prepare frontend --verbose
pnpm install --frozen-lockfile --filter @posthog/frontend...
pnpx nx deps:build frontend --verbose
pnpm i -D chromatic
Expand Down Expand Up @@ -120,8 +119,7 @@ jobs:

- name: Build and install frontend build dependencies
run: |
pnpm install --frozen-lockfile --filter @posthog/frontend
pnpx nx deps:prepare frontend --verbose
pnpm install --frozen-lockfile --filter @posthog/frontend...
pnpx nx deps:build frontend --verbose
- name: Install CI utilities with pnpm
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ COPY patches/ patches/
ENV PNPM_HOME /tmp/pnpm-store
RUN corepack enable && pnpm --version && \
mkdir /tmp/pnpm-store && \
pnpm install --frozen-lockfile --filter @posthog/frontend --store-dir /tmp/pnpm-store --prod && \
pnpx nx deps:prepare frontend --verbose && \
pnpm install --frozen-lockfile --filter @posthog/frontend... --store-dir /tmp/pnpm-store --prod && \
pnpx nx deps:build frontend --verbose && \
rm -rf /tmp/pnpm-store

Expand Down Expand Up @@ -74,8 +73,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/* && \
corepack enable && \
mkdir /tmp/pnpm-store && \
pnpm install --frozen-lockfile --filter @posthog/plugin-server --store-dir /tmp/pnpm-store && \
pnpx nx deps:prepare plugin-server --verbose && \
pnpm install --frozen-lockfile --filter @posthog/plugin-server... --store-dir /tmp/pnpm-store && \
pnpx nx deps:build plugin-server --verbose && \
rm -rf /tmp/pnpm-store

Expand All @@ -92,7 +90,7 @@ RUN pnpx nx build --verbose
# as we will copy it to the last image.
RUN corepack enable && \
mkdir /tmp/pnpm-store && \
pnpm install --frozen-lockfile --filter @posthog/plugin-server --store-dir /tmp/pnpm-store --prod && \
pnpm install --frozen-lockfile --filter @posthog/plugin-server... --store-dir /tmp/pnpm-store --prod && \
rm -rf /tmp/pnpm-store


Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.playwright
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY patches/ patches/

ENV CYPRESS_INSTALL_BINARY=0

RUN pnpm install --frozen-lockfile --filter @posthog/frontend
RUN pnpm install --frozen-lockfile --filter @posthog/frontend...

COPY playwright.config.ts webpack.config.js babel.config.js tsconfig.json test-runner-jest.config.js test-runner-jest-environment.js ./

Expand Down
Binary file added Dockerfile.ps
Binary file not shown.
3 changes: 2 additions & 1 deletion bin/docker-frontend
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ set -e

export WEBPACK_HOT_RELOAD_HOST="0.0.0.0"

pnpm install --filter @posthog/frontend
pnpm install --filter @posthog/frontend...
pnpx deps:build frontend
pnpm start-docker
3 changes: 2 additions & 1 deletion bin/start-frontend
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ set -e
# In particular, DEBUG=1 enables a lot of Tailwind logging we don't need, so let's set 0 instead
export DEBUG=0

pnpm install --filter @posthog/frontend
pnpm install --filter @posthog/frontend...
pnpx deps:build frontend
pnpm start
3 changes: 3 additions & 0 deletions common/build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This folder contains build tools for the PostHog monorepo.

Soon we will move <root>/package.json to .../frontend/package.json, and move this to the root folder.
13 changes: 13 additions & 0 deletions common/build/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "@posthog/build",
"version": "1.0.0",
"description": "PostHog monorepo build tools",
"packageManager": "[email protected]",
"scripts": {},
"author": "PostHog <[email protected]>",
"license": "MIT",
"dependencies": {
"@nx/web": "20.3.1",
"nx": "20.3.1"
}
}
Loading

0 comments on commit 4aa4fbc

Please sign in to comment.