Skip to content

Commit

Permalink
chore: Extract core and reference the extracted package (#1497)
Browse files Browse the repository at this point in the history
  • Loading branch information
builditben authored Mar 1, 2023
1 parent f15193c commit 5346da0
Show file tree
Hide file tree
Showing 32 changed files with 46 additions and 1,521 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
- run: pnpm distribute ../api.planx.uk
working-directory: core
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: api.planx.uk
Expand Down Expand Up @@ -162,8 +160,6 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
- run: pnpm distribute ../${{ env.EDITOR_DIRECTORY }}
working-directory: core
- run: pnpm install --frozen-lockfile
working-directory: ${{ env.EDITOR_DIRECTORY }}
- run: pnpm build
Expand Down Expand Up @@ -194,9 +190,6 @@ jobs:
node-version: ${{ env.NODE_VERSION }}
cache: "pnpm"
cache-dependency-path: "**/pnpm-lock.yaml"
- run: pnpm distribute ../${{ env.EDITOR_DIRECTORY }}
if: steps.cache-react-build-assets.outputs.cache-hit != 'true'
working-directory: core
- run: pnpm install --frozen-lockfile
if: steps.cache-react-build-assets.outputs.cache-hit != 'true'
working-directory: ${{ env.EDITOR_DIRECTORY }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm install -g pnpm@${{ env.PNPM_VERSION }}
- run: pnpm distribute ../editor.planx.uk
working-directory: core
- run: pnpm install --frozen-lockfile
working-directory: editor.planx.uk
- run: pnpm build
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/push-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- run: npm install -g pnpm@${{ env.PNPM_VERSION }}
- run: pnpm distribute ../editor.planx.uk
working-directory: core
- run: pnpm install --frozen-lockfile
working-directory: editor.planx.uk
- run: pnpm build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ planx-new is a monorepo containing our full application stack. Here's a quick su

1. Clone this repository. You'll need to get some additional environment variable files that aren't published here. Find instructions for copying these in 1password under the AWS Staging IAM user role entry

1. Run `pnpm docker:up` from the project root to get everything (postgres, sharedb, api and hasura server processes) up and running and `pnpm docker:down` to stop all services. `pnpm docker:down-hard` will remove volumes (i.e. database data) and can be a useful hard reset when necessary.
1. Run `pnpm docker:up` from the project root to get everything (postgres, sharedb, api and hasura server processes) up and running and `pnpm docker:down` to stop all services. `pnpm docker:destroy` will remove volumes (i.e. database data) and can be a useful hard reset when necessary.

1. Move into the hasura directory `cd ../hasura.planx.uk` & install dependencies `pnpm i`.

Expand Down
5 changes: 0 additions & 5 deletions api.planx.uk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ RUN apk add --no-cache git # required for fetching git dependencies
WORKDIR /api
RUN npm install -g [email protected]

# install cachable shared package
COPY shared ./shared
RUN pnpm install ./shared/core*
RUN cd node_modules/core && pnpm install && pnpm build

# update package cache using lockfile
# see https://pnpm.io/cli/fetch
COPY pnpm-lock.yaml ./
Expand Down
3 changes: 2 additions & 1 deletion api.planx.uk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Run tests `pnpm test`

Development notes:

- if you need to test or pull new changes from @opensystemslab/planx-document-templates, make sure to update the commit hash in package.json first
- if you need to test or pull new changes from @opensystemslab/planx-document-templates or @opensystemslab/planx-core, make sure to update the commit hash in package.json first
- you can also use `pnpm link {{local relative path to @opensystemslab/planx-document-templates or @opensystemslab/planx-core}}` to manage local development changes these packages without having to reinstall. If you do this, remember to also run `pnpm unlink` to unlink the local directory and then also update the commit hash to point to the most recent version of the package.

## Prior art

Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CoreDomainClient } from "core";
import { CoreDomainClient } from "@opensystemslab/planx-core";
/**
* core doesn't expose a graphql interface like the graphql/hasura clients do
* instead, they encapsulates query and business logic to only expose declarative interfaces
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"@airbrake/node": "^2.1.7",
"@opensystemslab/planx-core": "git://github.com/theopensystemslab/planx-core.git#5e932c3",
"@opensystemslab/planx-document-templates": "git://github.com/theopensystemslab/planx-document-templates#e0642be",
"adm-zip": "^0.5.9",
"aws-sdk": "^2.1180.0",
Expand Down Expand Up @@ -35,7 +36,6 @@
"passport": "^0.5.3",
"passport-google-oauth20": "^2.0.0",
"pino-noir": "^2.2.1",
"core": "file:shared/core-1.0.0.tgz",
"slack-notify": "^2.0.3",
"string-to-stream": "^3.0.1"
},
Expand Down
12 changes: 7 additions & 5 deletions api.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed api.planx.uk/shared/core-1.0.0.tgz
Binary file not shown.
19 changes: 0 additions & 19 deletions core/.eslintrc

This file was deleted.

2 changes: 0 additions & 2 deletions core/.gitignore

This file was deleted.

12 changes: 0 additions & 12 deletions core/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions core/package.json

This file was deleted.

Loading

0 comments on commit 5346da0

Please sign in to comment.