diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 00000000..d23208fb --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.runmaterc.cjs b/.runmaterc.js similarity index 100% rename from .runmaterc.cjs rename to .runmaterc.js diff --git a/package.json b/package.json index 0dab7464..56fc2e37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "powership", - "version": "2.3.2", + "version": "3.1.2", "private": true, "scripts": { "pack": "run-s pack:*", diff --git a/packages/accounts/.babelrc.cjs b/packages/accounts/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/accounts/.babelrc.cjs +++ b/packages/accounts/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/accounts/.eslintrc.cjs b/packages/accounts/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/accounts/.eslintrc.cjs +++ b/packages/accounts/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/accounts/jest.config.cjs b/packages/accounts/jest.config.cjs index a41077b4..fba5c8c0 100644 --- a/packages/accounts/jest.config.cjs +++ b/packages/accounts/jest.config.cjs @@ -4,5 +4,5 @@ module.exports = { modulePathIgnorePatterns: ['node_modules', 'testing.d.ts'], testEnvironment: 'node', testTimeout: +(process.env.TEST_TIMEOUT || 30000), - setupFilesAfterEnv: ['/setupTests.js'], + setupFilesAfterEnv: ['/setupTests.cjs'], }; diff --git a/packages/accounts/package.json b/packages/accounts/package.json index 4d55f126..9807002f 100644 --- a/packages/accounts/package.json +++ b/packages/accounts/package.json @@ -1,19 +1,21 @@ { "name": "@powership/accounts", - "version": "2.3.2", + "version": "3.1.2", "description": "Powership accounts", "type": "module", - "main": "./out/index.js", - "module": "./out/module/index.js", + "main": "./out/index.cjs", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + } }, "browser": { - "out/module/index.js": "./out/browser/module/index.js", - "out/index.js": "./out/browser/index.js" + "out/module/index.mjs": "./out/browser/module/index.mjs", + "out/index.cjs": "./out/browser/index.cjs" }, "sideEffects": false, "license": "MIT", @@ -26,8 +28,10 @@ "fix:lint": "eslint src --ext .ts --fix", "prepublishOnly": "run-s build fix && run-p test", "build-targets": "run-p build:*", - "build:node": "TARGET=node npm run babild -- --out-xdir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/babel-plugins/.eslintrc.cjs b/packages/babel-plugins/.eslintrc.cjs index 6dc7eb6c..b26b9993 100644 --- a/packages/babel-plugins/.eslintrc.cjs +++ b/packages/babel-plugins/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('../../.eslintrc') +module.exports = require('../../.eslintrc.cjs') diff --git a/packages/babel-plugins/package.json b/packages/babel-plugins/package.json index c8ed4e0f..e0854a2c 100644 --- a/packages/babel-plugins/package.json +++ b/packages/babel-plugins/package.json @@ -1,6 +1,6 @@ { "name": "@powership/babel-plugins", - "version": "2.3.2", + "version": "3.1.2", "main": "out", "sideEffects": false, "typings": "out", diff --git a/packages/boilerplate/package.json b/packages/boilerplate/package.json index fa04af7d..ffab2e6c 100644 --- a/packages/boilerplate/package.json +++ b/packages/boilerplate/package.json @@ -1,10 +1,9 @@ { "name": "@powership/boilerplate", - "version": "2.3.2", - "main": "out/index.js", - "module": "out/module/index.js", + "version": "3.1.2", "author": "antoniopresto ", "sideEffects": false, + "type": "module", "scripts": { "clear": "rimraf dist", "fix": "run-s fix:* ", diff --git a/packages/deepstate/.babelrc.cjs b/packages/deepstate/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/deepstate/.babelrc.cjs +++ b/packages/deepstate/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/deepstate/.eslintrc.cjs b/packages/deepstate/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/deepstate/.eslintrc.cjs +++ b/packages/deepstate/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/deepstate/jest.config.cjs b/packages/deepstate/jest.config.cjs index a41077b4..fba5c8c0 100644 --- a/packages/deepstate/jest.config.cjs +++ b/packages/deepstate/jest.config.cjs @@ -4,5 +4,5 @@ module.exports = { modulePathIgnorePatterns: ['node_modules', 'testing.d.ts'], testEnvironment: 'node', testTimeout: +(process.env.TEST_TIMEOUT || 30000), - setupFilesAfterEnv: ['/setupTests.js'], + setupFilesAfterEnv: ['/setupTests.cjs'], }; diff --git a/packages/deepstate/package.json b/packages/deepstate/package.json index 2a9ee530..b43e2300 100644 --- a/packages/deepstate/package.json +++ b/packages/deepstate/package.json @@ -1,12 +1,12 @@ { "name": "@powership/deepstate", - "version": "2.3.2", + "version": "3.1.2", "main": "out/index.js", - "module": "out/module/index.js", + "module": "out/module/index.mjs", "sideEffects": false, "browser": { - "out/module/index.js": "./out/browser/module/index.js", - "out/index.js": "./out/browser/index.js" + "out/module/index.mjs": "./out/browser/module/index.mjs", + "out/index.cjs": "./out/browser/index.cjs" }, "author": "antoniopresto ", "license": "MPL-2.0", @@ -20,10 +20,10 @@ "fix:lint": "eslint src --ext .ts --fix", "prepublishOnly": "run-p build fix && run-p test", "build-targets": "run-p build:*", - "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser", - "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/entity/.babelrc.cjs b/packages/entity/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/entity/.babelrc.cjs +++ b/packages/entity/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/entity/.eslintrc.cjs b/packages/entity/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/entity/.eslintrc.cjs +++ b/packages/entity/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/entity/jest.config.cjs b/packages/entity/jest.config.cjs index a41077b4..fba5c8c0 100644 --- a/packages/entity/jest.config.cjs +++ b/packages/entity/jest.config.cjs @@ -4,5 +4,5 @@ module.exports = { modulePathIgnorePatterns: ['node_modules', 'testing.d.ts'], testEnvironment: 'node', testTimeout: +(process.env.TEST_TIMEOUT || 30000), - setupFilesAfterEnv: ['/setupTests.js'], + setupFilesAfterEnv: ['/setupTests.cjs'], }; diff --git a/packages/entity/package.json b/packages/entity/package.json index 3d02aacd..573e2fe4 100644 --- a/packages/entity/package.json +++ b/packages/entity/package.json @@ -1,14 +1,16 @@ { "name": "@powership/entity", - "version": "2.3.2", + "version": "3.1.2", "type": "module", - "main": "./out/index.js", - "module": "./out/module/index.js", + "main": "./out/index.cjs", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + } }, "author": "antoniopresto ", "license": "MIT", @@ -22,8 +24,10 @@ "fix:lint": "eslint src --ext .ts --fix", "prepublishOnly": "run-s build fix && run-p test", "build-targets": "run-p build:*", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/entity/src/__tests__/Aliases.spec.ts b/packages/entity/src/__tests__/Aliases.spec.ts index 1bd5adae..b6320442 100644 --- a/packages/entity/src/__tests__/Aliases.spec.ts +++ b/packages/entity/src/__tests__/Aliases.spec.ts @@ -1,5 +1,6 @@ import { MongoTransporter } from '@powership/mongo'; import { AppMock, createAppMock } from '@powership/mongo/out/test-utils'; + import { createSchema, createType, Infer, ULID_REGEX } from '@powership/schema'; import { tupleEnum } from '@powership/utils'; diff --git a/packages/entity/src/__tests__/Product.spec.ts b/packages/entity/src/__tests__/Product.spec.ts index 4e2f0da4..8e542466 100644 --- a/packages/entity/src/__tests__/Product.spec.ts +++ b/packages/entity/src/__tests__/Product.spec.ts @@ -1,5 +1,6 @@ import { MongoTransporter } from '@powership/mongo'; import { AppMock, createAppMock } from '@powership/mongo/out/test-utils'; + import { createType, ObjectType, diff --git a/packages/entity/src/__tests__/ProductResolver.spec.ts b/packages/entity/src/__tests__/ProductResolver.spec.ts index bc6dc391..c49d3075 100644 --- a/packages/entity/src/__tests__/ProductResolver.spec.ts +++ b/packages/entity/src/__tests__/ProductResolver.spec.ts @@ -1,5 +1,5 @@ import { CircularDeps, createResolver, Infer } from '@powership/schema'; -import { createGraphQLSchema } from '@powership/schema/out/createGraphQLSchema'; +import { createGraphQLSchema } from '@powership/schema'; import { PaginationResult } from '@powership/transporter'; import { notNull, NullableToPartial, PromiseType } from '@powership/utils'; import { assert, IsExact } from 'conditional-type-checks'; diff --git a/packages/entity/src/__tests__/mockApp.ts b/packages/entity/src/__tests__/mockApp.ts index e79b7ec2..c620ebbd 100644 --- a/packages/entity/src/__tests__/mockApp.ts +++ b/packages/entity/src/__tests__/mockApp.ts @@ -1,5 +1,6 @@ import { MongoTransporter } from '@powership/mongo'; import { AppMock, createAppMock } from '@powership/mongo/out/test-utils'; + import { ObjectType } from '@powership/schema'; export function mockApp() { diff --git a/packages/entity/src/__tests__/setupProductTest.ts b/packages/entity/src/__tests__/setupProductTest.ts index 9d765d46..73b73088 100644 --- a/packages/entity/src/__tests__/setupProductTest.ts +++ b/packages/entity/src/__tests__/setupProductTest.ts @@ -1,5 +1,8 @@ import { MongoTransporter } from '@powership/mongo'; -import { AppMock, createAppMock } from '@powership/mongo/out/test-utils'; +import type { AppMock } from '@powership/mongo/out/test-utils'; + +import { createAppMock } from '@powership/mongo/out/test-utils'; + import { createResolver, createSchema, diff --git a/packages/helpers/.babelrc.cjs b/packages/helpers/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/helpers/.babelrc.cjs +++ b/packages/helpers/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/helpers/.eslintrc.cjs b/packages/helpers/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/helpers/.eslintrc.cjs +++ b/packages/helpers/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/helpers/jest.config.cjs b/packages/helpers/jest.config.cjs index a41077b4..fba5c8c0 100644 --- a/packages/helpers/jest.config.cjs +++ b/packages/helpers/jest.config.cjs @@ -4,5 +4,5 @@ module.exports = { modulePathIgnorePatterns: ['node_modules', 'testing.d.ts'], testEnvironment: 'node', testTimeout: +(process.env.TEST_TIMEOUT || 30000), - setupFilesAfterEnv: ['/setupTests.js'], + setupFilesAfterEnv: ['/setupTests.cjs'], }; diff --git a/packages/helpers/package.json b/packages/helpers/package.json index 90608f1e..c52eedd9 100644 --- a/packages/helpers/package.json +++ b/packages/helpers/package.json @@ -1,18 +1,20 @@ { "name": "@powership/helpers", - "version": "2.3.2", + "version": "3.1.2", "type": "module", - "main": "./out/index.js", - "module": "./out/module/index.js", + "main": "./out/index.cjs", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + } }, "browser": { - "out/module/index.js": "./out/browser/module/index.js", - "out/index.js": "./out/browser/index.js" + "out/module/index.mjs": "./out/browser/module/index.mjs", + "out/index.cjs": "./out/browser/index.cjs" }, "author": "antoniopresto ", "license": "MIT", @@ -26,9 +28,10 @@ "fix:lint": "eslint src --ext .ts --fix", "prepublishOnly": "run-s build fix && run-p test", "build-targets": "run-p build:*", - "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/logstorm/.babelrc.cjs b/packages/logstorm/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/logstorm/.babelrc.cjs +++ b/packages/logstorm/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/logstorm/.eslintrc.cjs b/packages/logstorm/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/logstorm/.eslintrc.cjs +++ b/packages/logstorm/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/logstorm/package.json b/packages/logstorm/package.json index 36bd3f40..470a739a 100644 --- a/packages/logstorm/package.json +++ b/packages/logstorm/package.json @@ -1,20 +1,22 @@ { "name": "logstorm", - "version": "2.3.2", + "version": "3.1.2", "typings": "out", "author": "antoniopresto ", "type": "module", - "main": "./out/index.js", - "module": "./out/module/index.js", + "main": "./out/index.cjs", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + } }, "browser": { - "out/module/index.js": "./out/browser/module/index.js", - "out/index.js": "./out/browser/index.js" + "out/module/index.mjs": "./out/browser/module/index.mjs", + "out/index.cjs": "./out/browser/index.cjs" }, "sideEffects": false, "license": "MIT", @@ -27,8 +29,10 @@ "clear": "rimraf out", "prepublishOnly": "run-s build fix && run-p test", "build-targets": "run-p build:*", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/mongo/.babelrc.cjs b/packages/mongo/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/mongo/.babelrc.cjs +++ b/packages/mongo/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/mongo/.eslintrc.cjs b/packages/mongo/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/mongo/.eslintrc.cjs +++ b/packages/mongo/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/mongo/jest.config.cjs b/packages/mongo/jest.config.cjs index a41077b4..fba5c8c0 100644 --- a/packages/mongo/jest.config.cjs +++ b/packages/mongo/jest.config.cjs @@ -4,5 +4,5 @@ module.exports = { modulePathIgnorePatterns: ['node_modules', 'testing.d.ts'], testEnvironment: 'node', testTimeout: +(process.env.TEST_TIMEOUT || 30000), - setupFilesAfterEnv: ['/setupTests.js'], + setupFilesAfterEnv: ['/setupTests.cjs'], }; diff --git a/packages/mongo/package.json b/packages/mongo/package.json index 6b67f961..8f3c8b13 100644 --- a/packages/mongo/package.json +++ b/packages/mongo/package.json @@ -1,14 +1,21 @@ { "name": "@powership/mongo", - "version": "2.3.2", + "version": "3.1.2", "type": "module", - "main": "./out/index.js", - "module": "./out/module/index.js", + "main": "./out/index.cjs", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + }, + "./out/test-utils": { + "types": "./out/test-utils/index.d.ts", + "import": "./out/module/test-utils/index.mjs", + "require": "./out/test-utils/index.cjs" + } }, "sideEffects": false, "license": "MIT", @@ -21,8 +28,10 @@ "fix:lint": "eslint src --ext .ts --fix", "prepublishOnly": "run-s build fix && run-p test", "build-targets": "run-p build:*", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/powership/.babelrc.cjs b/packages/powership/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/powership/.babelrc.cjs +++ b/packages/powership/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/powership/.eslintrc.cjs b/packages/powership/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/powership/.eslintrc.cjs +++ b/packages/powership/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/powership/jest.config.cjs b/packages/powership/jest.config.cjs index a41077b4..fba5c8c0 100644 --- a/packages/powership/jest.config.cjs +++ b/packages/powership/jest.config.cjs @@ -4,5 +4,5 @@ module.exports = { modulePathIgnorePatterns: ['node_modules', 'testing.d.ts'], testEnvironment: 'node', testTimeout: +(process.env.TEST_TIMEOUT || 30000), - setupFilesAfterEnv: ['/setupTests.js'], + setupFilesAfterEnv: ['/setupTests.cjs'], }; diff --git a/packages/powership/package.json b/packages/powership/package.json index 5d4aafa1..ca944d1e 100644 --- a/packages/powership/package.json +++ b/packages/powership/package.json @@ -1,19 +1,21 @@ { "name": "powership", - "version": "2.3.2", + "version": "3.1.2", "author": "antoniopresto ", "type": "module", - "main": "./out/index.js", - "module": "./out/module/index.js", + "main": "./out/index.cjs", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + } }, "browser": { - "out/module/index.js": "./out/browser/module/index.js", - "out/index.js": "./out/browser/index.js" + "out/module/index.mjs": "./out/browser/module/index.mjs", + "out/index.cjs": "./out/browser/index.cjs" }, "sideEffects": false, "license": "MIT", @@ -26,10 +28,10 @@ "fix:lint": "eslint src --ext .ts --fix", "prepublishOnly": "run-s build fix && run-p test", "build-targets": "run-p build:*", - "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser", - "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/runmate/.babelrc.cjs b/packages/runmate/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/runmate/.babelrc.cjs +++ b/packages/runmate/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/runmate/.eslintrc.cjs b/packages/runmate/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/runmate/.eslintrc.cjs +++ b/packages/runmate/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/runmate/package.json b/packages/runmate/package.json index 6275320c..9138fbc3 100644 --- a/packages/runmate/package.json +++ b/packages/runmate/package.json @@ -1,11 +1,11 @@ { "name": "runmate", - "version": "2.3.2", + "version": "3.1.2", "typings": "out", "author": "antoniopresto ", "license": "MIT", "main": "out/index.js", - "module": "out/module/index.js", + "module": "out/module/index.mjs", "bin": { "run": "./out/cli.js", "z": "./out/cli.js" @@ -20,8 +20,10 @@ "clear": "rimraf out", "prepublishOnly": "run-s build fix && run-p test", "build-targets": "run-p build:*", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/schema/.babelrc.cjs b/packages/schema/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/schema/.babelrc.cjs +++ b/packages/schema/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/schema/.eslintrc.cjs b/packages/schema/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/schema/.eslintrc.cjs +++ b/packages/schema/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/schema/jest.config.cjs b/packages/schema/jest.config.cjs index bce7e1b8..c0abde55 100644 --- a/packages/schema/jest.config.cjs +++ b/packages/schema/jest.config.cjs @@ -6,7 +6,7 @@ module.exports = { testTimeout: +(process.env.TEST_TIMEOUT || 30000), testRegex: '(spec|test)\\.tsx?$', modulePathIgnorePatterns: ['node_modules', 'testing.d.ts'], - setupFilesAfterEnv: ['/setupTests.js'], + setupFilesAfterEnv: ['/setupTests.cjs'], moduleNameMapper: pathsToModuleNameMapper( { '@powership/schema': ['./index.ts'], diff --git a/packages/schema/package.json b/packages/schema/package.json index b5a0a176..fcf628b2 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,18 +1,20 @@ { "name": "@powership/schema", - "version": "2.3.2", + "version": "3.1.2", "type": "module", - "main": "./out/index.js", - "module": "./out/module/index.js", + "main": "./out/index.cjs", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + } }, "browser": { - "out/module/index.js": "./out/browser/module/index.js", - "out/index.js": "./out/browser/index.js" + "out/module/index.mjs": "./out/browser/module/index.mjs", + "out/index.cjs": "./out/browser/index.cjs" }, "sideEffects": false, "author": "antoniopresto ", @@ -27,10 +29,10 @@ "fix:lint": "eslint src --ext .ts --fix", "prepublishOnly": "run-p build fix && run-p test", "build-targets": "run-p build:*", - "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser", - "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/schema/src/CircularDeps.ts b/packages/schema/src/CircularDeps.ts index 42602d13..9e5bff14 100644 --- a/packages/schema/src/CircularDeps.ts +++ b/packages/schema/src/CircularDeps.ts @@ -3,6 +3,8 @@ */ import { RuntimeError } from '@powership/utils'; import { isBrowser } from '@powership/utils'; +// @only-server +import { parsePhoneNumber } from '@powership/utils'; import { fieldTypeNames } from './fields/fieldTypeNames'; import type { FieldCreators } from './fields/fieldTypes'; @@ -72,9 +74,10 @@ function getModules() { parsePhoneNumberServerSide: { // @only-server - module: () => + module: () => ({ // @only-server - require('@powership/utils/out/parsePhoneNumber') as typeof import('@powership/utils/out/parsePhoneNumber'), + parsePhoneNumber, + }), server: true, }, diff --git a/packages/server/.babelrc.cjs b/packages/server/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/server/.babelrc.cjs +++ b/packages/server/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/server/.eslintrc.cjs b/packages/server/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/server/.eslintrc.cjs +++ b/packages/server/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/server/package.json b/packages/server/package.json index 07253e87..4cad9bc8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,18 +1,20 @@ { "name": "@powership/server", - "version": "2.3.2", + "version": "3.1.2", "type": "module", - "main": "./out/index.js", - "module": "./out/module/index.js", + "main": "./out/index.cjs", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + } }, "browser": { - "out/module/index.js": "./out/browser/module/index.js", - "out/index.js": "./out/browser/index.js" + "out/module/index.mjs": "./out/browser/module/index.mjs", + "out/index.cjs": "./out/browser/index.cjs" }, "sideEffects": false, "license": "MIT", @@ -27,9 +29,9 @@ "fix:lint": "eslint src --ext .ts --fix", "prepublishOnly": "run-p build fix && run-p test", "build-targets": "run-p build:*", - "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/transporter/.babelrc.cjs b/packages/transporter/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/transporter/.babelrc.cjs +++ b/packages/transporter/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/transporter/.eslintrc.cjs b/packages/transporter/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/transporter/.eslintrc.cjs +++ b/packages/transporter/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/transporter/jest.config.cjs b/packages/transporter/jest.config.cjs index a41077b4..fba5c8c0 100644 --- a/packages/transporter/jest.config.cjs +++ b/packages/transporter/jest.config.cjs @@ -4,5 +4,5 @@ module.exports = { modulePathIgnorePatterns: ['node_modules', 'testing.d.ts'], testEnvironment: 'node', testTimeout: +(process.env.TEST_TIMEOUT || 30000), - setupFilesAfterEnv: ['/setupTests.js'], + setupFilesAfterEnv: ['/setupTests.cjs'], }; diff --git a/packages/transporter/package.json b/packages/transporter/package.json index a346b9c5..7354e12b 100644 --- a/packages/transporter/package.json +++ b/packages/transporter/package.json @@ -1,18 +1,20 @@ { "name": "@powership/transporter", - "version": "2.3.2", + "version": "3.1.2", "type": "module", - "main": "./out/index.js", - "module": "./out/module/index.js", + "main": "./out/index.cjs", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + } }, "browser": { - "out/module/index.js": "./out/browser/module/index.js", - "out/index.js": "./out/browser/index.js" + "out/module/index.mjs": "./out/browser/module/index.mjs", + "out/index.cjs": "./out/browser/index.cjs" }, "sideEffects": false, "author": "antoniopresto ", @@ -26,8 +28,10 @@ "fix:lint": "eslint src --ext .ts --fix", "prepublishOnly": "run-s build fix && run-p test", "build-targets": "run-p build:*", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.declarations.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/transporter/src/parseAggioAttributeFilters.ts b/packages/transporter/src/parseAggioAttributeFilters.ts index 2d30e5d4..a5a81f78 100644 --- a/packages/transporter/src/parseAggioAttributeFilters.ts +++ b/packages/transporter/src/parseAggioAttributeFilters.ts @@ -3,7 +3,7 @@ import { devAssert, Query } from '@powership/utils'; import { getKeys } from '@powership/utils'; import { getTypeName } from '@powership/utils'; import { escapeStringRegexp } from '@powership/utils'; -import { skipper } from '@powership/utils/out/skipper'; +import { skipper } from '@powership/utils'; import { AnyCollectionIndexConfig } from './CollectionIndex'; import { diff --git a/packages/utils/.babelrc.cjs b/packages/utils/.babelrc.cjs index 3dc068f7..3b30a479 100644 --- a/packages/utils/.babelrc.cjs +++ b/packages/utils/.babelrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/babel-config') +module.exports = require('@powership/boilerplate/babel-config.cjs') diff --git a/packages/utils/.eslintrc.cjs b/packages/utils/.eslintrc.cjs index 1c0e5c18..a1bf962d 100644 --- a/packages/utils/.eslintrc.cjs +++ b/packages/utils/.eslintrc.cjs @@ -1 +1 @@ -module.exports = require('@powership/boilerplate/eslintrc') +module.exports = require('@powership/boilerplate/eslintrc.cjs') diff --git a/packages/utils/package.json b/packages/utils/package.json index ec2940be..34c675e8 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,21 +1,23 @@ { "name": "@powership/utils", - "version": "2.3.2", + "version": "3.1.2", "typings": "out", "author": "antoniopresto ", "license": "MIT", "type": "module", "main": "./out/index.cjs", - "module": "./out/module/index.js", + "module": "./out/module/index.mjs", "types": "./out/index.d.ts", "exports": { - "types": "./out/index.d.ts", - "import": "./out/module/index.js", - "require": "./out/index.js" + ".": { + "types": "./out/index.d.ts", + "import": "./out/module/index.mjs", + "require": "./out/index.cjs" + } }, "browser": { - "out/module/index.js": "./out/browser/module/index.js", - "out/index.js": "./out/browser/index.js" + "out/module/index.mjs": "./out/browser/module/index.mjs", + "out/index.cjs": "./out/browser/index.cjs" }, "scripts": { "test": "jest", @@ -26,10 +28,10 @@ "clear": "rimraf out", "prepublishOnly": "run-s build fix && run-p test", "build-targets": "run-p build:*", - "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser", - "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module", - "build:node": "TARGET=node npm run babild -- --out-dir out", - "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module", + "build:browser": "TARGET=browser npm run babild -- --out-dir out/browser --out-file-extension .cjs", + "build:module-browser": "TARGET=module-browser npm run babild -- --out-dir out/browser/module --out-file-extension .mjs", + "build:node": "TARGET=node npm run babild -- --out-dir out --out-file-extension .cjs", + "build:module-node": "TARGET=module-node npm run babild -- --out-dir out/module --out-file-extension .mjs", "declarations": "tsc -p tsconfig.json", "babild": "babel 'src' --extensions '.ts,.tsx' --source-maps=true --ignore '**/__tests__'" }, diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index fd11c56a..2ba5a3a3 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -91,5 +91,7 @@ export * from './jsonToTypescript'; export * from './formatGraphQL'; // @only-server export * from './formatWithPrettier'; +// @only-server +export * from './parsePhoneNumber'; export { TU }; diff --git a/packages/utils/src/jsonToTypescript.ts b/packages/utils/src/jsonToTypescript.ts index b1694c06..ec583796 100644 --- a/packages/utils/src/jsonToTypescript.ts +++ b/packages/utils/src/jsonToTypescript.ts @@ -1,7 +1,6 @@ import type { JSONSchema4 as JSONObject4 } from 'json-schema'; import type { JSONSchema4 } from 'json-schema'; import type { Options } from 'json-schema-to-typescript'; -import { IsStringLiteral } from 'ts-toolbelt/out/Community/IsLiteral'; export { JSONSchema4, JSONObject4 }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e937120a..e829bf52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -729,127 +729,6 @@ importers: specifier: 4.9.3 version: 4.9.3 - packages/method: - dependencies: - '@powership/schema': - specifier: workspace:* - version: link:../schema - '@powership/utils': - specifier: workspace:* - version: link:../utils - devDependencies: - '@babel/cli': - specifier: 7.19.3 - version: 7.19.3(@babel/core@7.19.3) - '@babel/core': - specifier: 7.19.3 - version: 7.19.3 - '@babel/plugin-transform-typescript': - specifier: 7.19.3 - version: 7.19.3(@babel/core@7.19.3) - '@babel/preset-env': - specifier: 7.19.3 - version: 7.19.3(@babel/core@7.19.3) - '@babel/preset-typescript': - specifier: 7.18.6 - version: 7.18.6(@babel/core@7.19.3) - '@powership/babel-plugins': - specifier: workspace:* - version: link:../babel-plugins - '@powership/boilerplate': - specifier: workspace:* - version: link:../boilerplate - '@types/babel__core': - specifier: 7.1.19 - version: 7.1.19 - '@types/babel__helper-plugin-utils': - specifier: 7.10.0 - version: 7.10.0 - '@types/express': - specifier: 4.17.14 - version: 4.17.14 - '@types/jest': - specifier: 29.5.3 - version: 29.5.3 - '@types/json-schema': - specifier: 7.0.11 - version: 7.0.11 - '@types/lodash': - specifier: 4.14.191 - version: 4.14.191 - '@types/node': - specifier: 16.18.3 - version: 16.18.3 - '@types/supertest': - specifier: 2.0.12 - version: 2.0.12 - '@typescript-eslint/eslint-plugin': - specifier: 5.39.0 - version: 5.39.0(@typescript-eslint/parser@5.39.0)(eslint@8.25.0)(typescript@4.9.3) - '@typescript-eslint/parser': - specifier: 5.39.0 - version: 5.39.0(eslint@8.25.0)(typescript@4.9.3) - babel-preset-minify: - specifier: 0.5.2 - version: 0.5.2 - conditional-type-checks: - specifier: 1.0.6 - version: 1.0.6 - esbuild: - specifier: 0.15.10 - version: 0.15.10 - eslint: - specifier: 8.25.0 - version: 8.25.0 - eslint-config-prettier: - specifier: 8.5.0 - version: 8.5.0(eslint@8.25.0) - eslint-plugin-eslint-comments: - specifier: 3.2.0 - version: 3.2.0(eslint@8.25.0) - eslint-plugin-import: - specifier: 2.26.0 - version: 2.26.0(@typescript-eslint/parser@5.39.0)(eslint@8.25.0) - eslint-plugin-sort-keys-fix: - specifier: 1.1.2 - version: 1.1.2 - eslint-plugin-typescript-sort-keys: - specifier: 2.1.0 - version: 2.1.0(@typescript-eslint/parser@5.39.0)(eslint@8.25.0)(typescript@4.9.3) - express: - specifier: 4.18.2 - version: 4.18.2 - graphql: - specifier: 16.6.0 - version: 16.6.0 - jest: - specifier: 29.6.2 - version: 29.6.2(@types/node@16.18.3)(ts-node@10.9.1) - npm-run-all: - specifier: 4.1.5 - version: 4.1.5 - prettier: - specifier: 2.8.8 - version: 2.8.8 - prettier-plugin-multiline-arrays: - specifier: 1.1.3 - version: 1.1.3 - rimraf: - specifier: 3.0.2 - version: 3.0.2 - supertest: - specifier: 6.3.0 - version: 6.3.0 - ts-jest: - specifier: 29.1.0 - version: 29.1.0(@babel/core@7.19.3)(esbuild@0.15.10)(jest@29.6.2)(typescript@4.9.3) - typedoc: - specifier: 0.23.24 - version: 0.23.24(typescript@4.9.3) - typescript: - specifier: 4.9.3 - version: 4.9.3 - packages/mongo: dependencies: '@powership/schema':