Skip to content

Commit

Permalink
Merge pull request #7 from pubpub/feat/integrate
Browse files Browse the repository at this point in the history
  • Loading branch information
tefkah authored Dec 11, 2023
2 parents 35f5961 + ddaa64b commit c8fda14
Show file tree
Hide file tree
Showing 100 changed files with 37,356 additions and 11,186 deletions.
25 changes: 24 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
IMPORT_TEST_COMMUNITY_ID=94873d35-f9ca-4e2d-9c33-681dc893d302
# This is the url of the community you want to test things imports on
# these don't work locally unfortunately, so we gotta do it in prod baby
IMPORT_TEST_COMMUNITY_URL=https://client-test.pubpub.org

# admin email
EMAIL=
# Admin pw
PASSWORD=

# Community you want to test things on
# Probably should be one that already exists, and yuu are an admin of
COMMUNITY_ID=
THOMAS_ATTR_ID=

# Currently you cannot run the tests properly without having access to pubpub's (dev) database
# We are working on changing this, for now you can run the tests in CI
DATABASE_URL=
DATABASE_CONNECTION_POOL_URL=

# These are some values core needs to not be undefined, they are not particularly important
MAILCHIMP_API_KEY=something
MAILGUN_API_KEY=something
ALGOLIA_SEARCH_KEY=ooo
JWT_SIGNING_SECRET=shhhhhh
FIREBASE_TEST_DB_URL=http://localhost:9875?ns=pubpub-v6
ZOTERO_CLIENT_KEY=abc
ZOTERO_CLIENT_SECRET=def
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
core
prettier.config.cjs
node_modules
dist
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"@typescript-eslint/consistent-type-imports": "error"
},
"plugins": ["@typescript-eslint"]
}
47 changes: 36 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,53 @@ name: CI
on:
push:
branches:
- '**'
- 'main'
pull_request:
branches:
- '**'

jobs:
build:
test:
runs-on: ubuntu-latest
environment: ci
steps:
# necessary for some tests
- uses: nikeee/setup-pandoc@v1
with:
pandoc-version: 2.19.2

- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
submodules: true
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
- name: Setup XMLLint bc otherwise break
run: sudo apt-get install libxml2-utils -y

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- run: pnpm run ci
env:
EMAIL: ${{ secrets.EMAIL }}
COMMUNITY_ID: ${{ secrets.COMMUNITY_ID }}
COMMUNITY_URL: ${{ secrets.COMMUNITY_URL }}
PASSWORD: ${{ secrets.PASSWORD }}
62 changes: 31 additions & 31 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: Publish
on:
push:
branches:
- 'main'
# name: Publish
# on:
# push:
# branches:
# - 'main'

concurrency: ${{ github.workflow }}-${{ github.ref }}
# concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'
# jobs:
# publish:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: pnpm/action-setup@v2
# with:
# version: 7
# - uses: actions/setup-node@v3
# with:
# node-version: 18.x
# cache: 'pnpm'

- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
env:
EMAIL: ${{ secrets.EMAIL }}
COMMUNITY_ID: ${{ secrets.COMMUNITY_ID }}
COMMUNITY_URL: ${{ secrets.COMMUNITY_URL }}
PASSWORD: ${{ secrets.PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# - run: pnpm install --frozen-lockfile
# - name: Create Release Pull Request or Publish
# id: changesets
# uses: changesets/action@v1
# with:
# publish: pnpm run release
# env:
# EMAIL: ${{ secrets.EMAIL }}
# COMMUNITY_ID: ${{ secrets.COMMUNITY_ID }}
# COMMUNITY_URL: ${{ secrets.COMMUNITY_URL }}
# PASSWORD: ${{ secrets.PASSWORD }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,8 @@ dist
.pnp.*

# incomplete docxs files
~$*
~$*

docgen/docs
temp.md
docs.md
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "core"]
path = core
url = https://github.com/pubpub/pubpub
branch = tfk/derive-sdk
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
src
node_modules
pnpm-lock.yaml
package-lock.json
core
tsconfig.json
tsup.config.ts
test
Expand All @@ -14,4 +16,5 @@ web
.npmignore
.npmrc
.prettierignore
prettier.config.cjs
prettier.config.cjs
.dist*
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
enable-pre-post-scripts=true
ignore-workspace-root-check=true
hoist-pattern[]=!@types/react
hoist-pattern[]=!@ts-rest/core
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
// "prettier.prettierPath": "node_modules/prettier",
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
}
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# pubpub-client

## 0.9.0

### Minor Changes

- 7ea7d22: Use pubpub core to make client

## 0.8.2

### Patch Changes
Expand Down
Loading

0 comments on commit c8fda14

Please sign in to comment.