mirror of
https://github.com/standardnotes/server
synced 2026-04-05 06:01:12 -04:00
Compare commits
1 Commits
@standardn
...
unplug_dep
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a1d3f5266 |
9
.github/ci.env
vendored
9
.github/ci.env
vendored
@@ -4,14 +4,13 @@ DB_USERNAME=std_notes_user
|
|||||||
DB_PASSWORD=changeme123
|
DB_PASSWORD=changeme123
|
||||||
DB_DATABASE=standard_notes_db
|
DB_DATABASE=standard_notes_db
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_DEBUG_LEVEL=all
|
|
||||||
DB_SQLITE_DATABASE_PATH=standard_notes_db
|
DB_SQLITE_DATABASE_PATH=standard_notes_db
|
||||||
REDIS_PORT=6379
|
REDIS_PORT=6379
|
||||||
REDIS_HOST=cache
|
REDIS_HOST=cache
|
||||||
AUTH_SERVER_ACCESS_TOKEN_AGE=4
|
AUTH_SERVER_ACCESS_TOKEN_AGE=4
|
||||||
AUTH_SERVER_REFRESH_TOKEN_AGE=10
|
AUTH_SERVER_REFRESH_TOKEN_AGE=10
|
||||||
AUTH_SERVER_EPHEMERAL_SESSION_AGE=300
|
AUTH_SERVER_EPHEMERAL_SESSION_AGE=300
|
||||||
SYNCING_SERVER_REVISIONS_FREQUENCY=2
|
SYNCING_SERVER_REVISIONS_FREQUENCY=5
|
||||||
AUTH_SERVER_LOG_LEVEL=debug
|
AUTH_SERVER_LOG_LEVEL=debug
|
||||||
SYNCING_SERVER_LOG_LEVEL=debug
|
SYNCING_SERVER_LOG_LEVEL=debug
|
||||||
FILES_SERVER_LOG_LEVEL=debug
|
FILES_SERVER_LOG_LEVEL=debug
|
||||||
@@ -23,12 +22,6 @@ MYSQL_USER=std_notes_user
|
|||||||
MYSQL_PASSWORD=changeme123
|
MYSQL_PASSWORD=changeme123
|
||||||
MYSQL_ROOT_PASSWORD=changeme123
|
MYSQL_ROOT_PASSWORD=changeme123
|
||||||
|
|
||||||
MONGO_HOST=secondary_db
|
|
||||||
MONGO_PORT=27017
|
|
||||||
MONGO_USERNAME=standardnotes
|
|
||||||
MONGO_PASSWORD=standardnotes
|
|
||||||
MONGO_DATABASE=standardnotes
|
|
||||||
|
|
||||||
AUTH_JWT_SECRET=f95259c5e441f5a4646d76422cfb3df4c4488842901aa50b6c51b8be2e0040e9
|
AUTH_JWT_SECRET=f95259c5e441f5a4646d76422cfb3df4c4488842901aa50b6c51b8be2e0040e9
|
||||||
AUTH_SERVER_ENCRYPTION_SERVER_KEY=1087415dfde3093797f9a7ca93a49e7d7aa1861735eb0d32aae9c303b8c3d060
|
AUTH_SERVER_ENCRYPTION_SERVER_KEY=1087415dfde3093797f9a7ca93a49e7d7aa1861735eb0d32aae9c303b8c3d060
|
||||||
VALET_TOKEN_SECRET=4b886819ebe1e908077c6cae96311b48a8416bd60cc91c03060e15bdf6b30d1f
|
VALET_TOKEN_SECRET=4b886819ebe1e908077c6cae96311b48a8416bd60cc91c03060e15bdf6b30d1f
|
||||||
|
|||||||
10
.github/dependabot.yml
vendored
10
.github/dependabot.yml
vendored
@@ -30,11 +30,6 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
|
|
||||||
- package-ecosystem: "npm"
|
|
||||||
directory: "/packages/domain-core"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
|
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: "npm"
|
||||||
directory: "/packages/domain-events"
|
directory: "/packages/domain-events"
|
||||||
schedule:
|
schedule:
|
||||||
@@ -55,11 +50,6 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
|
|
||||||
- package-ecosystem: "npm"
|
|
||||||
directory: "/packages/home-server"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
|
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: "npm"
|
||||||
directory: "/packages/predicates"
|
directory: "/packages/predicates"
|
||||||
schedule:
|
schedule:
|
||||||
|
|||||||
2
.github/workflows/common-deploy.yml
vendored
2
.github/workflows/common-deploy.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v3
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
|||||||
19
.github/workflows/common-docker-image.yml
vendored
19
.github/workflows/common-docker-image.yml
vendored
@@ -33,12 +33,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Create Bundle Dir
|
||||||
|
id: bundle-dir
|
||||||
|
run: echo "temp_dir=$(mktemp -d -t ${{ inputs.service_name }}-${{ github.sha }}-XXXXXXX)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache build
|
- name: Cache build
|
||||||
id: cache-build
|
id: cache-build
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
packages/**/dist
|
packages/**/dist
|
||||||
|
${{ steps.bundle-dir.outputs.temp_dir }}
|
||||||
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
|
key: ${{ runner.os }}-${{ inputs.service_name }}-build-${{ github.sha }}
|
||||||
|
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
@@ -52,7 +57,11 @@ jobs:
|
|||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
if: steps.cache-build.outputs.cache-hit != 'true'
|
if: steps.cache-build.outputs.cache-hit != 'true'
|
||||||
run: yarn build
|
run: yarn build ${{ inputs.package_path }}
|
||||||
|
|
||||||
|
- name: Bundle
|
||||||
|
if: steps.cache-build.outputs.cache-hit != 'true'
|
||||||
|
run: yarn workspace ${{ inputs.workspace_name }} bundle --no-compress --output-directory ${{ steps.bundle-dir.outputs.temp_dir }}
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
@@ -61,7 +70,7 @@ jobs:
|
|||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v3
|
uses: aws-actions/configure-aws-credentials@v1
|
||||||
with:
|
with:
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
@@ -81,11 +90,11 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@master
|
uses: docker/setup-buildx-action@master
|
||||||
|
|
||||||
- name: Publish Docker image
|
- name: Publish Docker image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
context: .
|
context: ${{ steps.bundle-dir.outputs.temp_dir }}
|
||||||
file: ${{ inputs.package_path }}/Dockerfile
|
file: ${{ steps.bundle-dir.outputs.temp_dir }}/${{ inputs.package_path }}/Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
|
|||||||
121
.github/workflows/common-e2e.yml
vendored
121
.github/workflows/common-e2e.yml
vendored
@@ -7,10 +7,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: latest
|
default: latest
|
||||||
description: The Docker image tag used for SNJS container
|
description: The Docker image tag used for SNJS container
|
||||||
suite:
|
|
||||||
type: string
|
|
||||||
default: all
|
|
||||||
description: The test suite to run
|
|
||||||
secrets:
|
secrets:
|
||||||
DOCKER_USERNAME:
|
DOCKER_USERNAME:
|
||||||
required: true
|
required: true
|
||||||
@@ -22,16 +18,111 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
e2e-self-hosted:
|
e2e:
|
||||||
uses: standardnotes/server/.github/workflows/e2e-self-hosted.yml@main
|
name: (Docker) E2E Test Suite
|
||||||
with:
|
runs-on: ubuntu-latest
|
||||||
snjs_image_tag: ${{ inputs.snjs_image_tag }}
|
|
||||||
suite: ${{ inputs.suite }}
|
services:
|
||||||
secrets: inherit
|
snjs:
|
||||||
|
image: standardnotes/snjs:${{ inputs.snjs_image_tag }}
|
||||||
|
ports:
|
||||||
|
- 9001:9001
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
run: yarn install --immutable
|
||||||
|
|
||||||
|
- name: Run Server
|
||||||
|
run: docker compose -f docker-compose.ci.yml up -d
|
||||||
|
env:
|
||||||
|
DB_TYPE: mysql
|
||||||
|
CACHE_TYPE: redis
|
||||||
|
|
||||||
|
- name: Wait for server to start
|
||||||
|
run: docker/is-available.sh http://localhost:3123 $(pwd)/logs
|
||||||
|
|
||||||
|
- name: Run E2E Test Suite
|
||||||
|
run: yarn dlx mocha-headless-chrome --timeout 1200000 -f http://localhost:9001/mocha/test.html
|
||||||
|
|
||||||
e2e-home-server:
|
e2e-home-server:
|
||||||
uses: standardnotes/server/.github/workflows/e2e-home-server.yml@main
|
name: (Home Server) E2E Test Suite
|
||||||
with:
|
strategy:
|
||||||
snjs_image_tag: ${{ inputs.snjs_image_tag }}
|
matrix:
|
||||||
suite: ${{ inputs.suite }}
|
db_type: [mysql, sqlite]
|
||||||
secrets: inherit
|
cache_type: [redis, memory]
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
snjs:
|
||||||
|
image: standardnotes/snjs:${{ inputs.snjs_image_tag }}
|
||||||
|
ports:
|
||||||
|
- 9001:9001
|
||||||
|
cache:
|
||||||
|
image: redis
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
db:
|
||||||
|
image: mysql
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
env:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
MYSQL_DATABASE: standardnotes
|
||||||
|
MYSQL_USER: standardnotes
|
||||||
|
MYSQL_PASSWORD: standardnotes
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: yarn install --immutable
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
- name: Copy dotenv file
|
||||||
|
run: cp packages/home-server/.env.sample packages/home-server/.env
|
||||||
|
|
||||||
|
- name: Fill in env variables
|
||||||
|
run: |
|
||||||
|
sed -i "s/JWT_SECRET=/JWT_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||||
|
sed -i "s/AUTH_JWT_SECRET=/AUTH_JWT_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||||
|
sed -i "s/ENCRYPTION_SERVER_KEY=/ENCRYPTION_SERVER_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||||
|
sed -i "s/PSEUDO_KEY_PARAMS_KEY=/PSEUDO_KEY_PARAMS_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||||
|
sed -i "s/VALET_TOKEN_SECRET=/VALET_TOKEN_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
||||||
|
echo "ACCESS_TOKEN_AGE=4" >> packages/home-server/.env
|
||||||
|
echo "REFRESH_TOKEN_AGE=7" >> packages/home-server/.env
|
||||||
|
echo "REVISIONS_FREQUENCY=5" >> packages/home-server/.env
|
||||||
|
echo "DB_HOST=db" >> packages/home-server/.env
|
||||||
|
echo "DB_PORT=3306" >> packages/home-server/.env
|
||||||
|
echo "DB_USERNAME=standardnotes" >> packages/home-server/.env
|
||||||
|
echo "DB_PASSWORD=standardnotes" >> packages/home-server/.env
|
||||||
|
echo "DB_TYPE=${{ matrix.db_type }}" >> packages/home-server/.env
|
||||||
|
echo "REDIS_URL=redis://cache" >> packages/home-server/.env
|
||||||
|
echo "CACHE_TYPE=${{ matrix.cache_type }}" >> packages/home-server/.env
|
||||||
|
|
||||||
|
- name: Run Server
|
||||||
|
run: nohup yarn workspace @standardnotes/home-server start &
|
||||||
|
env:
|
||||||
|
PORT: 3123
|
||||||
|
|
||||||
|
- name: Wait for server to start
|
||||||
|
run: for i in {1..30}; do curl -s http://localhost:3123/healthcheck && break || sleep 1; done
|
||||||
|
|
||||||
|
- name: Run E2E Test Suite
|
||||||
|
run: yarn dlx mocha-headless-chrome --timeout 1200000 -f http://localhost:9001/mocha/test.html?skip_paid_features=true
|
||||||
|
|||||||
2
.github/workflows/common-self-hosting.yml
vendored
2
.github/workflows/common-self-hosting.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@master
|
uses: docker/setup-buildx-action@master
|
||||||
|
|
||||||
- name: Publish Docker image
|
- name: Publish Docker image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
128
.github/workflows/e2e-home-server.yml
vendored
128
.github/workflows/e2e-home-server.yml
vendored
@@ -1,128 +0,0 @@
|
|||||||
name: E2E Home Server Test Suite
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
snjs_image_tag:
|
|
||||||
type: string
|
|
||||||
default: latest
|
|
||||||
description: The Docker image tag used for SNJS container
|
|
||||||
suite:
|
|
||||||
type: string
|
|
||||||
default: all
|
|
||||||
description: The test suite to run
|
|
||||||
secrets:
|
|
||||||
DOCKER_USERNAME:
|
|
||||||
required: true
|
|
||||||
DOCKER_PASSWORD:
|
|
||||||
required: true
|
|
||||||
AWS_ACCESS_KEY_ID:
|
|
||||||
required: true
|
|
||||||
AWS_SECRET_ACCESS_KEY:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
e2e-home-server:
|
|
||||||
name: (Home Server) E2E Test Suite
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
db_type: [mysql, sqlite]
|
|
||||||
cache_type: [redis, memory]
|
|
||||||
secondary_db_enabled: [true, false]
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
services:
|
|
||||||
snjs:
|
|
||||||
image: standardnotes/snjs:${{ inputs.snjs_image_tag }}
|
|
||||||
ports:
|
|
||||||
- 9001:9001
|
|
||||||
cache:
|
|
||||||
image: redis
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
db:
|
|
||||||
image: mysql
|
|
||||||
ports:
|
|
||||||
- 3306:3306
|
|
||||||
env:
|
|
||||||
MYSQL_ROOT_PASSWORD: root
|
|
||||||
MYSQL_DATABASE: standardnotes
|
|
||||||
MYSQL_USER: standardnotes
|
|
||||||
MYSQL_PASSWORD: standardnotes
|
|
||||||
secondary_db:
|
|
||||||
image: mongo:5.0
|
|
||||||
ports:
|
|
||||||
- 27017:27017
|
|
||||||
env:
|
|
||||||
MONGO_INITDB_ROOT_USERNAME: standardnotes
|
|
||||||
MONGO_INITDB_ROOT_PASSWORD: standardnotes
|
|
||||||
MONGO_INITDB_DATABASE: standardnotes
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
node-version-file: '.nvmrc'
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: yarn install --immutable
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
- name: Copy dotenv file
|
|
||||||
run: cp packages/home-server/.env.sample packages/home-server/.env
|
|
||||||
|
|
||||||
- name: Fill in env variables
|
|
||||||
run: |
|
|
||||||
sed -i "s/JWT_SECRET=/JWT_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
|
||||||
sed -i "s/AUTH_JWT_SECRET=/AUTH_JWT_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
|
||||||
sed -i "s/ENCRYPTION_SERVER_KEY=/ENCRYPTION_SERVER_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
|
||||||
sed -i "s/PSEUDO_KEY_PARAMS_KEY=/PSEUDO_KEY_PARAMS_KEY=$(openssl rand -hex 32)/g" packages/home-server/.env
|
|
||||||
sed -i "s/VALET_TOKEN_SECRET=/VALET_TOKEN_SECRET=$(openssl rand -hex 32)/g" packages/home-server/.env
|
|
||||||
echo "ACCESS_TOKEN_AGE=4" >> packages/home-server/.env
|
|
||||||
echo "REFRESH_TOKEN_AGE=10" >> packages/home-server/.env
|
|
||||||
echo "REVISIONS_FREQUENCY=2" >> packages/home-server/.env
|
|
||||||
echo "DB_HOST=localhost" >> packages/home-server/.env
|
|
||||||
echo "DB_PORT=3306" >> packages/home-server/.env
|
|
||||||
echo "DB_DATABASE=standardnotes" >> packages/home-server/.env
|
|
||||||
echo "DB_SQLITE_DATABASE_PATH=homeserver.db" >> packages/home-server/.env
|
|
||||||
echo "DB_USERNAME=standardnotes" >> packages/home-server/.env
|
|
||||||
echo "DB_PASSWORD=standardnotes" >> packages/home-server/.env
|
|
||||||
echo "DB_TYPE=${{ matrix.db_type }}" >> packages/home-server/.env
|
|
||||||
echo "DB_DEBUG_LEVEL=all" >> packages/home-server/.env
|
|
||||||
echo "REDIS_URL=redis://localhost:6379" >> packages/home-server/.env
|
|
||||||
echo "CACHE_TYPE=${{ matrix.cache_type }}" >> packages/home-server/.env
|
|
||||||
echo "SECONDARY_DB_ENABLED=${{ matrix.secondary_db_enabled }}" >> packages/home-server/.env
|
|
||||||
echo "MONGO_HOST=localhost" >> packages/home-server/.env
|
|
||||||
echo "MONGO_PORT=27017" >> packages/home-server/.env
|
|
||||||
echo "MONGO_DATABASE=standardnotes" >> packages/home-server/.env
|
|
||||||
echo "MONGO_USERNAME=standardnotes" >> packages/home-server/.env
|
|
||||||
echo "MONGO_PASSWORD=standardnotes" >> packages/home-server/.env
|
|
||||||
echo "FILES_SERVER_URL=http://localhost:3123" >> packages/home-server/.env
|
|
||||||
echo "E2E_TESTING=true" >> packages/home-server/.env
|
|
||||||
|
|
||||||
- name: Run Server
|
|
||||||
run: nohup yarn workspace @standardnotes/home-server start > logs/output.log 2>&1 &
|
|
||||||
env:
|
|
||||||
PORT: 3123
|
|
||||||
|
|
||||||
- name: Wait for server to start
|
|
||||||
run: for i in {1..30}; do curl -s http://localhost:3123/healthcheck && break || sleep 1; done
|
|
||||||
|
|
||||||
- name: Run E2E Test Suite
|
|
||||||
run: yarn dlx mocha-headless-chrome --timeout 3600000 -f http://localhost:9001/mocha/test.html?suite=${{ inputs.suite }}
|
|
||||||
|
|
||||||
- name: Archive failed run logs
|
|
||||||
if: ${{ failure() }}
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: home-server-failure-logs-${{ inputs.suite }}-${{ matrix.db_type }}-${{ matrix.cache_type }}-${{ matrix.secondary_db_enabled }}
|
|
||||||
retention-days: 5
|
|
||||||
path: |
|
|
||||||
logs/output.log
|
|
||||||
72
.github/workflows/e2e-self-hosted.yml
vendored
72
.github/workflows/e2e-self-hosted.yml
vendored
@@ -1,72 +0,0 @@
|
|||||||
name: E2E Self Hosted Test Suite
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
snjs_image_tag:
|
|
||||||
type: string
|
|
||||||
default: latest
|
|
||||||
description: The Docker image tag used for SNJS container
|
|
||||||
suite:
|
|
||||||
type: string
|
|
||||||
default: all
|
|
||||||
description: The test suite to run
|
|
||||||
secrets:
|
|
||||||
DOCKER_USERNAME:
|
|
||||||
required: true
|
|
||||||
DOCKER_PASSWORD:
|
|
||||||
required: true
|
|
||||||
AWS_ACCESS_KEY_ID:
|
|
||||||
required: true
|
|
||||||
AWS_SECRET_ACCESS_KEY:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
e2e:
|
|
||||||
name: (Self Hosting) E2E Test Suite
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
secondary_db_enabled: [true, false]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
services:
|
|
||||||
snjs:
|
|
||||||
image: standardnotes/snjs:${{ inputs.snjs_image_tag }}
|
|
||||||
ports:
|
|
||||||
- 9001:9001
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
node-version-file: '.nvmrc'
|
|
||||||
|
|
||||||
- name: Install
|
|
||||||
run: yarn install --immutable
|
|
||||||
|
|
||||||
- name: Run Server
|
|
||||||
run: docker compose -f docker-compose.ci.yml up -d
|
|
||||||
env:
|
|
||||||
DB_TYPE: mysql
|
|
||||||
CACHE_TYPE: redis
|
|
||||||
SECONDARY_DB_ENABLED: ${{ matrix.secondary_db_enabled }}
|
|
||||||
|
|
||||||
- name: Wait for server to start
|
|
||||||
run: docker/is-available.sh http://localhost:3123 $(pwd)/logs
|
|
||||||
|
|
||||||
- name: Run E2E Test Suite
|
|
||||||
run: yarn dlx mocha-headless-chrome --timeout 3600000 -f http://localhost:9001/mocha/test.html?suite=${{ inputs.suite }}
|
|
||||||
|
|
||||||
- name: Archive failed run logs
|
|
||||||
if: ${{ failure() }}
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: self-hosted-failure-logs-${{ inputs.suite }}-${{ matrix.secondary_db_enabled }}
|
|
||||||
retention-days: 5
|
|
||||||
path: |
|
|
||||||
logs/*.err
|
|
||||||
logs/*.log
|
|
||||||
17
.github/workflows/e2e-test-suite.yml
vendored
17
.github/workflows/e2e-test-suite.yml
vendored
@@ -1,6 +1,4 @@
|
|||||||
name: E2E Test Suite
|
name: E2E Test Suite On Self Hosted Server
|
||||||
|
|
||||||
run-name: E2E ${{ inputs.suite }} Test Suite against ${{ inputs.ref_name }} by ${{ inputs.author }}
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
@@ -11,18 +9,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: latest
|
default: latest
|
||||||
description: The Docker image tag used for SNJS container
|
description: The Docker image tag used for SNJS container
|
||||||
suite:
|
|
||||||
type: string
|
|
||||||
default: all
|
|
||||||
description: The test suite to run
|
|
||||||
author:
|
|
||||||
type: string
|
|
||||||
default: unknown
|
|
||||||
description: The author that triggered the workflow
|
|
||||||
ref_name:
|
|
||||||
type: string
|
|
||||||
default: unknown
|
|
||||||
description: The ref name from which the workflow was triggered
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
e2e:
|
e2e:
|
||||||
@@ -30,5 +16,4 @@ jobs:
|
|||||||
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
||||||
with:
|
with:
|
||||||
snjs_image_tag: ${{ inputs.snjs_image_tag || 'latest' }}
|
snjs_image_tag: ${{ inputs.snjs_image_tag || 'latest' }}
|
||||||
suite: ${{ inputs.suite || 'all' }}
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|||||||
19
.github/workflows/pr.yml
vendored
19
.github/workflows/pr.yml
vendored
@@ -95,20 +95,9 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: yarn test
|
run: yarn test
|
||||||
|
|
||||||
e2e-base:
|
e2e:
|
||||||
needs: build
|
needs: build
|
||||||
name: E2E Base Suite
|
|
||||||
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
|
||||||
with:
|
|
||||||
snjs_image_tag: 'latest'
|
|
||||||
suite: 'base'
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
# e2e-vaults:
|
name: E2E
|
||||||
# needs: build
|
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
||||||
# name: E2E Vaults Suite
|
secrets: inherit
|
||||||
# uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
|
||||||
# with:
|
|
||||||
# snjs_image_tag: 'latest'
|
|
||||||
# suite: 'vaults'
|
|
||||||
# secrets: inherit
|
|
||||||
|
|||||||
20
.github/workflows/publish.yml
vendored
20
.github/workflows/publish.yml
vendored
@@ -95,32 +95,20 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: yarn test
|
run: yarn test
|
||||||
|
|
||||||
e2e-base:
|
e2e:
|
||||||
needs: build
|
needs: build
|
||||||
name: E2E Base Suite
|
name: E2E
|
||||||
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
||||||
with:
|
|
||||||
snjs_image_tag: 'latest'
|
|
||||||
suite: 'base'
|
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
# e2e-vaults:
|
|
||||||
# needs: build
|
|
||||||
# name: E2E Vaults Suite
|
|
||||||
# uses: standardnotes/server/.github/workflows/common-e2e.yml@main
|
|
||||||
# with:
|
|
||||||
# snjs_image_tag: 'latest'
|
|
||||||
# suite: 'vaults'
|
|
||||||
# secrets: inherit
|
|
||||||
|
|
||||||
publish-self-hosting:
|
publish-self-hosting:
|
||||||
needs: [ test, lint, e2e-base ]
|
needs: [ test, lint, e2e ]
|
||||||
name: Publish Self Hosting Docker Image
|
name: Publish Self Hosting Docker Image
|
||||||
uses: standardnotes/server/.github/workflows/common-self-hosting.yml@main
|
uses: standardnotes/server/.github/workflows/common-self-hosting.yml@main
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
publish-services:
|
publish-services:
|
||||||
needs: [ test, lint, e2e-base ]
|
needs: [ test, lint, e2e ]
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -13,8 +13,7 @@ newrelic_agent.log
|
|||||||
!.yarn/releases
|
!.yarn/releases
|
||||||
!.yarn/sdks
|
!.yarn/sdks
|
||||||
!.yarn/versions
|
!.yarn/versions
|
||||||
|
!.yarn/unplugged
|
||||||
yarn.build-error.log
|
|
||||||
|
|
||||||
packages/files/uploads/*
|
packages/files/uploads/*
|
||||||
!packages/files/uploads/.gitkeep
|
!packages/files/uploads/.gitkeep
|
||||||
|
|||||||
100
.pnp.loader.mjs
generated
100
.pnp.loader.mjs
generated
@@ -1,5 +1,5 @@
|
|||||||
import fs from 'fs';
|
|
||||||
import { URL as URL$1, fileURLToPath, pathToFileURL } from 'url';
|
import { URL as URL$1, fileURLToPath, pathToFileURL } from 'url';
|
||||||
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import moduleExports, { Module } from 'module';
|
import moduleExports, { Module } from 'module';
|
||||||
import { createHash } from 'crypto';
|
import { createHash } from 'crypto';
|
||||||
@@ -89,6 +89,7 @@ async function copyPromise(destinationFs, destination, sourceFs, source, opts) {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) {
|
async function copyImpl(prelayout, postlayout, destinationFs, destination, sourceFs, source, opts) {
|
||||||
|
var _a, _b, _c;
|
||||||
const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null;
|
const destinationStat = opts.didParentExist ? await maybeLStat(destinationFs, destination) : null;
|
||||||
const sourceStat = await sourceFs.lstatPromise(source);
|
const sourceStat = await sourceFs.lstatPromise(source);
|
||||||
const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat;
|
const { atime, mtime } = opts.stableTime ? { atime: defaultTime, mtime: defaultTime } : sourceStat;
|
||||||
@@ -114,8 +115,8 @@ async function copyImpl(prelayout, postlayout, destinationFs, destination, sourc
|
|||||||
throw new Error(`Unsupported file type (${sourceStat.mode})`);
|
throw new Error(`Unsupported file type (${sourceStat.mode})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (opts.linkStrategy?.type !== `HardlinkFromIndex` || !sourceStat.isFile()) {
|
if (((_a = opts.linkStrategy) == null ? void 0 : _a.type) !== `HardlinkFromIndex` || !sourceStat.isFile()) {
|
||||||
if (updated || destinationStat?.mtime?.getTime() !== mtime.getTime() || destinationStat?.atime?.getTime() !== atime.getTime()) {
|
if (updated || ((_b = destinationStat == null ? void 0 : destinationStat.mtime) == null ? void 0 : _b.getTime()) !== mtime.getTime() || ((_c = destinationStat == null ? void 0 : destinationStat.atime) == null ? void 0 : _c.getTime()) !== atime.getTime()) {
|
||||||
postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime));
|
postlayout.push(() => destinationFs.lutimesPromise(destination, atime, mtime));
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
@@ -185,7 +186,7 @@ async function copyFileViaIndex(prelayout, postlayout, destinationFs, destinatio
|
|||||||
let indexStat = await maybeLStat(destinationFs, indexPath);
|
let indexStat = await maybeLStat(destinationFs, indexPath);
|
||||||
if (destinationStat) {
|
if (destinationStat) {
|
||||||
const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino;
|
const isDestinationHardlinkedFromIndex = indexStat && destinationStat.dev === indexStat.dev && destinationStat.ino === indexStat.ino;
|
||||||
const isIndexModified = indexStat?.mtimeMs !== defaultTimeMs;
|
const isIndexModified = (indexStat == null ? void 0 : indexStat.mtimeMs) !== defaultTimeMs;
|
||||||
if (isDestinationHardlinkedFromIndex) {
|
if (isDestinationHardlinkedFromIndex) {
|
||||||
if (isIndexModified && linkStrategy.autoRepair) {
|
if (isIndexModified && linkStrategy.autoRepair) {
|
||||||
atomicBehavior = 0 /* Lock */;
|
atomicBehavior = 0 /* Lock */;
|
||||||
@@ -255,7 +256,8 @@ async function copyFileDirect(prelayout, postlayout, destinationFs, destination,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) {
|
async function copyFile(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts) {
|
||||||
if (opts.linkStrategy?.type === `HardlinkFromIndex`) {
|
var _a;
|
||||||
|
if (((_a = opts.linkStrategy) == null ? void 0 : _a.type) === `HardlinkFromIndex`) {
|
||||||
return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy);
|
return copyFileViaIndex(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts, opts.linkStrategy);
|
||||||
} else {
|
} else {
|
||||||
return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts);
|
return copyFileDirect(prelayout, postlayout, destinationFs, destination, destinationStat, sourceFs, source, sourceStat, opts);
|
||||||
@@ -385,7 +387,7 @@ class FakeFS {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
createdDirectory ??= subPath;
|
createdDirectory ?? (createdDirectory = subPath);
|
||||||
if (chmod != null)
|
if (chmod != null)
|
||||||
await this.chmodPromise(subPath, chmod);
|
await this.chmodPromise(subPath, chmod);
|
||||||
if (utimes != null) {
|
if (utimes != null) {
|
||||||
@@ -416,7 +418,7 @@ class FakeFS {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
createdDirectory ??= subPath;
|
createdDirectory ?? (createdDirectory = subPath);
|
||||||
if (chmod != null)
|
if (chmod != null)
|
||||||
this.chmodSync(subPath, chmod);
|
this.chmodSync(subPath, chmod);
|
||||||
if (utimes != null) {
|
if (utimes != null) {
|
||||||
@@ -611,14 +613,12 @@ class FakeFS {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async writeJsonPromise(p, data, { compact = false } = {}) {
|
async writeJsonPromise(p, data) {
|
||||||
const space = compact ? 0 : 2;
|
return await this.writeFilePromise(p, `${JSON.stringify(data, null, 2)}
|
||||||
return await this.writeFilePromise(p, `${JSON.stringify(data, null, space)}
|
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
writeJsonSync(p, data, { compact = false } = {}) {
|
writeJsonSync(p, data) {
|
||||||
const space = compact ? 0 : 2;
|
return this.writeFileSync(p, `${JSON.stringify(data, null, 2)}
|
||||||
return this.writeFileSync(p, `${JSON.stringify(data, null, space)}
|
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
async preserveTimePromise(p, cb) {
|
async preserveTimePromise(p, cb) {
|
||||||
@@ -852,7 +852,7 @@ class ProxiedFS extends FakeFS {
|
|||||||
readFileSync(p, encoding) {
|
readFileSync(p, encoding) {
|
||||||
return this.baseFs.readFileSync(this.fsMapToBase(p), encoding);
|
return this.baseFs.readFileSync(this.fsMapToBase(p), encoding);
|
||||||
}
|
}
|
||||||
readdirPromise(p, opts) {
|
async readdirPromise(p, opts) {
|
||||||
return this.baseFs.readdirPromise(this.mapToBase(p), opts);
|
return this.baseFs.readdirPromise(this.mapToBase(p), opts);
|
||||||
}
|
}
|
||||||
readdirSync(p, opts) {
|
readdirSync(p, opts) {
|
||||||
@@ -932,24 +932,12 @@ class NodeFS extends BasePortableFakeFS {
|
|||||||
this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject));
|
this.realFs.opendir(npath.fromPortablePath(p), this.makeCallback(resolve, reject));
|
||||||
}
|
}
|
||||||
}).then((dir) => {
|
}).then((dir) => {
|
||||||
const dirWithFixedPath = dir;
|
return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true });
|
||||||
Object.defineProperty(dirWithFixedPath, `path`, {
|
|
||||||
value: p,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
return dirWithFixedPath;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
opendirSync(p, opts) {
|
opendirSync(p, opts) {
|
||||||
const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p));
|
const dir = typeof opts !== `undefined` ? this.realFs.opendirSync(npath.fromPortablePath(p), opts) : this.realFs.opendirSync(npath.fromPortablePath(p));
|
||||||
const dirWithFixedPath = dir;
|
return Object.defineProperty(dir, `path`, { value: p, configurable: true, writable: true });
|
||||||
Object.defineProperty(dirWithFixedPath, `path`, {
|
|
||||||
value: p,
|
|
||||||
configurable: true,
|
|
||||||
writable: true
|
|
||||||
});
|
|
||||||
return dirWithFixedPath;
|
|
||||||
}
|
}
|
||||||
async readPromise(fd, buffer, offset = 0, length = 0, position = -1) {
|
async readPromise(fd, buffer, offset = 0, length = 0, position = -1) {
|
||||||
return await new Promise((resolve, reject) => {
|
return await new Promise((resolve, reject) => {
|
||||||
@@ -1227,16 +1215,16 @@ class NodeFS extends BasePortableFakeFS {
|
|||||||
}
|
}
|
||||||
async readdirPromise(p, opts) {
|
async readdirPromise(p, opts) {
|
||||||
return await new Promise((resolve, reject) => {
|
return await new Promise((resolve, reject) => {
|
||||||
if (opts) {
|
if (opts == null ? void 0 : opts.withFileTypes) {
|
||||||
this.realFs.readdir(npath.fromPortablePath(p), opts, this.makeCallback(resolve, reject));
|
this.realFs.readdir(npath.fromPortablePath(p), { withFileTypes: true }, this.makeCallback(resolve, reject));
|
||||||
} else {
|
} else {
|
||||||
this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback((value) => resolve(value), reject));
|
this.realFs.readdir(npath.fromPortablePath(p), this.makeCallback((value) => resolve(value), reject));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
readdirSync(p, opts) {
|
readdirSync(p, opts) {
|
||||||
if (opts) {
|
if (opts == null ? void 0 : opts.withFileTypes) {
|
||||||
return this.realFs.readdirSync(npath.fromPortablePath(p), opts);
|
return this.realFs.readdirSync(npath.fromPortablePath(p), { withFileTypes: true });
|
||||||
} else {
|
} else {
|
||||||
return this.realFs.readdirSync(npath.fromPortablePath(p));
|
return this.realFs.readdirSync(npath.fromPortablePath(p));
|
||||||
}
|
}
|
||||||
@@ -1371,6 +1359,9 @@ class VirtualFS extends ProxiedFS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10));
|
const [major, minor] = process.versions.node.split(`.`).map((value) => parseInt(value, 10));
|
||||||
|
const HAS_CONSOLIDATED_HOOKS = major > 16 || major === 16 && minor >= 12;
|
||||||
|
const HAS_UNFLAGGED_JSON_MODULES = major > 17 || major === 17 && minor >= 5 || major === 16 && minor >= 15;
|
||||||
|
const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT = major > 17 || major === 17 && minor >= 1 || major === 16 && minor > 14;
|
||||||
const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13;
|
const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13;
|
||||||
const HAS_LAZY_LOADED_TRANSLATORS = major > 19 || major === 19 && minor >= 3;
|
const HAS_LAZY_LOADED_TRANSLATORS = major > 19 || major === 19 && minor >= 3;
|
||||||
|
|
||||||
@@ -1436,7 +1427,11 @@ function getFileFormat(filepath) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
case `.json`: {
|
case `.json`: {
|
||||||
return `json`;
|
if (HAS_UNFLAGGED_JSON_MODULES)
|
||||||
|
return `json`;
|
||||||
|
throw new Error(
|
||||||
|
`Unknown file extension ".json" for ${filepath}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
case `.js`: {
|
case `.js`: {
|
||||||
const pkg = readPackageScope(filepath);
|
const pkg = readPackageScope(filepath);
|
||||||
@@ -1457,15 +1452,38 @@ function getFileFormat(filepath) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function load$1(urlString, context, nextLoad) {
|
async function getFormat$1(resolved, context, defaultGetFormat) {
|
||||||
|
const url = tryParseURL(resolved);
|
||||||
|
if ((url == null ? void 0 : url.protocol) !== `file:`)
|
||||||
|
return defaultGetFormat(resolved, context, defaultGetFormat);
|
||||||
|
const format = getFileFormat(fileURLToPath(url));
|
||||||
|
if (format) {
|
||||||
|
return {
|
||||||
|
format
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return defaultGetFormat(resolved, context, defaultGetFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getSource$1(urlString, context, defaultGetSource) {
|
||||||
const url = tryParseURL(urlString);
|
const url = tryParseURL(urlString);
|
||||||
if (url?.protocol !== `file:`)
|
if ((url == null ? void 0 : url.protocol) !== `file:`)
|
||||||
|
return defaultGetSource(urlString, context, defaultGetSource);
|
||||||
|
return {
|
||||||
|
source: await fs.promises.readFile(fileURLToPath(url), `utf8`)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function load$1(urlString, context, nextLoad) {
|
||||||
|
var _a;
|
||||||
|
const url = tryParseURL(urlString);
|
||||||
|
if ((url == null ? void 0 : url.protocol) !== `file:`)
|
||||||
return nextLoad(urlString, context, nextLoad);
|
return nextLoad(urlString, context, nextLoad);
|
||||||
const filePath = fileURLToPath(url);
|
const filePath = fileURLToPath(url);
|
||||||
const format = getFileFormat(filePath);
|
const format = getFileFormat(filePath);
|
||||||
if (!format)
|
if (!format)
|
||||||
return nextLoad(urlString, context, nextLoad);
|
return nextLoad(urlString, context, nextLoad);
|
||||||
if (format === `json` && context.importAssertions?.type !== `json`) {
|
if (HAS_JSON_IMPORT_ASSERTION_REQUIREMENT && format === `json` && ((_a = context.importAssertions) == null ? void 0 : _a.type) !== `json`) {
|
||||||
const err = new TypeError(`[ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "${urlString}" needs an import assertion of type "json"`);
|
const err = new TypeError(`[ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "${urlString}" needs an import assertion of type "json"`);
|
||||||
err.code = `ERR_IMPORT_ASSERTION_TYPE_MISSING`;
|
err.code = `ERR_IMPORT_ASSERTION_TYPE_MISSING`;
|
||||||
throw err;
|
throw err;
|
||||||
@@ -1482,7 +1500,7 @@ async function load$1(urlString, context, nextLoad) {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
format,
|
format,
|
||||||
source: format === `commonjs` ? void 0 : await fs.promises.readFile(filePath, `utf8`),
|
source: await fs.promises.readFile(filePath, `utf8`),
|
||||||
shortCircuit: true
|
shortCircuit: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1973,7 +1991,7 @@ async function resolve$1(originalSpecifier, context, nextResolve) {
|
|||||||
specifier = fileURLToPath(url);
|
specifier = fileURLToPath(url);
|
||||||
}
|
}
|
||||||
const { parentURL, conditions = [] } = context;
|
const { parentURL, conditions = [] } = context;
|
||||||
const issuer = parentURL && tryParseURL(parentURL)?.protocol === `file:` ? fileURLToPath(parentURL) : process.cwd();
|
const issuer = parentURL ? fileURLToPath(parentURL) : process.cwd();
|
||||||
const pnpapi = findPnpApi(issuer) ?? (url ? findPnpApi(specifier) : null);
|
const pnpapi = findPnpApi(issuer) ?? (url ? findPnpApi(specifier) : null);
|
||||||
if (!pnpapi)
|
if (!pnpapi)
|
||||||
return nextResolve(originalSpecifier, context, nextResolve);
|
return nextResolve(originalSpecifier, context, nextResolve);
|
||||||
@@ -2050,6 +2068,8 @@ if (!HAS_LAZY_LOADED_TRANSLATORS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const resolve = resolve$1;
|
const resolve = resolve$1;
|
||||||
const load = load$1;
|
const getFormat = HAS_CONSOLIDATED_HOOKS ? void 0 : getFormat$1;
|
||||||
|
const getSource = HAS_CONSOLIDATED_HOOKS ? void 0 : getSource$1;
|
||||||
|
const load = HAS_CONSOLIDATED_HOOKS ? load$1 : void 0;
|
||||||
|
|
||||||
export { load, resolve };
|
export { getFormat, getSource, load, resolve };
|
||||||
|
|||||||
BIN
.yarn/cache/@ampproject-remapping-npm-2.2.1-3da3d624be-a6e71b1b6b.zip
vendored
Normal file
BIN
.yarn/cache/@ampproject-remapping-npm-2.2.1-3da3d624be-a6e71b1b6b.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-crypto-crc32-npm-3.0.0-10d83e85b0-8ea28f9d43.zip
vendored
Normal file
BIN
.yarn/cache/@aws-crypto-crc32-npm-3.0.0-10d83e85b0-8ea28f9d43.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-crypto-crc32c-npm-3.0.0-79c813b90d-83f0215057.zip
vendored
Normal file
BIN
.yarn/cache/@aws-crypto-crc32c-npm-3.0.0-79c813b90d-83f0215057.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@aws-crypto-ie11-detection-npm-3.0.0-71f24dcf6a-3a47fbef4c.zip
vendored
Normal file
BIN
.yarn/cache/@aws-crypto-ie11-detection-npm-3.0.0-71f24dcf6a-3a47fbef4c.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-crypto-sha1-browser-npm-3.0.0-f8218a7691-ac0006841d.zip
vendored
Normal file
BIN
.yarn/cache/@aws-crypto-sha1-browser-npm-3.0.0-f8218a7691-ac0006841d.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-crypto-sha256-browser-npm-3.0.0-467f48a447-a0d6397d9b.zip
vendored
Normal file
BIN
.yarn/cache/@aws-crypto-sha256-browser-npm-3.0.0-467f48a447-a0d6397d9b.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@aws-crypto-sha256-js-npm-3.0.0-2ba1013fd6-039bce0161.zip
vendored
Normal file
BIN
.yarn/cache/@aws-crypto-sha256-js-npm-3.0.0-2ba1013fd6-039bce0161.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-crypto-supports-web-crypto-npm-3.0.0-55222d294a-12e936181f.zip
vendored
Normal file
BIN
.yarn/cache/@aws-crypto-supports-web-crypto-npm-3.0.0-55222d294a-12e936181f.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-crypto-util-npm-3.0.0-6c4b38c78e-6ed4cd1c57.zip
vendored
Normal file
BIN
.yarn/cache/@aws-crypto-util-npm-3.0.0-6c4b38c78e-6ed4cd1c57.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-abort-controller-npm-3.342.0-7cd20f7457-53f49d69eb.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-abort-controller-npm-3.342.0-7cd20f7457-53f49d69eb.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-chunked-blob-reader-npm-3.310.0-1a751a969c-9cc50513a9.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-chunked-blob-reader-npm-3.310.0-1a751a969c-9cc50513a9.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-s3-npm-3.342.0-a2692091c5-9f3b9171dd.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-s3-npm-3.342.0-a2692091c5-9f3b9171dd.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-sns-npm-3.342.0-94ce02a19b-8d7ccac0ed.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-sns-npm-3.342.0-94ce02a19b-8d7ccac0ed.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-sqs-npm-3.342.0-f4e06f69ac-e08dd27f26.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-sqs-npm-3.342.0-f4e06f69ac-e08dd27f26.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-sso-npm-3.342.0-be2d1dcabe-78748ec6a8.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-sso-npm-3.342.0-be2d1dcabe-78748ec6a8.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.342.0-ead49d3554-083c2beff3.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-sso-oidc-npm-3.342.0-ead49d3554-083c2beff3.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-client-sts-npm-3.342.0-ccdc6f5bcc-14475bf1b4.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-client-sts-npm-3.342.0-ccdc6f5bcc-14475bf1b4.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-config-resolver-npm-3.342.0-e26ef459a6-94007fc7e1.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-config-resolver-npm-3.342.0-e26ef459a6-94007fc7e1.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-credential-provider-env-npm-3.342.0-be06d46059-5bb6a1891d.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-credential-provider-env-npm-3.342.0-be06d46059-5bb6a1891d.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.342.0-8d4fef6a87-a5fb146d98.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-credential-provider-imds-npm-3.342.0-8d4fef6a87-a5fb146d98.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.342.0-07eb48b0d6-b00358cd28.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-credential-provider-ini-npm-3.342.0-07eb48b0d6-b00358cd28.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-credential-provider-node-npm-3.342.0-c2c35e314b-ac5214f8da.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-credential-provider-node-npm-3.342.0-c2c35e314b-ac5214f8da.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-credential-provider-process-npm-3.342.0-78f1a885e7-b0c909eacf.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-credential-provider-process-npm-3.342.0-78f1a885e7-b0c909eacf.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.342.0-7fd27a0dfa-85a8c3814a.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-credential-provider-sso-npm-3.342.0-7fd27a0dfa-85a8c3814a.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.342.0-a6febeebb2-6989324b98.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-credential-provider-web-identity-npm-3.342.0-a6febeebb2-6989324b98.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-eventstream-codec-npm-3.342.0-599f1c19f8-b735b3ea18.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-eventstream-codec-npm-3.342.0-599f1c19f8-b735b3ea18.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.342.0-c17f73b20c-345f411702.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-eventstream-serde-browser-npm-3.342.0-c17f73b20c-345f411702.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.342.0-5dc510958f-cd08f6a605.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-eventstream-serde-config-resolver-npm-3.342.0-5dc510958f-cd08f6a605.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.342.0-c4f337309c-5267253359.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-eventstream-serde-node-npm-3.342.0-c4f337309c-5267253359.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
BIN
.yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.342.0-04f7b47201-18ae41b141.zip
vendored
Normal file
BIN
.yarn/cache/@aws-sdk-eventstream-serde-universal-npm-3.342.0-04f7b47201-18ae41b141.zip
vendored
Normal file
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user