Rework package structure #15
Labels
Domain: main
[Issue / PR] describes change in the functionality, its optimization
Domain: meta
[Issue / PR] describes change in the development process, documentation, maintenance etc.
Pending: unclear
[Issue] not yet fully defined
Priority: low
[Issue / PR] could be addressed at any convenient time
Type: improvement
[Issue / PR] addresses lack of a functionality or an open possibility of enhancement
Type: investigation
[Issue / PR] addresses the need of gaining intel
Files that are available to third-party packages
Package info files
@iso4217/json/LICENSE
@iso4217/json/package.json
@iso4217/json/README.md
Package meta scripts
@iso4217/json/postinstall.js
Business logic
@iso4217/json/data.json
@iso4217/json/data-grouped-by-*.json
@iso4217/json/build-grouped-by-data-files.{d.ts,d.ts.map,js,js.map}
@iso4217/json/index.{d.ts,d.ts.map,js,js.map}
@iso4217/json/js-xml.type.{d.ts,d.ts.map}
@iso4217/json/write-to-file.{d.ts,d.ts.map,js,js.map}
Usage scenarios of
@iso4217/json
that involve working with files inside the package⛔️ Import ISO 4217 data by reading the file
./data.json
👎 The file's location in
node_modules
is explicitly mentioned in README:path/to/node_modules/@iso4217/json/data.json
👍 Although the file must be referenced directly, usage of
require.resolve(…)
is suggested, which is very different from something likepath.resolve(…)
and allows for flexibility in file location./data.json
→./dist/data.json
)data.json
file would have to be copied tosrc
/dist
(having two copies of it), or the business logic files would have to refer to the file in the parent folderpackage.json
is referenced in many packages, so this seems promising⛔️ Generating
data-grouped-by-*.json
files automaticallyUpon
npm install
, unless--ignore-scripts
is used, the environment variablesISO4217_JSON_BUILD_DATA_GROUPED_BY_{criteria}
specify wither to generate a corresponding data file. This file would then have to be referenced directly, usingpath.resolve(…)
orrequire.resolve(…)
../postinstall.js
"postinstall"
script in package.jsonnode_modules
are explicitly mentioned in README:path/to/node_modules/@iso4217/json/data-grouped-by-*.json
./data-grouped-by-*.json
→./dist/data-grouped-by-*.json
)⛔️ Generating
data-grouped-by-*.json
files manually./build-grouped-by-data-files.js
npm install
npm install
phasenode path/to/node_modules/@iso4217/json/postinstall.js
postinstall
is a higher abstraction, and the file sits on its place🔄 Import ISO 4217 data with
import
statement./index.{js,d.ts}
"exports"
field in package.json, which is supported sincev14.13.0
andv12.20.0
🔄 Import
JSXml
type./index.{js,d.ts}
"exports"
The text was updated successfully, but these errors were encountered: