Closed bensafran closed 3 years ago
These are good points and I'll include them with the next update.
As for including the server url and credentials or not, this is something for developers to manage on their own repos. For this template repo though, this information (either in package.json or a separate file) needs to exist for people to know where it should be specified.
Thank you !
Regarding Auth info, I think an untracked .env file would work great like in this repo: https://github.com/ptc-iot-sharing/ThingworxDemoWebpackWidget
This might seem like a far-fetched idea but maybe having a simple CLI tool would be better to avoid duplicating code accross similar projects:
thingworx config --global server http://tw.example.com
thingworx config --global appkey 1924-77546-454545-45454
thingworx upload
It would separate devops and actual content. I'm sure this is not in scope at the moment but it might be worth taking a look in the future.
An .env
file is what I'm leaning towards as well and what I'll most probably go with.
We've got multiple TWX extensions in a monorepo, and I refactored gulpfile.js
so there's a single copy of the gulpfile, and all the configs.
twx monorepo
├── .eslintrc // enforces coding standards, including TWX rules like naming conventions
├── .prettierrc
├── tsconfig.eslint.json // only used by eslint
├── package.json // eslint and prettier deps
├── scripts/ // scripts for orchestrating build process
├── infrastructure/ // infrastructure-as-code (ie. terraform )
├── extensions-twx/ // directory with conventional extensions exported from Composer
├── extensions-ts/ // directory with typescript extenstions
├── package.json // deps + types for building ts exensions
├── gulpfile.js
├── twxconfig.json
├── tsconfig.json // tsconfig for building ts extensions
├── TSExtension1
│ ├── package.json // no deps, mostly extension metadata (version, description, etc) and a build
│ │ // script referencing shared gulpfile and config in the parent directory
│ └── ...
└── TSExtension2
└── ...
Our company has multiple ThingWorx instances and different teams working on each one (some instances even have more than 1 team working on them). In this environment, code quality and standards become critical, hence the added complexity. I don't know if there's any roadmap for continuing to operationalizing this build toolchain, but I'd be willing to contribute if there's interest.
Are you looking for a way to use this to include both conventional extension packages and multiple ts built entity packages? If so, let's do a different issue to track this.
These 3 points should be fixed by the latest commits.
This repo contains some random files and copy-pasted info that should probably be changed:
.DS_Store
(macos cache file) in folder and subfoldersmetadata.xml
contains copy-pasted info from other project (MonacoEditorTWX)thingworxUser
thingworxPassword
thingworxServer
andthingworxAppKey
should probably not be commited and could be put in a separateenv.json
file otherwise everyone can see it.I've made the changes on my branch but I'm unable to push these changes to github right now due to my corporate proxy (code exfiltration is blocked).