@learncard/network-brain-client 2.5.42 → 2.5.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esbuild.mjs DELETED
@@ -1,25 +0,0 @@
1
- import { build } from 'esbuild';
2
-
3
- const startTime = Date.now();
4
-
5
- console.log('🎁 Building main bundle...');
6
-
7
- const finalBuildObj = {
8
- entryPoints: ['src/index.ts'],
9
- platform: 'node',
10
- bundle: true,
11
- format: 'cjs',
12
- outdir: 'dist',
13
- target: 'node18',
14
- external: [],
15
- minify: true,
16
- };
17
-
18
- if (process.env.NODE_ENV !== 'production') {
19
- finalBuildObj.sourcemap = 'inline';
20
- finalBuildObj.minify = false;
21
- }
22
-
23
- await build(finalBuildObj).then(() => {
24
- console.log(`🎁 Done building main bundle! (${Date.now() - startTime}ms)`);
25
- });
package/project.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "$schema": "../../../node_modules/nx/schemas/project-schema.json",
3
- "name": "network-brain-client",
4
- "sourceRoot": "packages/learn-card-network/brain-client/src",
5
- "projectType": "library",
6
- "root": "packages/learn-card-network/brain-client",
7
- "tags": [],
8
- "implicitDependencies": ["types", "network-brain-service"],
9
- "namedInputs": {
10
- "source": ["{projectRoot}/src/**/*"],
11
- "scripts": ["{projectRoot}/scripts/**/*"],
12
- "dist": ["{projectRoot}/dist/**/*"]
13
- },
14
- "targets": {
15
- "build": {
16
- "executor": "nx:run-script",
17
- "inputs": ["source", "scripts"],
18
- "options": {
19
- "script": "build"
20
- }
21
- }
22
- }
23
- }
package/scripts/.eslintrc DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "root": false,
3
- "env": {
4
- "node": true
5
- },
6
- "rules": {
7
- "no-console": "off",
8
- "@typescript-eslint/no-var-requires": "off"
9
- }
10
- }
package/scripts/build.mjs DELETED
@@ -1,76 +0,0 @@
1
- import path from 'path';
2
-
3
- import esbuild from 'esbuild';
4
- import { NodeResolvePlugin } from '@esbuild-plugins/node-resolve';
5
- import fs from 'fs/promises';
6
-
7
- const nodeResolveExternal = NodeResolvePlugin({
8
- extensions: ['.ts', '.js', '.tsx', '.jsx', '.cjs', '.mjs'],
9
- onResolved: resolved => {
10
- if (resolved.includes('node_modules')) {
11
- return {
12
- external: true,
13
- };
14
- }
15
- return resolved;
16
- },
17
- });
18
-
19
- const configurations = [
20
- {
21
- keepNames: true,
22
- bundle: true,
23
- sourcemap: 'external',
24
- tsconfig: 'tsconfig.json',
25
- plugins: [nodeResolveExternal],
26
- entryPoints: ['src/index.ts'],
27
- format: 'cjs',
28
- outfile: 'dist/brain-client.cjs.development.js',
29
- },
30
- {
31
- keepNames: true,
32
- bundle: true,
33
- sourcemap: 'external',
34
- tsconfig: 'tsconfig.json',
35
- plugins: [nodeResolveExternal],
36
- entryPoints: ['src/index.ts'],
37
- minify: true,
38
- format: 'cjs',
39
- outfile: 'dist/brain-client.cjs.production.min.js',
40
- },
41
- {
42
- keepNames: true,
43
- bundle: true,
44
- sourcemap: 'external',
45
- tsconfig: 'tsconfig.json',
46
- // For the ESM build, rely on esbuild's default resolution and
47
- // bundle dependencies like @learncard/helpers directly, so we
48
- // don't end up importing the CJS helpers build that uses
49
- // dynamic require('query-string') in the browser.
50
- plugins: [],
51
- entryPoints: ['src/index.ts'],
52
- format: 'esm',
53
- outfile: 'dist/brain-client.esm.js',
54
- },
55
- ];
56
-
57
- function asyncRimraf(path) {
58
- return fs.rm(path, { recursive: true, force: true });
59
- }
60
-
61
- await Promise.all(
62
- configurations.map(async config => {
63
- var dir = config.outdir || path.dirname(config.outfile);
64
- await asyncRimraf(dir).catch(() => {
65
- console.log('Unable to delete directory', dir);
66
- });
67
- })
68
- );
69
-
70
- await Promise.all(configurations.map(config => esbuild.build(config))).catch(err => {
71
- console.error('❌ Build failed');
72
- process.exit(1);
73
- });
74
-
75
- console.log('✔ Build successful');
76
- process.exit(0);
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./brain-client.cjs.production.min.js');
5
- } else {
6
- module.exports = require('./brain-client.cjs.development.js');
7
- }
package/tsconfig.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "lib": ["es2022"],
4
- "module": "esnext",
5
- "moduleResolution": "bundler",
6
- "resolveJsonModule": true,
7
- "removeComments": true,
8
- "preserveConstEnums": true,
9
- "strict": true,
10
- "alwaysStrict": true,
11
- "strictNullChecks": true,
12
- "noUncheckedIndexedAccess": true,
13
-
14
- "noImplicitAny": true,
15
- "noImplicitReturns": true,
16
- "noImplicitThis": true,
17
- "noUnusedLocals": true,
18
- "noUnusedParameters": true,
19
- "allowUnreachableCode": false,
20
- "noFallthroughCasesInSwitch": true,
21
-
22
- "target": "es2022",
23
- "outDir": "dist",
24
- "rootDir": "src",
25
- "declaration": true,
26
- "declarationMap": true,
27
- "emitDeclarationOnly": true,
28
- "sourceMap": true,
29
-
30
- "esModuleInterop": true,
31
- "allowSyntheticDefaultImports": true,
32
- "allowJs": false,
33
- "skipLibCheck": true,
34
- "forceConsistentCasingInFileNames": true
35
- },
36
- "exclude": ["./dist/**/*", "./node_modules/**/*"]
37
- }