Skip to content

Commit 1e74cfa

Browse files
committed
feat: issue-#82 - conditional source-maps
- Removed 'iife' build. - Moved 'sourceMap' setting, from root 'tsconfig', to 'rollup.config', to ensure we can make it conditional. - Corrected typo in 'sortOn' module doc block.
1 parent f2dc430 commit 1e74cfa

File tree

4 files changed

+10
-26
lines changed

4 files changed

+10
-26
lines changed

packages/fjl/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Reference 'dist/index.*.min.js', and/or 'dist/(esm/cjs)/index*' directly (or use
3131
### About Currying:
3232

3333
- All methods, with arity greater than one, have curried counterparts, which start with a leading `$` symbol; E.g., `foldl`'s curried version is `$foldl`.
34-
- Methods that take only 'rest' parameters don't have curried counterparts `concat`, `append` etc..
34+
- Methods that take only 'rest' parameters don't have curried counterparts `concat`, `append` etc.
3535

3636
### Notable methods not added from the haskell prelude:
3737

@@ -42,21 +42,20 @@ Reference 'dist/index.*.min.js', and/or 'dist/(esm/cjs)/index*' directly (or use
4242
- Sources are in './src'
4343
- './src/_platform' are native platform specific method versions pulled out for use, in some places, where we didn't want to intermingle library methods with native ones.
4444
- Distributions are in '**/dist'
45-
- Docs are generated via typedoc to './docs' dir.
45+
- Docs are generated via typedoc to './docs'.
4646
- Docs are written inline, in source using [jsdoc](http://usejsdoc.com), and tsdoc syntax.
47-
- About non-conformity to full modularity (one-function-per-file) method layout - This approach is a work in progress and eventually all methods will have standalone files.
4847

4948
### Package scripts:
5049

5150
- `build` - Builds docs and distribution ('./dist').
5251
- `test` - Runs unit tests.
53-
- See 'package.json.scripts' for more.
52+
- ... See 'package.json.scripts' for more.
5453

5554
### Unit testing:
5655

57-
We are using 'jest' for unit tests, but plan on migrating to 'deno'.
56+
We are using 'jest' for unit tests, currently, but plan on migrating to 'deno', for development, linting, testing, etc.
5857

59-
All tests can be, currently, found in './tests' dir.
58+
All tests currently found in './tests'.
6059

6160
## License:
6261

packages/fjl/src/list/sortOn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const
1212
* input list. This is called the decorate-sort-undecorate paradigm, or
1313
* Schwartzian transform.
1414
*
15-
* Elements are arranged from from lowest to highest, keeping duplicates
15+
* Elements are arranged from lowest to highest, keeping duplicates
1616
* in the order they appeared in the input.
1717
*
1818
* Ex:

rollup.config.mjs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,14 @@ const
77

88
__dirname = path.dirname(new URL(import.meta.url).pathname),
99

10-
{log, error, warn} = console,
10+
{log, error} = console,
1111

1212
isDev = !process.env.NODE_ENV || process.env.NODE_ENV.toLowerCase().startsWith('dev'),
1313

14-
nonAlnumRegex = /[^a-z\d]+/g,
15-
16-
camelCase = xs =>
17-
xs.split(nonAlnumRegex)
18-
.map(_xs => _xs[0].toUpperCase() + _xs.slice(1))
19-
.join(''),
20-
2114
projectNames = ['fjl', 'fjl-validator', 'fjl-inputfilter'/*, 'fjl-validator-recaptcha'*/],
2215

2316
configs = projectNames.flatMap(projectName => {
2417
const projectPath = path.join(__dirname, `./packages/${projectName}`),
25-
iifeName = camelCase(projectName),
2618
configBase = {
2719
input: path.join(projectPath, 'src/index.ts'),
2820
treeshake: false,
@@ -64,6 +56,9 @@ const
6456
plugins: [
6557
typescript({
6658
tsconfig: path.join(projectPath, './tsconfig.prod.esm.json'),
59+
compilerOptions: {
60+
sourceMap: isDev
61+
}
6762
}),
6863
terser()
6964
]
@@ -77,15 +72,6 @@ const
7772
preserveModulesRoot: path.join(projectPath, 'src'),
7873
},
7974
plugins
80-
}, {
81-
...configBase,
82-
output: {
83-
...outputBase,
84-
format: 'iife',
85-
file: path.join(projectPath, 'dist/index.iife.min.js'),
86-
name: iifeName,
87-
},
88-
plugins
8975
}];
9076
});
9177

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"noImplicitThis": true,
1111
"removeComments": false,
1212
"preserveConstEnums": true,
13-
"sourceMap": true,
1413
"strictNullChecks": false,
1514
"target": "ES2017",
1615
"declaration": false

0 commit comments

Comments
 (0)