Skip to content

Commit

Permalink
create-starknet: fix npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
fracek committed Nov 16, 2023
1 parent 1d54023 commit d5f266a
Show file tree
Hide file tree
Showing 47 changed files with 38 additions and 160 deletions.
5 changes: 5 additions & 0 deletions .changeset/tough-emus-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-starknet": patch
---

Fix npm package
6 changes: 6 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

"complexity": {
"useLiteralKeys": "off"
},
"a11y": {
"useAltText": "off",
"noBlankTarget": "off",
"useButtonType": "off",
"useKeyWithClickEvents": "off"
}
}
},
Expand Down
6 changes: 0 additions & 6 deletions packages/create-starknet/nodemon.json

This file was deleted.

8 changes: 2 additions & 6 deletions packages/create-starknet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"description": "Create starknet apps with one command",
"main": "index.js",
"scripts": {
"build": "rimraf ./dist && tsc",
"clean": "rimraf ./dist",
"dev": "npx nodemon",
"build": "tsup --publicDir",
"start": "pnpm run build && node dist/index.js",
"lint": "biome check .",
"lint:fix": "pnpm lint --apply",
Expand All @@ -27,9 +25,7 @@
"@types/node": "^18.11.18",
"@types/prompts": "2.0.1",
"@types/validate-npm-package-name": "^4.0.0",
"nodemon": "^2.0.20",
"rimraf": "^4.1.2",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typescript": "^4.9.5"
},
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { ReactNode } from "react";
import { goerli, mainnet } from "@starknet-react/chains";
import {
StarknetConfig,
publicProvider,
argent,
braavos,
publicProvider,
useInjectedConnectors,
} from "@starknet-react/core";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ export const Button = ({ children, ...props }: ButtonProps) => {
return (
<button
{...props}
className={
"px-2 py-1 bg-gray-600 rounded-md text-white disabled:opacity-50 " +
props.className
}
className={`px-2 py-1 bg-gray-600 rounded-md text-white disabled:opacity-50 ${props.className}`}
>
{children}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
// import { useBlock } from "@starknet-react/core";
import Header from "./components/Header";
import React from "react";

function App() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { useAccount, useDisconnect } from "@starknet-react/core";
import React from "react";
import ConnectModal from "./starknet/ConnectModal";

export default function Header() {
Expand All @@ -8,7 +8,6 @@ export default function Header() {

return (
<div className="fixed top-0 left-0 right-0 bg-white border justify-between flex flex-row px-4 p-2">
<div className="w-10"></div>
{address ? (
<div className="flex flex-col items-end bg-zinc-100 rounded-md px-6 py-2">
<p className="font-semibold">{`${address.slice(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import { Connector, useConnect } from "@starknet-react/core";
import React from "react";
import { useConnect, Connector } from "@starknet-react/core";
import { Button } from "../ui/Button";
import Dialog from "../ui/Dialog";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ export const Button = ({ children, ...props }: ButtonProps) => {
return (
<button
{...props}
className={
"px-3 py-2 bg-blue-500 rounded-md text-white disabled:opacity-50 " +
props.className
}
className={`px-3 py-2 bg-blue-500 rounded-md text-white disabled:opacity-50 ${props.className}`}
>
{children}
</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { devnet, goerli, mainnet } from "@starknet-react/chains";
import {
StarknetConfig,
argent,
braavos,
publicProvider,
useInjectedConnectors,
} from "@starknet-react/core";
import { devnet, goerli, mainnet } from "@starknet-react/chains";
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ import chalk from "chalk";
import { Command, Option } from "commander";
import prompts from "prompts";

import {
Template,
installDependencies,
installTemplate,
} from "./helpers/installation";
import { PackageManager, getPackageManager } from "./helpers/packageManager";
import { getPackageNameValidation } from "./helpers/validate";
import createStarknetPackageJson from "./package.json";
import createStarknetPackageJson from "../package.json";
import { Template, installDependencies, installTemplate } from "./installation";
import { PackageManager, getPackageManager } from "./packageManager";
import { getPackageNameValidation } from "./validate";

const handleSigTerm = () => process.exit(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function installTemplate(
throw new Error("A template should be selected");
}

const templatesFolderPath = path.join(__dirname, "../../templates");
const templatesFolderPath = path.join(__dirname, "./templates");

const selectedTemplatePath = path.join(templatesFolderPath, selectedTemplate);

Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions packages/create-starknet/templates/next/next-env.d.ts

This file was deleted.

10 changes: 10 additions & 0 deletions packages/create-starknet/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.ts"],
splitting: false,
sourcemap: false,
dts: false,
clean: true,
format: ["cjs"],
});
123 changes: 3 additions & 120 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d5f266a

Please sign in to comment.