![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
A generic project configuration loader.
There's probably hundreds out there, but the main appeal of this particular one is the ability to invoke it anywhere in your codebase, without needing to specify anything else (like the config file path itself), with certain prerequisites of course.
$ yarn add gpcl
loadConfigSync()
in your script to access your config object.src/backend/web/app/setup.js
import { loadConfigSync } from "gpcl";
const config = loadConfigSync();
// ...
.config/config.yml
IAC:
Region: !env AWS_REGION
Stage: !env APP_ENV
Templates:
Local: !path lib/blueprints
BucketKey: infrastructure/blueprints
Development:
ServerAddr: '0.0.0.0:4200'
Hateoas: !path .meta/dev/docker_endpoints.json
Output:
{
"IAC": {
"Region": "ap-southeast-2",
"Stage": "staging",
"Templates": {
"Local": "/Users/x/DevProjects/xo/lib/blueprints",
"BucketKey": "infrastructure/blueprints"
}
},
"Development": {
"ServerAddr": "0.0.0.0:4200",
"Hateoas": "/Users/x/DevProjects/xo/.meta/dev/docker_endpoints.json"
}
}
loadConfigSync(configPath?: string, rootDir?: string)
package.json
node_modules
absolute path of your config file. If not specified, it will look for your config file in this order (first in <rootDir>
, then in <rootDir>/config
and vice versa):
<rootDir[/.config, /config]>/config.yml
<rootDir[/.config, /config]>/project.yml
<rootDir[/.config, /config]>/settings.yml
Both params are optional. If you'd like to specify rootDir
without specifying configPath
,
just pass in undefined
as the first parameter.
Note: an error will be thrown if both values are not specified AND cannot be inferred.
Supports anything that is parsable by js-yaml
, plus 2 additional custom types:
!env
type
process.env[!env]
!env NODE_ENV
=> 'production'
!path
type
<rootDir>/<!path>
!path src/app.js
=> /Users/xo/web/src/app.js
This comes bundled with its own type definitions for TypeScript, so you'll get auto-complete and hints if you're using the Visual Studio Code IDE.
I created this after repetitively copy-pasting the same code across various private side-projects for loading configuration, and it became tedious to use path.resolve(__dirname, '..', '..', '..' /* etc */)
on the same config file when calling it from multiple places in the codebase.
If this does not fit your needs, feel free to fork or contribute!
FAQs
personal utility for loading project configuration
The npm package gpcl receives a total of 3 weekly downloads. As such, gpcl popularity was classified as not popular.
We found that gpcl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.