diff --git a/.changeset/plenty-radios-sit.md b/.changeset/plenty-radios-sit.md new file mode 100644 index 0000000000..0800d8c358 --- /dev/null +++ b/.changeset/plenty-radios-sit.md @@ -0,0 +1,10 @@ +--- +'nhost-documentation': patch +'@nhost/hasura-auth-js': patch +'@nhost/hasura-storage-js': patch +'@nhost/nhost-js': patch +'@nhost/react-apollo': patch +'@nhost/react-auth': patch +--- + +Build in CommonJS and ESM instead of UMD and ESM as the UMD bundle generated by the default Vite lib build mode doesn't work with NodeJS diff --git a/.config/vite.lib.js b/.config/vite.lib.js index 84ea4a8dd0..9cd5c61e4c 100644 --- a/.config/vite.lib.js +++ b/.config/vite.lib.js @@ -12,7 +12,8 @@ const pkg = require(path.join(PWD, 'package.json')) export const lib = { entry: path.resolve(PWD, 'src/index.ts'), name: pkg.name, - fileName: 'index' + fileName: 'index', + formats: ['cjs', 'es'] } export const basePlugins = [ tsconfigPaths(), diff --git a/docs/public/sitemap.xml b/docs/public/sitemap.xml index edff8ecb27..0d49ebf260 100644 --- a/docs/public/sitemap.xml +++ b/docs/public/sitemap.xml @@ -1,36 +1,41 @@ -https://docs.nhost.iodaily0.72022-02-08T09:55:24.955Z -https://docs.nhost.io/get-starteddaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platformdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/referencedaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/get-started/quick-start/javascript-clientdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/get-started/quick-start/permissionsdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/get-started/quick-start/schemadaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/authentication/sign-in-methodsdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/authentication/social-logindaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/authentication/user-managementdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/database/graphqldaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/database/permissionsdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/nhost/environment-variablesdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/nhost/github-integrationdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/nhost/local-developmentdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/serverless-functions/event-triggersdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/reference/sdk/authenticationdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/reference/sdk/functionsdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/reference/sdk/graphqldaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/reference/sdk/storagedaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/reference/supporting-libraries/react-apollodaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/reference/supporting-libraries/react-authdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/get-started/authenticationdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/get-started/quick-startdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/get-started/upgradedaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/authenticationdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/databasedaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/nhostdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/serverless-functionsdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/platform/storagedaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/reference/clidaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/reference/sdkdaily0.72022-02-08T09:55:24.956Z -https://docs.nhost.io/reference/supporting-librariesdaily0.72022-02-08T09:55:24.956Z +https://docs.nhost.iodaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/cli-workflow/install-clidaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/cli-workflow/local-changesdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/cli-workflow/metadata-and-serverless-functionsdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/cli-workflow/workflow-setupdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/quick-start/javascript-clientdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/quick-start/permissionsdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/quick-start/schemadaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/authentication/sign-in-methodsdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/authentication/social-logindaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/authentication/user-managementdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/database/graphqldaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/database/permissionsdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/nhost/environment-variablesdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/nhost/github-integrationdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/nhost/local-developmentdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/serverless-functions/event-triggersdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/reference/sdk/authenticationdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/reference/sdk/functionsdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/reference/sdk/graphqldaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/reference/sdk/storagedaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/reference/supporting-libraries/react-apollodaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/reference/supporting-libraries/react-authdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/authenticationdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/cli-workflowdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/quick-startdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-started/upgradedaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/authenticationdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/databasedaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/nhostdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/serverless-functionsdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platform/storagedaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/reference/clidaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/reference/sdkdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/reference/supporting-librariesdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/get-starteddaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/platformdaily0.72022-02-22T08:04:43.021Z +https://docs.nhost.io/referencedaily0.72022-02-22T08:04:43.021Z \ No newline at end of file diff --git a/packages/hasura-auth-js/package.json b/packages/hasura-auth-js/package.json index 43906b20cf..d8a1c0b72f 100644 --- a/packages/hasura-auth-js/package.json +++ b/packages/hasura-auth-js/package.json @@ -29,16 +29,10 @@ "verify": "run-p prettier lint", "verify:fix": "run-p prettier:fix lint:fix" }, - "exports": { - ".": { - "import": "./dist/index.es.js", - "require": "./dist/index.umd.js" - } - }, "main": "src/index.ts", "publishConfig": { "access": "public", - "main": "dist/index.umd.js", + "main": "dist/index.cjs.js", "module": "dist/index.es.js", "typings": "./dist/index.d.ts" }, diff --git a/packages/hasura-storage-js/package.json b/packages/hasura-storage-js/package.json index 8fe85fe624..e848eeeb9c 100644 --- a/packages/hasura-storage-js/package.json +++ b/packages/hasura-storage-js/package.json @@ -27,16 +27,10 @@ "verify": "run-p prettier lint", "verify:fix": "run-p prettier:fix lint:fix" }, - "exports": { - ".": { - "import": "./dist/index.es.js", - "require": "./dist/index.umd.js" - } - }, "main": "src/index.ts", "publishConfig": { "access": "public", - "main": "dist/index.umd.js", + "main": "dist/index.cjs.js", "module": "dist/index.es.js", "typings": "./dist/index.d.ts" }, diff --git a/packages/nhost-js/package.json b/packages/nhost-js/package.json index 0bd0650e17..b6054e428a 100644 --- a/packages/nhost-js/package.json +++ b/packages/nhost-js/package.json @@ -20,16 +20,10 @@ "type": "git", "url": "git+https://github.com/nhost/nhost.git" }, - "exports": { - ".": { - "import": "./dist/index.es.js", - "require": "./dist/index.umd.js" - } - }, "main": "src/index.ts", "publishConfig": { "access": "public", - "main": "dist/index.umd.js", + "main": "dist/index.cjs.js", "module": "dist/index.es.js", "typings": "./dist/index.d.ts" }, diff --git a/packages/react-apollo/package.json b/packages/react-apollo/package.json index a3dc513ac9..f822ec92db 100644 --- a/packages/react-apollo/package.json +++ b/packages/react-apollo/package.json @@ -35,14 +35,10 @@ "main": "src/index.tsx", "publishConfig": { "access": "public", - "main": "dist/index.umd.js", + "main": "dist/index.cjs.js", "module": "dist/index.es.js", "typings": "dist/index.d.ts" }, - "exports": { - "import": "./dist/index.es.js", - "require": "./dist/index.umd.js" - }, "dependencies": { "@nhost/nhost-js": "workspace:*", "subscriptions-transport-ws": "^0.11.0" diff --git a/packages/react-auth/package.json b/packages/react-auth/package.json index b7a4898fb8..44e7afe486 100644 --- a/packages/react-auth/package.json +++ b/packages/react-auth/package.json @@ -34,14 +34,10 @@ "main": "src/index.tsx", "publishConfig": { "access": "public", - "main": "dist/index.umd.js", + "main": "dist/index.cjs.js", "module": "dist/index.es.js", "typings": "dist/index.d.ts" }, - "exports": { - "import": "./dist/index.es.js", - "require": "./dist/index.umd.js" - }, "dependencies": { "@nhost/nhost-js": "workspace:*" },