Skip to content

Commit

Permalink
fix: correct app shell paths (#883)
Browse files Browse the repository at this point in the history
* fix: correct app-shell paths

* docs: match init options with command help output

* fix: yarn lock again 🤦‍♂️
  • Loading branch information
KaiVandivier authored Oct 10, 2024
1 parent cd61ea9 commit a1af71c
Show file tree
Hide file tree
Showing 3 changed files with 588 additions and 788 deletions.
23 changes: 10 additions & 13 deletions cli/src/lib/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = (cwd = process.cwd(), { typeScript } = {}) => {
const paths = {
initAppModuleCss: path.join(
__dirname,
`../../config/templates/common/App.module.css`
'../../config/templates/common/App.module.css'
),
initAppTestJsx: path.join(
__dirname,
Expand All @@ -47,21 +47,21 @@ module.exports = (cwd = process.cwd(), { typeScript } = {}) => {
),
initPackageJson: path.join(
__dirname,
`../../config/templates/common/package.json`
'../../config/templates/common/package.json'
),
initReadme: path.join(
__dirname,
`../../config/templates/common/README.md`
'../../config/templates/common/README.md'
),

initTSConfig: path.join(
__dirname,
`../../config/templates/init-typescript/tsconfig.json`
'../../config/templates/init-typescript/tsconfig.json'
),

initEslint: path.join(
__dirname,
`../../config/templates/init-typescript/eslint.config.js`
'../../config/templates/init-typescript/eslint.config.js'
),
initGlobalDeclaration: path.join(
__dirname,
Expand All @@ -81,15 +81,15 @@ module.exports = (cwd = process.cwd(), { typeScript } = {}) => {
jestConfigDefaults: path.join(__dirname, '../../config/jest.config.js'), // TODO: probably need a different jest.config for TS

shellSource,
shellSourceEntrypoint: path.join(shellSource, `src/App.jsx`), // TODO: double check the effect of having TS in shell folder
shellSourceEntrypoint: path.join(shellSource, 'src/App.jsx'), // TODO: double check the effect of having TS in shell folder
shellSourcePublic: path.join(shellSource, 'public'),

// destination paths where we copy files to
base,
package: path.join(base, './package.json'),
yarnLock: findYarnLock(base, rootDirectory),
dotenv: path.join(base, './.env'),
config: path.join(base, `./d2.config.js`), // TODO: double check this works
config: path.join(base, './d2.config.js'), // TODO: double check this works
readme: path.join(base, './README.md'),
src: path.join(base, './src'),
public: path.join(base, './public'),
Expand All @@ -103,19 +103,16 @@ module.exports = (cwd = process.cwd(), { typeScript } = {}) => {
appOutputFilename: 'App.jsx',
shell: path.join(base, './.d2/shell'),
shellSrc: path.join(base, './.d2/shell/src'),
shellAppEntrypoint: path.join(base, `./.d2/shell/src/App.jsx`),
shellAppEntrypoint: path.join(base, './.d2/shell/src/App.jsx'),
shellAppDirname,
shellApp: path.join(base, `./.d2/shell/${shellAppDirname}`),
shellIndexHtml: path.join(base, './.d2/shell/index.html'),
shellPluginHtml: path.join(base, './.d2/shell/plugin.html'),
shellPluginBundleEntrypoint: path.join(
base,
`./.d2/shell/src/plugin.index.${extension}x`
),
shellPluginEntrypoint: path.join(
base,
`./.d2/shell/src/Plugin.${extension}x`
'./.d2/shell/src/plugin.index.jsx'
),
shellPluginEntrypoint: path.join(base, './.d2/shell/src/Plugin.jsx'),
// TODO: look at what to do with service-worker files whether to move to TS or not
shellSrcServiceWorker: path.join(
base,
Expand Down
10 changes: 6 additions & 4 deletions docs/scripts/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ Global Options:
--config Path to JSON config file

Options:
--cwd working directory to use (defaults to cwd)
--force Overwrite existing files and configurations[boolean] [default: false]
--lib Create a library [boolean] [default: false]
--typescript || --ts create a TypeScript project
--cwd working directory to use (defaults to cwd)
--force Overwrite existing files and configurations
[boolean] [default: false]
--lib Create a library [boolean] [default: false]
--typeScript, --typescript, --ts Use TypeScript template
[boolean] [default: false]
```
Loading

0 comments on commit a1af71c

Please sign in to comment.