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

fix: correct app shell paths #883

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading