Skip to content

Commit

Permalink
refactor: backport latest projector changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunnamius committed Aug 30, 2021
1 parent 7f60680 commit 14a4c43
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
coverage:
range: '70...100'
range: '75...100'
2 changes: 1 addition & 1 deletion docs/modules/test_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
`options?`): (`fn`:
[`FixtureAction`][13]<[`FixtureContext`][4]<[`FixtureOptions`][5] &
`Partial`<`Record`<`string`, `unknown`> & `CustomOptions`>> & `CustomContext`>)
=> `Promise`<`void`>
\=> `Promise`<`void`>

#### Type parameters

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/types_global.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ The shape of a publicly available meme.
### PublicUser

Ƭ **PublicUser**: `Pick`<[`InternalUser`][21], `"name"` | `"email"` | `"phone"`
| `"username"` | `"deleted"` | `"imageUrl"`> & { `friends`: `number` ; `liked`:
\| `"username"` | `"deleted"` | `"imageUrl"`> & { `friends`: `number` ; `liked`:
`number` ; `user_id`: `string` }

The shape of a publicly available user.
Expand Down
36 changes: 24 additions & 12 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ const { verifyEnvironment } = require('./expect-env');
const nodeExternals = require('webpack-node-externals');
const debug = require('debug')(`${require('./package.json').name}:webpack-config`);

const IMPORT_ALIASES = {
universe: `${__dirname}/src/`,
multiverse: `${__dirname}/lib/`,
testverse: `${__dirname}/test/`,
externals: `${__dirname}/external-scripts/`,
types: `${__dirname}/types/`,
package: `${__dirname}/package.json`
};

let sanitizedEnv = {};
let { NODE_ENV: nodeEnv, ...sanitizedProcessEnv } = {
...process.env,
Expand Down Expand Up @@ -74,7 +83,12 @@ const externals = [
errorDetails: true
},
resolve: { extensions: ['.ts', '.wasm', '.mjs', '.cjs', '.js', '.json'] },
resolve: {
extensions: ['.ts', '.wasm', '.mjs', '.cjs', '.js', '.json'],
// ! If changed, also update these aliases in tsconfig.json,
// ! jest.config.js, next.config.ts, and .eslintrc.js
alias: IMPORT_ALIASES
},
module: {
rules: [{ test: /\.(ts|js)x?$/, loader: 'babel-loader', exclude: /node_modules/ }]
},
Expand Down Expand Up @@ -120,14 +134,7 @@ const externalsConfig = {
extensions: ['.ts', '.wasm', '.mjs', '.cjs', '.js', '.json'],
// ! If changed, also update these aliases in tsconfig.json,
// ! jest.config.js, next.config.ts, and .eslintrc.js
alias: {
universe: `${__dirname}/src/`,
multiverse: `${__dirname}/lib/`,
testverse: `${__dirname}/test/`,
externals: `${__dirname}/external-scripts/`,
types: `${__dirname}/types/`,
package: `${__dirname}/package.json`
}
alias: IMPORT_ALIASES
},
module: {
rules: [
Expand All @@ -146,7 +153,7 @@ const externalsConfig = {
]
};

/*const cliConfig = {
/* const cliConfig = {
name: 'cli',
mode: 'production',
target: 'node',
Expand All @@ -169,7 +176,12 @@ const externalsConfig = {
errorDetails: true
},
resolve: { extensions: ['.ts', '.wasm', '.mjs', '.cjs', '.js', '.json'] },
resolve: {
extensions: ['.ts', '.wasm', '.mjs', '.cjs', '.js', '.json'],
// ! If changed, also update these aliases in tsconfig.json,
// ! jest.config.js, next.config.ts, and .eslintrc.js
alias: IMPORT_ALIASES
},
module: {
rules: [{ test: /\.(ts|js)x?$/, loader: 'babel-loader', exclude: /node_modules/ }]
},
Expand All @@ -179,7 +191,7 @@ const externalsConfig = {
// * ▼ For bundled CLI applications, make entry file executable w/ shebang
new BannerPlugin({ banner: '#!/usr/bin/env node', raw: true, entryOnly: true })
]
};*/
}; */

module.exports = [/*libConfig,*/ externalsConfig /*, cliConfig*/];
debug('exports: %O', module.exports);

0 comments on commit 14a4c43

Please sign in to comment.