Skip to content
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

feat: init create-webpack-app package [1] #4214

Draft
wants to merge 73 commits into
base: master
Choose a base branch
from

Conversation

snitin315
Copy link
Member

What kind of change does this PR introduce?

Did you add tests for your changes?

If relevant, did you update the documentation?

Summary

Does this PR introduce a breaking change?

Other information

maverox added 30 commits May 13, 2024 22:29
- init create-webpack-app package
- installed deps
 - plop
 - minimist
added template files which containe handlebar templates and other common
files
init .tsconfig
change the internal structure of template files
add build script
add watch script
type: module is set in package.json
add ejs for rendering logic using ejs templates in future
for compatibility with plopfile, as it throws error if it's a commonjs
file
- change templates to ejs templates
- implement ejs rendering logic in plopfile.ts
- remove helper function
- remove unnecessary comment
- better input validation
- remove entrypoint prompt
- fix path issues
- add both index.js and index.ts
- fix bud in package.json template file
- fix the url
- bumped the required node from 14 -> 18
- removed empty peerDeps and peerMetaDeps fields
- fix cli entry point typo
- installs all the packages from deps array to the project directory
- single prompt to ask whether to skip
- if yes then returns default answers object
- if no then returns the interactive prompts interface
created commander cli
implement init command with
-s -f flags to
skip and -f to override
earlier testing util spawn function was throwing error because of this.
- remove projectName and the cumbersome projectPath/projectName
resolution
- adjust tests accordingly
- change template/**/package.json.tpl accordingly
- update readme accordingly
- change dependencies for each prompt according to init command
reference
- change default for --force flag to appropriate values in index.ts as
well as plopfile.ts
- change conditional file generation for javascript langType
…/test-utils.js

- earlier this file was an exact copy with a line changed
- now it imports all the utility function and only extends run**()
functions with path value pointing to create-webpack-cli
- change snapshots according to new dependencies and defaults
- change the import in create-webpack-app.test.js
@snitin315 snitin315 changed the title feat: init create-webpack-package feat: init create-webpack-app package Jul 10, 2024
@snitin315 snitin315 changed the title feat: init create-webpack-app package feat: init create-webpack-app package [1] Aug 21, 2024
maverox and others added 13 commits August 25, 2024 08:48
- remove prompt for router and add it as default
- set CSS only as default option instead of none for cssType
- fix routes and create new components
- add new styles and only have global styles
- add navBar as part of layout with buttons to traverse those routes
- add router as default and remove the prompt for routing
- set the cssType to CSS only instead of none
- make store as default
- add new components to match the react like look and feel
- add navbar to traverse those routes
- change id of main div from #app to #root to resolve style conflicts
…move redundant tests

- remove tests for vue and react for router and store/state since both
of these are being checked in default tests
- update snapshots
* refactor: modularize generators and actions

- break plopfile generator and action logic in generators and actions
- loading them asynchronously
- modularity reduces redundancy and increases scalability

* fix: remove false count line for bulk file creation

* chore: install inquirer

* feat: add react generator logic

* docs: update Readme of templates as well as package

* feat: add --template flag and reengineer conditional generator on given template

- change defaultValues and generator function to be based on --template
flag
- add fallback prompt when template is invalid or unsupported

* test: add test cases for --template flag and react generator

* feat: change action file creation logger to show relative path instead of just file name

* refactor: change default generator to a simpler and scalable logic

- change default to resemble the design pattern of react generator
- simple conditional flow for file creation and manipulation

* perf: use newer @inquirer/prompts instead of inquirer

- unpacked size decreased from ~60kb to 19kb

* feat: add emoji support to console logs

- for better ux added emojis according to type of log

* refactor: move default.ts, and react.ts in init directory

- introduce a directory structure of commandName/[template1, template2]
- move default and react template generators in init/*
- avoid namespace issues and cleaner structure

* feat: add loader generator, default-template

* feat: add plugin generator, default-template

* refactor: resolve namespace issues for init command, its default values and generator imports

* feat: add loader and plugin command and generators in cli

* refactor: move test for init command and rename suite

* feat: make test.utils to be configurable by introducing a factory function

- the factory function returns a variant of utils configured with the
path passed as argument

* test: add loader and plugin test suites

* fix: fixes the case of failure on single dependency

* refactor: remove obsolete comments

* refactor: change default values to reduce redundancy

* feat: add vue template generator logic

* feat: add template files for vue template

* feat: add vue template flag command in cli

* test: add test cases for vue template generation

* chore: add vuex to cspell word array

* fix: missing workboxWebpackPlugin dependency logic

* feat: add pnpm as package manager in default, react generator

* feat: replace vuex with pinia for state management

- change all instance of vuex usage with pinia

* chore: remove @vue/eslint-config-typescript

- It was causing unusually long installation time using npm
- Initial setup doesn't need this

* feat: add rawExpression helper in vue generator

- this is to escape the {{syntax}} of hbs which was a cause of conflict

* feat: use composition api, and implement basic project structure

* chore: remove cspell ignore directives and include "plopfile" in dictionary

* feat: add svelte generator

* feat: add svelte to cli frontend

* feat: add svelte template files

* test: add test cases for svelte generator in init suite

* fix: fix webpack.config.js.tpl of vue, svelte, react templates

* feat: add router and state support to react generator

* feat: add template files to react generator improved ver

- add router template files
- add components
- add states in those components
- enhance tsconfig

* feat: add router and state default answer to cli front end

* test: add test cases for router and improve tests

* Update packages/create-webpack-app/src/generators/init/svelte.ts

* feat: change default of svelte store to true

* refactor: rename dependencies array to devDependencies

* refactor: rename dependencies array to devDependencies

* fix: import as type error in store/index.ts in svelte template files

- importing Writable as type resolves this error

* feat: remove useSvelteStore prompt choice and set it included as default

* refactor: rename dependencies array to devDependencies

* refactor: lowercase all "Webpack" word instance

* feat: add new fileAction based on ejs templates

- add ejs support and remove hbs conflict
- add fileCollision Logic in same
  - add abort prompt
  - add overwrite and overwrite all
  - add diff view in vs code
  - conditional rendering based on file type (bin or text)
- Uses the same Config Object as plop libraries add function

* feat: use new FileAction in all generators

* feat: modify onSuccessHook and returned string to be more descriptive and configurable

- change the string format to be "type:path"
  - type: [create, overwrite, skip, identical]
  - path: path/to/file
- change the onSuccessHook to display appropriate information based on
type

* revert: remove hbs helper and its instances

- reverts commit: #16de424e

* refactor: remove indirect imports from "types.ts" and import from library

- remove indirect imports
- use unused types

* Revert "Merge branch 'gsoc/create-webpack-app-package' into feat/file-generation-and-collision-handler"

This reverts commit d64a678, reversing
changes made to 367ec7a.
Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI needs to pass before we can review this properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

5 participants