Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,15 @@ jobs:
yarn rw test api --no-watch
working-directory: ${{ steps.set-up-test-project.outputs.test-project-path }}

- name: Run db import tracking tests
shell: bash
run: |
# Only run this for ESM projects where the vitest config file exists
if test -f ./vitest-sort.config.ts; then
npx vitest --config ./vitest-sort.config.ts run
fi
working-directory: ${{ steps.set-up-test-project.outputs.test-project-path }}/api

- name: 🖥️ Run serve smoke tests
working-directory: tasks/smoke-tests/serve
run: npx playwright test
Expand Down
10 changes: 10 additions & 0 deletions __fixtures__/esm-fragment-test-project/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
19 changes: 19 additions & 0 deletions __fixtures__/esm-fragment-test-project/.env.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# These environment variables will be used by default if you do not create any
# yourself in .env. This file should be safe to check into your version control
# system. Any custom values should go in .env and .env should *not* be checked
# into version control.

# schema.prisma defaults
DATABASE_URL=file:./dev.db

# location of the test database for api service scenarios (defaults to ./.redwood/test.db if not set)
# TEST_DATABASE_URL=file:./.redwood/test.db

# disables Prisma CLI update notifier
PRISMA_HIDE_UPDATE_MESSAGE=true

# Option to override the current environment's default api-side log level
# See: https://redwoodjs.com/docs/logger for level options, defaults to "trace" otherwise.
# Most applications want "debug" or "info" during dev, "trace" when you have issues and "warn" in production.
# Ordered by how verbose they are: trace | debug | info | warn | error | silent
# LOG_LEVEL=debug
4 changes: 4 additions & 0 deletions __fixtures__/esm-fragment-test-project/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# DATABASE_URL=file:./dev.db
# TEST_DATABASE_URL=file:./.redwood/test.db
# PRISMA_HIDE_UPDATE_MESSAGE=true
# LOG_LEVEL=trace
24 changes: 24 additions & 0 deletions __fixtures__/esm-fragment-test-project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.idea
.DS_Store
.env*
!.env.example
!.env.defaults
.netlify
.redwood/*
!.redwood/README.md
dev.db*
dist
dist-babel
node_modules
yarn-error.log
web/public/mockServiceWorker.js
web/types/graphql.d.ts
api/types/graphql.d.ts
api/src/lib/generateGraphiQLHeader.*
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
44 changes: 44 additions & 0 deletions __fixtures__/esm-fragment-test-project/.redwood/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# .redwood

## What is this directory?

Redwood uses this `.redwood` directory to store transitory data that aids in the smooth and convenient operation of your Redwood project.

## Do I need to do anything with this directory?

No. You shouldn't have to create, edit or delete anything in this directory in your day-to-day work with Redwood.

You don't need to commit any other contents of this directory to your version control system. It's ignored by default.

## What's in this directory?

### Files

| Name | Description |
| :---------------- | :----------------------------------------------------------------------------------------------------------------- |
| commandCache.json | This file contains mappings to assist the Redwood CLI in efficiently executing commands. |
| schema.graphql | This is the GraphQL schema which has been automatically generated from your Redwood project. |
| telemetry.txt | Contains a unique ID used for telemetry. This value is rotated every 24 hours to protect your project's anonymity. |
| test.db | The sqlite database used when running tests. |

### Directories

| Name | Description |
| :---------- | :----------------------------------------------------------------------------------------------------------------------------------------------- |
| locks | Stores temporary files that Redwood uses to keep track of the execution of async/background tasks between processes. |
| logs | Stores log files for background tasks such as update checking. |
| prebuild | Stores transpiled JavaScript that is generated as part of Redwood's build process. |
| telemetry | Stores the recent telemetry that the Redwood CLI has generated. You may inspect these files to see everything Redwood is anonymously collecting. |
| types | Stores the results of type generation. |
| updateCheck | Stores a file which contains the results of checking for Redwood updates. |
| studio | Used to store data for `rw studio` |

We try to keep this README up to date but you may, from time to time, find other files or directories in this `.redwood` directory that have not yet been documented here. This is likely nothing to worry about but feel free to let us know and we'll update this list.

### Telemetry

RedwoodJS collects completely anonymous telemetry data about general usage. For transparency, that data is viewable in the respective directories and files. To learn more and manage your project's settings, visit [telemetry.redwoodjs.com](https://telemetry.redwoodjs.com).

### Have any questions?

Feel free to reach out to us in the [RedwoodJS Community](https://community.redwoodjs.com/) forum if you have any questions.
16 changes: 16 additions & 0 deletions __fixtures__/esm-fragment-test-project/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"ofhumanbondage.react-proptypes-intellisense",
"mgmcdermott.vscode-language-babel",
"wix.vscode-import-cost",
"pflannery.vscode-versionlens",
"editorconfig.editorconfig",
"prisma.prisma",
"graphql.vscode-graphql",
"csstools.postcss",
"bradlc.vscode-tailwindcss"
],
"unwantedRecommendations": []
}
56 changes: 56 additions & 0 deletions __fixtures__/esm-fragment-test-project/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": "0.3.0",
"configurations": [
{
"command": "yarn redwood dev --apiDebugPort 18911", // you can add --fwd='--open=false' to prevent the browser from opening
"name": "Run Dev Server",
"request": "launch",
"type": "node-terminal"
},
{
"name": "Attach API debugger",
"port": 18911, // you can change this port, see https://redwoodjs.com/docs/project-configuration-dev-test-build#debugger-configuration
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
"localRoot": "${workspaceFolder}/node_modules/@cedarjs/api-server/dist",
"remoteRoot": "${workspaceFolder}/node_modules/@cedarjs/api-server/dist",
"sourceMaps": true,
"restart": true,
"preLaunchTask": "WaitForDevServer",
},
{
"name": "Launch Web debugger",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8910",
"webRoot": "${workspaceRoot}/web/src",
"preLaunchTask": "WaitForDevServer",
},
{
"command": "yarn redwood test api",
"name": "Test api",
"request": "launch",
"type": "node-terminal"
},
{
"command": "yarn redwood test web",
"name": "Test web",
"request": "launch",
"type": "node-terminal"
},
],
"compounds": [
{
"name": "Start Debug",
"configurations": [
"Run Dev Server",
"Attach API debugger",
"Launch Web debugger"
],
"stopAll": true
}
]
}
17 changes: 17 additions & 0 deletions __fixtures__/esm-fragment-test-project/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"editor.tabSize": 2,
"files.trimTrailingWhitespace": true,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"[prisma]": {
"editor.formatOnSave": true
},
"tailwindCSS.classAttributes": [
"class",
"className",
"activeClassName",
"errorClassName"
]
}
29 changes: 29 additions & 0 deletions __fixtures__/esm-fragment-test-project/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "WaitForDevServer",
"group": "none",
"type": "shell",
"command": "bash",
"args": [
"-c",
"while ! echo -n > /dev/tcp/localhost/18911; do sleep 1; done;"
],
"windows": {
"command": "powershell",
"args": [
"-NoProfile",
"-ExecutionPolicy", "Bypass",
"while (-not (Test-NetConnection -ComputerName localhost -Port 18911)) { Start-Sleep -Seconds 1 };"
]
},
"presentation": {
"reveal": "silent",
"revealProblems": "onProblem",
"panel": "shared",
"close": true
}
},
]
}
15 changes: 15 additions & 0 deletions __fixtures__/esm-fragment-test-project/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Yarn's manifest file. You can configure yarn here.
# See https://yarnpkg.com/configuration/yarnrc.

# For `node_modules` (see `nodeLinker` below), this is almost always the preferred option.
compressionLevel: 0

enableGlobalCache: true

# Lets yarn use hardlinks inside `node_modules` to dedupe packages.
# For a more pnpm-like experience, consider `hardlinks-global` where hardlinks point to a global store.
nmMode: hardlinks-local

# How to install Node packages.
# Heads up: right now, Redwood expects this to be `node-modules`.
nodeLinker: node-modules
17 changes: 17 additions & 0 deletions __fixtures__/esm-fragment-test-project/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# README

Welcome to your new [CedarJS](https://cedarjs.com) project!

Start by installing dependencies:

```
yarn install
```

Then start the development server:

```
yarn redwood dev
```

Your browser should automatically open to [http://localhost:8910](http://localhost:8910) where you'll see the Welcome Page, which links out to many great resources.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- CreateTable
CREATE TABLE "UserExample" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"email" TEXT NOT NULL,
"name" TEXT
);

-- CreateTable
CREATE TABLE "Post" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"title" TEXT NOT NULL,
"body" TEXT NOT NULL,
"authorId" INTEGER NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "Post_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);

-- CreateTable
CREATE TABLE "User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"email" TEXT NOT NULL,
"hashedPassword" TEXT NOT NULL,
"fullName" TEXT NOT NULL,
"salt" TEXT NOT NULL,
"resetToken" TEXT,
"resetTokenExpiresAt" DATETIME,
"roles" TEXT
);

-- CreateIndex
CREATE UNIQUE INDEX "UserExample_email_key" ON "UserExample"("email");

-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- CreateTable
CREATE TABLE "Contact" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"email" TEXT NOT NULL,
"message" TEXT NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- CreateTable
CREATE TABLE "Produce" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"quantity" INTEGER NOT NULL,
"price" INTEGER NOT NULL,
"nutrients" TEXT,
"region" TEXT NOT NULL,
"isSeedless" BOOLEAN,
"ripenessIndicators" TEXT,
"vegetableFamily" TEXT,
"isPickled" BOOLEAN,
"stallId" TEXT NOT NULL,
CONSTRAINT "Produce_stallId_fkey" FOREIGN KEY ("stallId") REFERENCES "Stall" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);

-- CreateTable
CREATE TABLE "Stall" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"stallNumber" TEXT NOT NULL
);

-- CreateIndex
CREATE UNIQUE INDEX "Produce_name_key" ON "Produce"("name");

-- CreateIndex
CREATE UNIQUE INDEX "Stall_stallNumber_key" ON "Stall"("stallNumber");
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "sqlite"
Loading
Loading