Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
284 commits
Select commit Hold shift + click to select a range
2dabca5
update test project fixture
Tobbe Jul 13, 2025
ed87de0
Run vitest
Tobbe Jul 13, 2025
88a3b65
vitest app root config
Tobbe Jul 14, 2025
1e55968
fix(api): Fix SupportedVerifierTypes import
Tobbe Jul 14, 2025
90a4764
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 14, 2025
14ce45b
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 14, 2025
a0297e4
fix(api): Fix webhook exports
Tobbe Jul 14, 2025
e345021
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 14, 2025
eb5f462
vitest api config
Tobbe Jul 14, 2025
dc6be5c
update create-cedar-app templates and tests
Tobbe Jul 14, 2025
50af3ff
update test project fixture
Tobbe Jul 14, 2025
c8588ea
feat(cli): Tailwind and PostCSS .cjs
Tobbe Jul 14, 2025
e42252c
templates: set "type": "module" by default
Tobbe Jul 14, 2025
704e8c6
.js imports for dbAuth setup
Tobbe Jul 14, 2025
7bd71df
service template: .js extension in relative import
Tobbe Jul 14, 2025
c45a4ba
vitest.setup.ts
Tobbe Jul 14, 2025
bd5981e
hacky @cedarjs/auth resolve alias
Tobbe Jul 15, 2025
e64f3d9
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 18, 2025
58f0803
fix create-cedar-app test
Tobbe Jul 18, 2025
3d80f10
fix test.test.js and update snapshots
Tobbe Jul 18, 2025
9b48e56
fix tailwind test
Tobbe Jul 18, 2025
8142432
testing plugins etc
Tobbe Jul 19, 2025
cb3076d
fix building
Tobbe Jul 19, 2025
6a0b7ea
Skip building cjs types for now
Tobbe Jul 19, 2025
eabf42d
esm/cjs comment
Tobbe Jul 19, 2025
f070c49
improve regex
Tobbe Jul 19, 2025
cfb4c04
include cjs config files in eslint config
Tobbe Jul 19, 2025
bcdde70
update test project fixture
Tobbe Jul 19, 2025
69347af
vite-plugin-creaet-auth-import-transform: simplify regex
Tobbe Jul 19, 2025
0c4d042
anchor regex
Tobbe Jul 19, 2025
c9c6edb
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 19, 2025
4d67b35
Remove check for jest config
Tobbe Jul 19, 2025
882667e
fix(routes): Don't import Routes from sub-folders
Tobbe Jul 19, 2025
cad471b
improve testing
Tobbe Jul 19, 2025
4bf055f
fix test test
Tobbe Jul 19, 2025
aac576e
fix project config test
Tobbe Jul 19, 2025
1903101
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 19, 2025
b9074a1
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 21, 2025
8a79568
match vitest watch behavior with jest
Tobbe Jul 21, 2025
adff625
vitest: Fix running all sides by default
Tobbe Jul 21, 2025
4c466db
Remove unused vitest-config.ts file
Tobbe Jul 21, 2025
2559bf4
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 21, 2025
2e54046
yarn dedupe
Tobbe Jul 21, 2025
9d0bed2
Update service template to include extension in imports
Tobbe Jul 22, 2025
cb65692
only run vitest for changed files by default
Tobbe Jul 22, 2025
677e912
More work to support using vitest in Cedar apps
Tobbe Jul 22, 2025
a4027fa
make it build
Tobbe Jul 22, 2025
4550f57
fix eslint version mismatch
Tobbe Jul 22, 2025
e01e1c1
rename autoImportsPlugin
Tobbe Jul 22, 2025
80d34e7
fix vitest version mismatch by using peerdep
Tobbe Jul 22, 2025
7670079
vitest config plugin
Tobbe Jul 22, 2025
0db29ed
move globalSetup into custom vitest env
Tobbe Jul 22, 2025
7c5fe15
merge fw vitest setup files with user's
Tobbe Jul 22, 2025
691f3f9
sync vitest-api.setup.ts with project
Tobbe Jul 22, 2025
ee3163f
updated vitest config
Tobbe Jul 22, 2025
33967ad
use mergeConfig() for vitest api side config
Tobbe Jul 23, 2025
d01477a
remove commendted code
Tobbe Jul 23, 2025
5abf8fc
.js import and source format
Tobbe Jul 23, 2025
80dcbc6
Let vitest handle merging
Tobbe Jul 23, 2025
100ba35
vitest preset
Tobbe Jul 23, 2025
4bf5bc5
rename to -preset.ts
Tobbe Jul 23, 2025
5b60988
export vitest preset from /api
Tobbe Jul 23, 2025
cea0cb4
refactor testing module
Tobbe Jul 23, 2025
e8021fd
update templates
Tobbe Jul 23, 2025
bd44a4d
move public vitest preset export to vite package
Tobbe Jul 23, 2025
a712d18
copy envVarDefinitions to testing package to avoid circular deps
Tobbe Jul 23, 2025
f215bda
copy envVarDefinitions to testing package to avoid circular deps
Tobbe Jul 23, 2025
21cb7ce
add todo for env var config
Tobbe Jul 23, 2025
c00c6a3
update test project fixture
Tobbe Jul 23, 2025
a871cb6
fix tests
Tobbe Jul 23, 2025
4250f3b
update fragment test project fixture
Tobbe Jul 23, 2025
85c157d
chore(ci): Remove unneeded awaits in specs
Tobbe Jul 23, 2025
0c75624
debug tests
Tobbe Jul 23, 2025
b2d24fb
fix tests on CI
Tobbe Jul 23, 2025
c1eb936
update test-project templates to use .js on relative imports
Tobbe Jul 23, 2025
a161b54
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 24, 2025
86cac46
fix(prerender): Use built LocationProvider
Tobbe Jul 24, 2025
b020da4
update templates to include vitest as a dev dep
Tobbe Jul 24, 2025
42cf79a
update default vitest config
Tobbe Jul 24, 2025
b95567d
remove debug logs
Tobbe Jul 24, 2025
0593759
chore(prerender): Use readFile instead of require for json file
Tobbe Jul 24, 2025
66f3ed5
chore(cli): Remove unused runScriptFunction() from execBabel
Tobbe Jul 24, 2025
98733d0
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 25, 2025
70cbbf7
wip prerender esm support
Tobbe Jul 25, 2025
24b7efd
skip test
Tobbe Jul 25, 2025
095e939
Main cedar vite plugin: Make options optional
Tobbe Jul 25, 2025
dc08ce0
update fragment fixture
Tobbe Jul 25, 2025
65292ab
trusted documents
Tobbe Jul 25, 2025
dd56ef1
update fragments test project fixture
Tobbe Jul 25, 2025
a91e4c6
add more file extensions to imports
Tobbe Jul 25, 2025
fff1fe2
Update test project fixture
Tobbe Jul 25, 2025
8f1689d
Fix cli-helpers test
Tobbe Jul 25, 2025
8938d46
fix gql import path
Tobbe Jul 25, 2025
e324dab
more file extensions
Tobbe Jul 25, 2025
420a382
Remove unused code
Tobbe Jul 26, 2025
f8c054d
import { gql } from 'graphql-tag'
Tobbe Jul 26, 2025
76adc69
fix tests
Tobbe Jul 26, 2025
9dbf2c5
smoke-tests auth .js imports
Tobbe Jul 26, 2025
cb34f2e
update typegen templates
Tobbe Jul 26, 2025
db4c92e
more template .js ext
Tobbe Jul 26, 2025
02ec72b
types/graphql.js
Tobbe Jul 26, 2025
18abf73
update cli snapshots
Tobbe Jul 26, 2025
e3504f2
fixes while debugging context
Tobbe Jul 26, 2025
bf78f40
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 26, 2025
0b38b0e
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 29, 2025
b2b9aef
api-server: Use ESM bins
Tobbe Jul 29, 2025
a52ab7b
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 29, 2025
2eaa7f8
chore(cli): Refactor dev.test.js – extract common config
Tobbe Jul 30, 2025
18ff587
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 30, 2025
5c6ade7
fix tests
Tobbe Jul 30, 2025
238808f
feat(project-config): Allow for both .js and .mjs dist SSR files
Tobbe Jul 31, 2025
7837cd2
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 31, 2025
3014013
match main
Tobbe Jul 31, 2025
1e601b3
Merge branch 'main' into tobbe-crxa-esm
Tobbe Jul 31, 2025
4d8673a
revert unneeded test project changes
Tobbe Jul 31, 2025
57bbd7c
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
6aa09c3
less code churn compared to main
Tobbe Aug 1, 2025
2e9da8d
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
6c7287f
limit code churn compared to main
Tobbe Aug 1, 2025
7645a1e
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
664ae54
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
cda0931
limit code churn compared to main
Tobbe Aug 1, 2025
9e7cabf
fragment test project: scaffold.css
Tobbe Aug 1, 2025
16acb61
test project: scaffold.css
Tobbe Aug 1, 2025
a979a73
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
e389147
Address Greptile comments
Tobbe Aug 1, 2025
9805950
cjs syntax in tw config
Tobbe Aug 1, 2025
bc27871
addressing greptile regex and eq comments
Tobbe Aug 1, 2025
0b6700a
fixing one more greptile comment
Tobbe Aug 1, 2025
5744b95
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
2b91bfd
reduce code churn
Tobbe Aug 1, 2025
68120df
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
059ac21
Remove commented out code
Tobbe Aug 1, 2025
a862c81
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
eb154e7
fix(codemods): Link to git tag on GitHub for graphql config download
Tobbe Aug 1, 2025
81798cb
update tempate test
Tobbe Aug 1, 2025
8cded72
updated vitest project config in templates and test projects
Tobbe Aug 1, 2025
38b49b3
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
6ddea2b
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 1, 2025
4c30607
Fix a couple more greptile comments
Tobbe Aug 2, 2025
e623cc8
tutorial e2e: .js imports
Tobbe Aug 2, 2025
419792c
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 2, 2025
0894d19
more descriptive comment
Tobbe Aug 2, 2025
66e0ae1
prerender: Add back .js to generated imports
Tobbe Aug 2, 2025
2039a42
node-runner.test.ts
Tobbe Aug 2, 2025
1348b4d
node-runner.test.ts with fixtures dir
Tobbe Aug 2, 2025
562e0c3
Use it() instead of test()
Tobbe Aug 2, 2025
39cfc2a
remove excessive tests
Tobbe Aug 3, 2025
8653508
Allow passing custom config to NodeRunner
Tobbe Aug 3, 2025
7906904
Mock `@cedarjs/context` using vite alias
Tobbe Aug 3, 2025
aa752e0
Also mock `graphql-tag`
Tobbe Aug 3, 2025
e0bfefe
mock graphql-tag
Tobbe Aug 3, 2025
81263f8
cell transform verification wip
Tobbe Aug 3, 2025
22efd01
test cell transform
Tobbe Aug 3, 2025
8451d38
ESM vs CJS test
Tobbe Aug 3, 2025
0268927
Explain why we do the special babel modules import
Tobbe Aug 4, 2025
77c03ae
Simplify import-dir plugin and explain why we're using extensionless …
Tobbe Aug 4, 2025
4080920
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 5, 2025
5672f3e
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 6, 2025
ab52871
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 8, 2025
5fbde2f
add missing dep, improve TD tests
Tobbe Aug 8, 2025
ab648ab
rename node-runner plugin
Tobbe Aug 8, 2025
663240d
Remove files deleted upstream
Tobbe Aug 8, 2025
413715d
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 8, 2025
866bd7b
align with main
Tobbe Aug 8, 2025
bc897c7
align with main more
Tobbe Aug 8, 2025
146f14b
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 8, 2025
5bf37d7
add some spacing around comment
Tobbe Aug 8, 2025
6746bcd
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 8, 2025
694c3c3
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 8, 2025
eaa5a92
revert changes to global.d.ts
Tobbe Aug 8, 2025
1224189
Better types
Tobbe Aug 8, 2025
b5a496d
simplify build files
Tobbe Aug 8, 2025
afec5ad
try fixing TS issues when building
Tobbe Aug 8, 2025
4e7dd0e
remove unused file
Tobbe Aug 8, 2025
0126bab
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 8, 2025
b8d6be5
add back comment from main
Tobbe Aug 8, 2025
e90dc3f
Remove commented code from vite getMergedConfig
Tobbe Aug 8, 2025
433e6b1
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 8, 2025
4d07464
chore(project-config): getEnvVarDefinitions
Tobbe Aug 8, 2025
3ad20a7
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 8, 2025
d296427
Fix bad merge
Tobbe Aug 9, 2025
4c9f9ae
fix db import tracking
Tobbe Aug 9, 2025
b2ae7bc
test db import tracking
Tobbe Aug 9, 2025
0d3573f
fix global type and update test project
Tobbe Aug 9, 2025
dfa1501
fix test to be async
Tobbe Aug 9, 2025
72b038b
put vitest config in the correct location
Tobbe Aug 9, 2025
0d8e0fd
Don't fail CI if config file doesn't exist
Tobbe Aug 9, 2025
2fcb3e7
Better comments around db import tracking tests
Tobbe Aug 9, 2025
b0ff6b5
Force bash in CI for if support
Tobbe Aug 9, 2025
1d2d76c
esm test project fixtures
Tobbe Aug 9, 2025
e26ba65
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 9, 2025
dc64dff
Restore create-cedar-app templates
Tobbe Aug 9, 2025
679515a
remove ignored files
Tobbe Aug 9, 2025
2200c3a
Restore test fixtures
Tobbe Aug 9, 2025
b22be8d
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 9, 2025
0cdea5b
Restore create-cedar-app templates part II
Tobbe Aug 9, 2025
fb5905c
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 9, 2025
e88fa8c
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 9, 2025
4e686a5
chore(create-cedar-app): Test esm template dirs
Tobbe Aug 9, 2025
77481ee
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 9, 2025
7b11576
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 9, 2025
a79e87e
Add back removed function
Tobbe Aug 9, 2025
06ff717
Fix imports
Tobbe Aug 9, 2025
c843e22
revert changes to eslint-config that are no longer needed
Tobbe Aug 9, 2025
b938763
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 9, 2025
24f3157
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 10, 2025
409e9a3
rebuild test project
Tobbe Aug 10, 2025
4836da3
Create ESM project
Tobbe Aug 10, 2025
f680356
ESM test command
Tobbe Aug 10, 2025
e3ea289
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 10, 2025
dedce67
use test test from main
Tobbe Aug 10, 2025
76726e7
remove debug logs
Tobbe Aug 10, 2025
9869707
remove handled TODO
Tobbe Aug 10, 2025
a85b88b
gql import for prerender
Tobbe Aug 10, 2025
03eb428
ccdra Hidden esm flag
Tobbe Aug 10, 2025
1b113cb
Don't create esm apps when you pass --yes
Tobbe Aug 10, 2025
da46786
Add note on how to run create-cedar-app e2e tests locally
Tobbe Aug 10, 2025
0d1bd40
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 10, 2025
fa53f6e
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 10, 2025
93b0e6e
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 10, 2025
2bfdbbb
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 10, 2025
f11b5b0
Add CI job for ESM test project
Tobbe Aug 10, 2025
ff3748d
Fix formatting in esm project action
Tobbe Aug 10, 2025
2e0e975
Revert gql changes in babel-config package
Tobbe Aug 10, 2025
19107a5
chore(ci): Update CI workflow naming
Tobbe Aug 10, 2025
d6821ff
revert more changes to packages/babel-config
Tobbe Aug 10, 2025
f8259ee
revert more changes to packages/babel-config
Tobbe Aug 10, 2025
88e34c3
revert babel related comment in dataMigrate upHandler
Tobbe Aug 10, 2025
30357f8
Remove mockContext export from testing/package.json
Tobbe Aug 10, 2025
925c486
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 10, 2025
a1fe802
Try simplifying helmet import
Tobbe Aug 10, 2025
4a5df75
Try simplifying helmet import in more places
Tobbe Aug 10, 2025
6f2ec87
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 11, 2025
68abbe1
feat(docs): Add note about gql import in ESM apps
Tobbe Aug 11, 2025
046f79d
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 11, 2025
a8ea439
feat(esm): Support ESM in GQL Realtime setup and generation
Tobbe Aug 11, 2025
eef5963
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 11, 2025
6f9a8d6
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 11, 2025
2d78229
Remove unsued templates
Tobbe Aug 11, 2025
3c5a79f
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 11, 2025
0cdd981
Merge branch 'main' into tobbe-crxa-esm
Tobbe Aug 11, 2025
9fa3606
Make ESM apps the default
Tobbe Aug 11, 2025
c51e03f
yarn.lock
Tobbe Aug 11, 2025
7705798
fix bad merge
Tobbe Aug 11, 2025
766753c
ccdra: make esm the default also in prompt
Tobbe Aug 11, 2025
6c64216
Update ccdra e2e tests
Tobbe Aug 11, 2025
bee213b
Handle --esm in more tests
Tobbe Aug 11, 2025
436bb42
Update prompt tests
Tobbe Aug 12, 2025
53be851
--esm support for telemetry ci check
Tobbe Aug 12, 2025
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
4 changes: 2 additions & 2 deletions .github/actions/telemetry_check/check.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ try {
const mode = process.argv[process.argv.indexOf('--mode') + 1]
let exitCode = 0
switch (mode) {
case 'crwa':
case 'ccdra':
exitCode = await exec(
`yarn node ./packages/create-cedar-app/dist/create-cedar-app.js ../project-for-telemetry --typescript true --git false --no-yarn-install`,
`yarn node ./packages/create-cedar-app/dist/create-cedar-app.js ../project-for-telemetry --esm true --typescript true --git false --no-yarn-install`,
)
if (exitCode) {
process.exit(1)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/create-cedar-app-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
- name: Prompt tests
run: |
./tests/e2e_prompts.sh
./tests/e2e_prompts_esm.sh
./tests/e2e_prompts_git.sh
./tests/e2e_prompts_m.sh
./tests/e2e_prompts_ts.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/telemetry-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
- name: Set up job
uses: ./.github/actions/set-up-job

- name: 📢 Listen for telemetry (CRWA)
run: node ./.github/actions/telemetry_check/check.mjs --mode crwa
- name: 📢 Listen for telemetry (CCDRA)
run: node ./.github/actions/telemetry_check/check.mjs --mode ccdra

- name: 📢 Listen for telemetry (CLI)
run: node ./.github/actions/telemetry_check/check.mjs --mode cli
Expand Down
33 changes: 15 additions & 18 deletions packages/create-cedar-app/src/create-cedar-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,23 +445,21 @@ async function handleEsmPreference(esmFlag) {
return esmFlag
}

return false
// Disable this for now, while the ESM flag is hidden
// Prompt user for preference
// try {
// const response = await tui.prompt({
// type: 'Select',
// name: 'esm',
// choices: ['CJS', 'ESM'],
// message: 'Select your preferred project type',
// initial: 'CJS',
// })
// return response.esm === 'ESM'
// } catch (_error) {
// recordErrorViaTelemetry('User cancelled install at esm prompt')
// await shutdownTelemetry()
// process.exit(1)
// }
try {
const response = await tui.prompt({
type: 'Select',
name: 'esm',
choices: ['CJS', 'ESM'],
message: 'Select your preferred project type',
initial: 'ESM',
})
return response.esm === 'ESM'
} catch (_error) {
recordErrorViaTelemetry('User cancelled install at esm prompt')
await shutdownTelemetry()
process.exit(1)
}
}

async function handleGitPreference(gitInitFlag) {
Expand Down Expand Up @@ -688,7 +686,6 @@ async function createRedwoodApp() {
describe: 'Generate a TypeScript project',
})
.option('esm', {
hidden: true,
default: null,
type: 'boolean',
describe: 'Generate an ESM project',
Expand Down Expand Up @@ -744,7 +741,7 @@ async function createRedwoodApp() {
parsedFlags['yarn-install'] ??
(_isYarnBerryOrNewer ? parsedFlags.yes : null)
const typescriptFlag = parsedFlags.typescript ?? parsedFlags.yes
const esmFlag = parsedFlags.esm // TODO: ?? parsedFlags.yes
const esmFlag = parsedFlags.esm ?? parsedFlags.yes
const overwrite = parsedFlags.overwrite
const gitInitFlag = parsedFlags['git-init'] ?? parsedFlags.yes
const commitMessageFlag =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[?25h[?25l✔ Compatibility checks passed
[?25h✔ Creating your CedarJS app in ./cedar-app based on command line argument
✔ Using TypeScript based on command line flag
✔ Setting up an ESM project based on command line flag
✔ Will initialize a git repo based on command line flag
✔ Will not run yarn install based on command line flag
[?25l⠋ Creating project files
Expand Down
3 changes: 3 additions & 0 deletions packages/create-cedar-app/tests/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* eslint-env node */

// To run these tests locally, go to ~/cedarjs-fw/packages/create-cedar-app
// (the parent directory of this file)
// Then run `PROJECT_PATH=./ yarn test:e2e`
// Don't forget to build first, as this test uses built files for testing

import path from 'node:path'
import { fileURLToPath } from 'node:url'
Expand Down Expand Up @@ -33,6 +35,7 @@ describe('create-cedar-app', () => {
--overwrite Create even if target directory isn't empty
[boolean] [default: false]
--typescript, --ts Generate a TypeScript project[boolean] [default: null]
--esm Generate an ESM project [boolean] [default: null]
--git-init, --git Initialize a git repository [boolean] [default: null]
-m, --commit-message Commit message for the initial commit
[string] [default: null]
Expand Down
4 changes: 4 additions & 0 deletions packages/create-cedar-app/tests/e2e_prompts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ expect "Select your preferred language"
# ❯ TypeScript
send "\n"

expect "Select your preferred project type"
# ❯ ESM
send "\n"

expect "Do you want to initialize a git repo?"
# ❯ Yes
send "\n"
Expand Down
42 changes: 42 additions & 0 deletions packages/create-cedar-app/tests/e2e_prompts_esm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/expect

set projectPath $env(PROJECT_PATH)

if {$projectPath eq ""} {
puts "PROJECT_PATH is not set"
exit
}

cd $projectPath

set projectDirectory "redwood-app-prompt-esm-test"

spawn yarn create-cedar-app --no-yarn-install --esm

expect "Where would you like to create your CedarJS app?"
send "$projectDirectory\n"

expect "Select your preferred language"
# ❯ TypeScript
send "\n"

expect "Do you want to initialize a git repo?"
# ❯ Yes
send "\n"

expect "Enter a commit message"
send "first\n"

expect eof
catch wait result
set exitStatus [lindex $result 3]

if {$exitStatus == 0} {
puts "Success"
exec rm -rf $projectDirectory
exit 0
} else {
puts "Error: The process failed with exit status $exitStatus"
exec rm -rf $projectDirectory
exit 1
}
4 changes: 4 additions & 0 deletions packages/create-cedar-app/tests/e2e_prompts_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ expect "Select your preferred language"
# ❯ TypeScript
send "\n"

expect "Select your preferred project type"
# ❯ ESM
send "\n"

expect "Enter a commit message"
send "first\n"

Expand Down
4 changes: 4 additions & 0 deletions packages/create-cedar-app/tests/e2e_prompts_m.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ expect "Select your preferred language"
# ❯ TypeScript
send "\n"

expect "Select your preferred project type"
# ❯ ESM
send "\n"

expect "Do you want to initialize a git repo?"
# ❯ Yes
send "\n"
Expand Down
4 changes: 4 additions & 0 deletions packages/create-cedar-app/tests/e2e_prompts_node_greater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ expect "Select your preferred language"
# ❯ TypeScript
send "\n"

expect "Select your preferred project type"
# ❯ ESM
send "\n"

expect "Do you want to initialize a git repo?"
# ❯ Yes
send "\n"
Expand Down
4 changes: 4 additions & 0 deletions packages/create-cedar-app/tests/e2e_prompts_overwrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ expect "Select your preferred language"
# ❯ TypeScript
send "\n"

expect "Select your preferred project type"
# ❯ ESM
send "\n"

expect "Do you want to initialize a git repo?"
# ❯ Yes
send "\n"
Expand Down
4 changes: 4 additions & 0 deletions packages/create-cedar-app/tests/e2e_prompts_ts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ spawn yarn create-cedar-app --no-yarn-install --ts
expect "Where would you like to create your CedarJS app?"
send "$projectDirectory\n"

expect "Select your preferred project type"
# ❯ ESM
send "\n"

expect "Do you want to initialize a git repo?"
# ❯ Yes
send "\n"
Expand Down
1 change: 1 addition & 0 deletions tasks/run-e2e.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function createCedarJsApp({ typescript }) {
CEDARJS_PROJECT_DIRECTORY,
'--no-yarn-install',
`--typescript ${typescript}`,
`--esm`,
'--no-telemetry',
'--git',
'-m "first"',
Expand Down
8 changes: 7 additions & 1 deletion tasks/test-project/rebuild-test-project-fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,13 @@ const createProject = () => {
const subprocess = exec(
cmd,
// We create a ts project and convert using ts-to-js at the end if typescript flag is false
['--no-yarn-install', '--typescript', '--overwrite', '--no-git'],
[
'--no-yarn-install',
'--typescript',
'--no-esm',
'--overwrite',
'--no-git',
],
getExecaOptions(RW_FRAMEWORK_PATH),
)

Expand Down
Loading