create-analog 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-analog",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Brandon Roberts",
@@ -4,17 +4,16 @@
4
4
  "configurations": [
5
5
  {
6
6
  "name": "ng serve",
7
- "type": "pwa-chrome",
7
+ "type": "chrome",
8
8
  "request": "launch",
9
9
  "preLaunchTask": "npm: start",
10
- "url": "http://localhost:4200/"
10
+ "url": "http://localhost:5173/"
11
11
  },
12
12
  {
13
13
  "name": "ng test",
14
14
  "type": "chrome",
15
15
  "request": "launch",
16
- "preLaunchTask": "npm: test",
17
- "url": "http://localhost:9876/debug.html"
16
+ "preLaunchTask": "npm: test"
18
17
  }
19
18
  ]
20
19
  }
@@ -1,6 +1,6 @@
1
1
  # Analog App
2
2
 
3
- This project was generated with [Analog](https://npmjs.com/package/create-analog).
3
+ This project was generated with [Analog](https://analogjs.org), the fullstack meta-framework for Angular.
4
4
 
5
5
  ## Setup
6
6
 
@@ -12,7 +12,7 @@ Run `yarn dev` for a dev server. Navigate to `http://localhost:5173/`. The appli
12
12
 
13
13
  ## Build
14
14
 
15
- Run `yarn build` to build the project. The build artifacts will be stored in the `dist/` directory.
15
+ Run `yarn build` to build the client/server project. The client build artifacts are located in the `dist/client` directory. The server for the API build artifacts are located in the `dist/server` directory.
16
16
 
17
17
  ## Test
18
18
 
@@ -5,12 +5,47 @@
5
5
  "projects": {
6
6
  "my-app": {
7
7
  "projectType": "application",
8
- "schematics": {},
9
8
  "root": "",
10
9
  "sourceRoot": "src",
11
10
  "prefix": "app",
12
11
  "architect": {
13
- "targets": {}
12
+ "build": {
13
+ "builder": "@nrwl/vite:build",
14
+ "options": {
15
+ "configFile": "vite.config.ts",
16
+ "outputPath": "dist/client"
17
+ },
18
+ "defaultConfiguration": "production",
19
+ "configurations": {
20
+ "development": {},
21
+ "production": {
22
+ "sourcemap": false
23
+ }
24
+ }
25
+ },
26
+ "serve": {
27
+ "builder": "@nrwl/vite:dev-server",
28
+ "defaultConfiguration": "development",
29
+ "options": {
30
+ "buildTarget": "my-app:build",
31
+ "port": 5173
32
+ },
33
+ "configurations": {
34
+ "development": {
35
+ "buildTarget": "my-app:build:development",
36
+ "hmr": true
37
+ },
38
+ "production": {
39
+ "buildTarget": "my-app:build:production"
40
+ }
41
+ }
42
+ },
43
+ "test": {
44
+ "builder": "@nrwl/vite:test",
45
+ "options": {
46
+ "config": "vite.config.ts"
47
+ }
48
+ }
14
49
  }
15
50
  }
16
51
  }
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>MyApp</title>
6
+ <base href="/">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1">
8
+ <link rel="icon" type="image/x-icon" href="favicon.ico">
9
+ <link rel="stylesheet" href="/src/styles.css" />
10
+ </head>
11
+ <body>
12
+ <app-root></app-root>
13
+ <script type="module" src="/src/main.ts"></script>
14
+ </body>
15
+ </html>
@@ -6,12 +6,12 @@
6
6
  "node": ">=16.0.0"
7
7
  },
8
8
  "scripts": {
9
- "dev": "vite",
9
+ "dev": "ng serve",
10
10
  "ng": "ng",
11
- "start": "npm run dev",
12
- "build": "vite build",
13
- "watch": "vite build --watch",
14
- "test": "vitest"
11
+ "start": "ng serve",
12
+ "build": "ng build",
13
+ "watch": "ng build --watch",
14
+ "test": "ng test"
15
15
  },
16
16
  "dependencies": {
17
17
  "@analogjs/router": "latest",
@@ -32,9 +32,10 @@
32
32
  "@angular-devkit/build-angular": "^15.0.0",
33
33
  "@angular/cli": "~15.0.0",
34
34
  "@angular/compiler-cli": "^15.0.0",
35
+ "@nrwl/vite": "^15.2.0",
35
36
  "jsdom": "^20.0.0",
36
37
  "typescript": "~4.8.4",
37
- "vite": "^3.0.9",
38
- "vitest": "^0.22.1"
38
+ "vite": "^3.2.3",
39
+ "vitest": "^0.25.1"
39
40
  }
40
41
  }
@@ -1,4 +1,4 @@
1
- import './polyfills';
1
+ import 'zone.js';
2
2
  import { bootstrapApplication } from '@angular/platform-browser';
3
3
  import { provideFileRouter } from '@analogjs/router';
4
4
 
@@ -6,6 +6,6 @@
6
6
  "outDir": "./out-tsc/app",
7
7
  "types": []
8
8
  },
9
- "files": ["src/main.ts", "src/polyfills.ts"],
9
+ "files": ["src/main.ts"],
10
10
  "include": ["src/**/*.d.ts", "src/app/routes/**/*.ts"]
11
11
  }
@@ -6,6 +6,6 @@
6
6
  "outDir": "./out-tsc/spec",
7
7
  "types": ["node", "vitest/globals"]
8
8
  },
9
- "files": ["src/test.ts", "src/polyfills.ts"],
9
+ "files": ["src/test.ts"],
10
10
  "include": ["src/**/*.spec.ts", "src/**/*.ts"]
11
11
  }
@@ -5,12 +5,9 @@ import analog from '@analogjs/platform';
5
5
 
6
6
  // https://vitejs.dev/config/
7
7
  export default defineConfig(({ mode }) => ({
8
- root: 'src',
9
- publicDir: 'assets',
8
+ publicDir: 'src/assets',
10
9
  build: {
11
- outDir: `../dist/my-app/client`,
12
- emptyOutDir: true,
13
- target: 'es2022',
10
+ target: ['es2020'],
14
11
  },
15
12
  resolve: {
16
13
  mainFields: ['module'],
@@ -19,11 +16,8 @@ export default defineConfig(({ mode }) => ({
19
16
  test: {
20
17
  globals: true,
21
18
  environment: 'jsdom',
22
- setupFiles: ['test.ts'],
19
+ setupFiles: ['src/test.ts'],
23
20
  include: ['**/*.spec.ts'],
24
- cache: {
25
- dir: `../node_modules/.vitest`,
26
- },
27
21
  },
28
22
  define: {
29
23
  'import.meta.vitest': mode !== 'production',