-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LightningCAD Generator #118
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we'll want to keep in mind is that this repo is public at the moment, whereas LightningCAD is private. We'll want to be mindful of how much L.CAD-specific code ends up in this repo.
@@ -0,0 +1,123 @@ | |||
export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to just use the ESLint config provided by the generic (non-L.CAD) generator. There might be changes from projects that could be good to bring in to our base config.
say 'Adding jasmine' | ||
run "yarn add --dev jasmine@^5.1.0" | ||
|
||
run 'npm pkg set scripts.test_shared="NODE_ENV=test NODE_PATH="./node_modules:./app/javascript:$NODE_PATH" jasmine --config=jasmine.json"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think NODE_PATH works with ESM, but we can add a custom import hook to replicate the behavior.
say 'Updating esbuild loader in the config' | ||
|
||
insert_into_file 'webpack.config.js', " include: /app\\/javascript|@rolemodel\\/lightning-cad/,\n", before: " loader: 'esbuild-loader'," | ||
gsub_file 'webpack.config.js', 'es2021', 'esnext' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't want to change the output target.
def update_esbuild_loader | ||
say 'Updating esbuild loader in the config' | ||
|
||
insert_into_file 'webpack.config.js', " include: /app\\/javascript|@rolemodel\\/lightning-cad/,\n", before: " loader: 'esbuild-loader'," |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed, since the base config doesn't seem to exclude node_modules from being processed with esbuild-loader.
a32aac9
to
62a7dd6
Compare
a3e66e0
to
1900cf7
Compare
Why?
The former system for spinning up a L.CAD app doesn't work in the slightest and was not worth repairing. This pulls some pieces from that but is implemented on
rolemodel_rails
What Changed
What the generator adds
.npmrc
.eslintrc.js
javascript/config/initializers/smartJSON.js
javascript/components/LocalIconFactory.jsx
javascript/components/MaterialIcon.jsx
controllers/editor_controller.rb
views/editor/editor.html.slim
javascript/components/App.jsx
jasmine.json
spec/javascript/shared/TestSetup.js
spec/javascript/shared/testSpec.js
Later
This doesn't fully support the setup for persisted project setup which is most of the use case we need to setup. This only replaces the old generators that don't work. After we have the replacement we can look at some of those other bells and whistles.