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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ temp/
# Preserve root lock
!package-lock.json
# If individual workspace package-locks accidentally get created (npm -w install inside):
@typeshim/*/package-lock.json
@client/*/package-lock.json

# -----------------------------
# Misc bundler artifacts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@typeshim/app Demo</title>
<title>@client/app Demo</title>

<!-- enable when using WasmFingerprintAssets=true on the dotnet wasm project-->
<!-- <script type="importmap"></script> -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@typeshim/app",
"name": "@client/app",
"version": "1.0.0",
"description": "",
"main": "index.js",
Expand All @@ -11,8 +11,5 @@
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@typeshim/people-ui": "*"
}
"license": "ISC"
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useState } from 'react';
import Home from './pages/Home';
import People from './pages/People';
import { TypeShimProvider } from '@typeshim/wasm-exports';
import { AppProvider } from '@typeshim/people-ui';
import { TypeShimProvider } from '@client/wasm-exports';
import { AppProvider } from './people/AppProvider';

type Page = 'home' | 'people';

Expand All @@ -28,7 +28,7 @@ function Content() {
display: 'flex',
gap: '1rem'
}}>
<strong style={{ marginRight: '1rem' }}>@typeshim/app</strong>
<strong style={{ marginRight: '1rem' }}>@client/app</strong>
<nav style={{ display: 'flex', gap: '1rem' }}>
<a
href="#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default function Home() {
return (
<div>
<h1>Welcome to @typeshim/app</h1>
<h1>Welcome to @client/app</h1>
<p>This is a sample React app that demonstrates how TypeShim extends .NET &lt;&gt; Javascript interop with:</p>
<ul>
<li>Natural object semantics like:</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import { PeopleList, PeopleGrid } from '@typeshim/people-ui';
import { PeopleList, PeopleGrid } from '../people';

export default function People() {
const [view, setView] = useState<'list' | 'grid'>('list');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PeopleApp } from '@typeshim/wasm-exports';
import { PeopleApp } from '@client/wasm-exports';
import { useMemo, ReactNode } from 'react';
import AppContext from './appContext';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React, { useEffect, useState } from 'react';
import { PersonCard } from './PersonCard';
import type { Person } from '@typeshim/wasm-exports';
import type { Person } from '@client/wasm-exports';
import { PeopleRepository } from './PeopleRepository';
import AppContext from './appContext';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React, { useEffect, useState } from 'react';
import { PersonCard } from './PersonCard';
import type { Person } from '@typeshim/wasm-exports';
import type { Person } from '@client/wasm-exports';
import { PeopleRepository } from './PeopleRepository';
import AppContext from './appContext';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { People, Person, PeopleProvider } from '@typeshim/wasm-exports';
import { People, Person, PeopleProvider } from '@client/wasm-exports';

export class PeopleRepository {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Person, Dog } from '@typeshim/wasm-exports';
import { Person, Dog } from '@client/wasm-exports';
import { PetChip } from './PetChip';

export interface PersonCardProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Dog } from '@typeshim/wasm-exports';
import { Dog } from '@client/wasm-exports';

export interface PetChipProps {
petProxy: Dog;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PeopleApp } from '@typeshim/wasm-exports';
import { PeopleApp } from '@client/wasm-exports';
import React from 'react';

const AppContext = React.createContext<PeopleApp>(undefined!);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createWasmRuntime, TypeShimInitializer } from '@typeshim/wasm-exports';
import { createWasmRuntime, TypeShimInitializer } from '@client/wasm-exports';
import { ReactNode, useEffect, useState } from 'react';

export interface AppProviderProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@typeshim/wasm-exports",
"name": "@client/wasm-exports",
"version": "1.0.0",
"description": "",
"main": "main.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>

<PropertyGroup>
<OutputPath>../TypeShim.Sample.Client/@typeshim/wasm-exports/lib</OutputPath>
<OutputPath>../@client/wasm-exports/lib</OutputPath>
<!--<TypeShim_GeneratedDir>../../../TypeShim</TypeShim_GeneratedDir>-->
<!--<TypeShim_TypeScriptOutputDirectory>wwwroot</TypeShim_TypeScriptOutputDirectory>-->
<!--<TypeShim_MSBuildMessagePriority>High</TypeShim_MSBuildMessagePriority>-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TypeShim.Sample;
namespace Client.Library;

public class PeopleDto
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;

namespace TypeShim.Sample;
namespace Client.Library;

[TSExport]
public class People()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace TypeShim.Sample;
namespace Client.Library;

public class PeopleApiClient(HttpClient httpClient)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Net.Http;

namespace TypeShim.Sample;
namespace Client.Library;

[TSExport]
public class PeopleAppOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Threading.Tasks;
using TypeShim;

namespace TypeShim.Sample;
namespace Client.Library;

[TSExport]
public class PeopleProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Net.Http;
using System.Runtime.InteropServices.JavaScript;

namespace TypeShim.Sample;
namespace Client.Library;

public partial class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;

namespace TypeShim.Sample;
namespace Client.Library;

public class RandomEntityGenerator
{
Expand Down
9 changes: 2 additions & 7 deletions sample/Sample.slnx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<Solution>
<Project Path="TypeShim.Sample.Server/TypeShim.Sample.Server.csproj" />
<Project Path="TypeShim.Sample/TypeShim.Sample.csproj" />
<Project Path="TypeShim.Sample.Client/TypeShim.Sample.Client.esproj">
<BuildDependency Project="TypeShim.Sample/TypeShim.Sample.csproj" />
<Build />
<Deploy />
</Project>
<Project Path="Server/Server.csproj" />
<Project Path="Client.Library/Client.Library.csproj" />
</Solution>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using TypeShim.Sample;
using Client.Library;

namespace TypeShim.Sample.Server.Controllers;
namespace Server.Controllers;

[ApiController]
[Route("[controller]")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#pragma warning restore ASP0014 // Suggest using top level route registrations
app.UseSpa(spa =>
{
// run 'npm start' or 'npm run dev' in TypeShim.Sample.Client to start the vite dev server
// run 'npm start' or 'npm run dev' in the sample directory to start the vite dev server
spa.UseProxyToSpaDevelopmentServer("http://localhost:5173/");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\TypeShim.Sample\TypeShim.Sample.csproj" />
<ProjectReference Include="..\Client.Library\Client.Library.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
28 changes: 0 additions & 28 deletions sample/TypeShim.Sample.Client/@typeshim/people-ui/package.json

This file was deleted.

19 changes: 0 additions & 19 deletions sample/TypeShim.Sample.Client/@typeshim/people-ui/tsconfig.json

This file was deleted.

11 changes: 0 additions & 11 deletions sample/TypeShim.Sample.Client/TypeShim.Sample.Client.esproj

This file was deleted.

This file was deleted.

This file was deleted.

Loading