Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest Node version #6231

Merged
merged 1 commit into from
Jul 23, 2024
Merged
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
Update to latest Node version
eliias committed Jul 19, 2024

Verified

This commit was signed with the committer’s verified signature.
eliias Hannes Moser
commit bf559dab5813e2b23b6a8f299f29569b51468359
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.15.1
22.5.1
4 changes: 2 additions & 2 deletions examples/graphql/client/index.js
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import {
import {
getRxStorageLoki
} from 'rxdb/plugins/storage-lokijs';
const LokiIncrementalIndexedDBAdapter = require('lokijs/src/incremental-indexeddb-adapter');
import LokiIncrementalIndexedDBAdapter from 'lokijs/src/incremental-indexeddb-adapter.js';

import {
getRxStorageMemory
@@ -53,7 +53,7 @@ import {
heroSchema,
graphQLGenerationInput,
JWT_BEARER_TOKEN
} from '../shared';
} from '../shared.js';

const insertButton = document.querySelector('#insert-button');
const heroesList = document.querySelector('#heroes-list');
3 changes: 2 additions & 1 deletion examples/graphql/package.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"preinstall": "(cd ../../ && npx [email protected] pack ../../ --filename ./examples/graphql/rxdb-local.tgz)",
"dev": "webpack serve",
"start": "concurrently \"npm run server\" \"npm run dev\"",
"server": "node -r esm ./server/index.js",
"server": "node ./server/index.js",
"refresh": "rimraf -r node_modules/rxdb/ && npm i ",
"build": "webpack",
"build:serve": "ws -p 8888 -d dist/",
@@ -20,6 +20,7 @@
"private": true,
"author": "pubkey",
"license": "MIT",
"type": "module",
"//": "NOTICE: For the Github CI we use the local RxDB build (rxdb-local.tgz). In your app should just install 'rxdb' from npm instead",
"dependencies": {
"rxdb": "file:rxdb-local.tgz",
11 changes: 7 additions & 4 deletions examples/graphql/server/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import express from 'express';
import * as path from 'path';
const { graphqlHTTP } = require('express-graphql');
const cors = require('cors');
import { graphqlHTTP } from 'express-graphql';
import cors from 'cors';
import { PubSub } from 'graphql-subscriptions';
import { buildSchema, execute, subscribe } from 'graphql';
import { WebSocketServer } from "ws";

import * as ws from 'ws';
import { useServer } from 'graphql-ws/lib/use/ws';
@@ -16,12 +17,14 @@ import {
GRAPHQL_SUBSCRIPTION_PATH,
graphQLGenerationInput,
JWT_BEARER_TOKEN,
} from '../shared';
} from '../shared.js';

import { graphQLSchemaFromRxSchema } from 'rxdb/plugins/replication-graphql';

import { lastOfArray } from 'rxdb';

const __dirname = import.meta.dirname;

function log(msg) {
const prefix = '# GraphQL Server: ';
if (typeof msg === 'string') {
@@ -234,7 +237,7 @@ export async function run() {
GRAPHQL_SUBSCRIPTION_PORT +
GRAPHQL_SUBSCRIPTION_PATH
);
const wsServer = new ws.Server({
const wsServer = new WebSocketServer({
server: serverSubscription,
path: GRAPHQL_SUBSCRIPTION_PATH,
});
2 changes: 1 addition & 1 deletion examples/graphql/test/e2e.test.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import AsyncTestUtil from 'async-test-util';
import GraphQLClient from 'graphql-client';
import {
GRAPHQL_PORT
} from '../shared';
} from '../shared.js';

const storage = process.env.STORAGE;
if (!storage) {
20 changes: 14 additions & 6 deletions examples/graphql/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const webpack = require('webpack');
import path from'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import webpack from 'webpack';

module.exports = {
const __dirname = import.meta.dirname;

export default {
entry: './client/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
path: path.resolve(__dirname, 'dist'),
library: {
type: "module"
}
},
experiments: {
outputModule: true,
},
plugins: [
new webpack.ProvidePlugin({
3 changes: 1 addition & 2 deletions examples/vite-vanilla-ts/package.json
Original file line number Diff line number Diff line change
@@ -19,8 +19,7 @@
"copyfiles": "2.4.1",
"testcafe": "3.6.2",
"typescript": "5.5.3",
"vite": "5.3.4",
"vite-plugin-top-level-await": "1.4.1"
"vite": "5.3.4"
},
"//": "NOTICE: For the Github CI we use the local RxDB build (rxdb-local.tgz). In your app should just install 'rxdb' from npm instead",
"dependencies": {
10 changes: 5 additions & 5 deletions examples/vite-vanilla-ts/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig } from 'vite';
import topLevelAwait from 'vite-plugin-top-level-await';

export default defineConfig({
plugins: [
// required to support top level await
topLevelAwait()
]
esbuild: {
supported: {
'top-level-await': true
},
},
});