Skip to content

Commit

Permalink
pull multi-package
Browse files Browse the repository at this point in the history
  • Loading branch information
passion0102 committed Jun 26, 2024
2 parents 5470906 + 32096d3 commit 2dda96a
Show file tree
Hide file tree
Showing 77 changed files with 20,629 additions and 2,027 deletions.
55 changes: 0 additions & 55 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/check-can-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
cache: "yarn"
cache: "npm"
node-version: ${{ env.node-version }}
registry-url: "https://registry.npmjs.org"
always-auth: true
Expand All @@ -30,4 +30,4 @@ jobs:
uses: technote-space/package-version-check-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGE_MANAGER: yarn
PACKAGE_MANAGER: npm
16 changes: 13 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,35 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
cache: "yarn"
cache: "npm"
node-version: ${{ matrix.node-version }}

- name: Cache node_modules
uses: actions/cache@v2
id: cache_node_modules
with:
# check diff of package.json and yarn.lock
key: ${{ runner.os }}-build-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-build-node_modules-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}
path: "**/node_modules"

- name: Install dependencies
if: steps.cache_node_modules.outputs.cache-hit != 'true'
run: yarn install
run: npm install

- name: Build
run: npm run build:all

- name: Lint
<<<<<<< HEAD
run: yarn workspace evm lint # TODO: yarn workspaces run lintへ変更

- name: Test
run: yarn workspace evm test # TODO: yarn workspaces run testへ変更
=======
run: npm run lint:all

- name: Test
run: npm run test:evm
>>>>>>> 32096d3351550abf7ef1da5d64ef5f552f61f06b
env:
PROVIDER_URL: https://goerli.infura.io/v3/${{ secrets.INFURA_KEY }}
33 changes: 4 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
# dependencies
/node_modules
/.pnp
.pnp.js
node_modules

# testing
/coverage
.nx/installation
.nx/cache
.nx/workspace-data

# next.js
/.next/
/out/

# production
**/*/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel
115 changes: 115 additions & 0 deletions .nx/nxw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
"use strict";
// This file should be committed to your repository! It wraps Nx and ensures
// that your local installation matches nx.json.
// See: https://nx.dev/recipes/installation/install-non-javascript for more info.




Object.defineProperty(exports, "__esModule", { value: true });
const fs = require('fs');
const path = require('path');
const cp = require('child_process');
const installationPath = path.join(__dirname, 'installation', 'package.json');
function matchesCurrentNxInstall(currentInstallation, nxJsonInstallation) {
if (!currentInstallation.devDependencies ||
!Object.keys(currentInstallation.devDependencies).length) {
return false;
}
try {
if (currentInstallation.devDependencies['nx'] !==
nxJsonInstallation.version ||
require(path.join(path.dirname(installationPath), 'node_modules', 'nx', 'package.json')).version !== nxJsonInstallation.version) {
return false;
}
for (const [plugin, desiredVersion] of Object.entries(nxJsonInstallation.plugins || {})) {
if (currentInstallation.devDependencies[plugin] !== desiredVersion) {
return false;
}
}
return true;
}
catch {
return false;
}
}
function ensureDir(p) {
if (!fs.existsSync(p)) {
fs.mkdirSync(p, { recursive: true });
}
}
function getCurrentInstallation() {
try {
return require(installationPath);
}
catch {
return {
name: 'nx-installation',
version: '0.0.0',
devDependencies: {},
};
}
}
function performInstallation(currentInstallation, nxJson) {
fs.writeFileSync(installationPath, JSON.stringify({
name: 'nx-installation',
devDependencies: {
nx: nxJson.installation.version,
...nxJson.installation.plugins,
},
}));
try {
cp.execSync('npm i', {
cwd: path.dirname(installationPath),
stdio: 'inherit',
});
}
catch (e) {
// revert possible changes to the current installation
fs.writeFileSync(installationPath, JSON.stringify(currentInstallation));
// rethrow
throw e;
}
}
function ensureUpToDateInstallation() {
const nxJsonPath = path.join(__dirname, '..', 'nx.json');
let nxJson;
try {
nxJson = require(nxJsonPath);
if (!nxJson.installation) {
console.error('[NX]: The "installation" entry in the "nx.json" file is required when running the nx wrapper. See https://nx.dev/recipes/installation/install-non-javascript');
process.exit(1);
}
}
catch {
console.error('[NX]: The "nx.json" file is required when running the nx wrapper. See https://nx.dev/recipes/installation/install-non-javascript');
process.exit(1);
}
try {
ensureDir(path.join(__dirname, 'installation'));
const currentInstallation = getCurrentInstallation();
if (!matchesCurrentNxInstall(currentInstallation, nxJson.installation)) {
performInstallation(currentInstallation, nxJson);
}
}
catch (e) {
const messageLines = [
'[NX]: Nx wrapper failed to synchronize installation.',
];
if (e instanceof Error) {
messageLines.push('');
messageLines.push(e.message);
messageLines.push(e.stack);
}
else {
messageLines.push(e.toString());
}
console.error(messageLines.join('\n'));
process.exit(1);
}
}
if (!process.env.NX_WRAPPER_SKIP_INSTALL) {
ensureUpToDateInstallation();
}

require('./installation/node_modules/nx/bin/nx');
9 changes: 9 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
);
27 changes: 27 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"installation": {
"version": "19.3.0"
},
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"build": {
"dependsOn": [
"^build"
],
"outputs": [
"{projectRoot}/dist"
],
"cache": true
},
"typecheck": {
"cache": true
},
"lint": {
"cache": true
}
},
"release": {
"projectsRelationship": "independent"
},
"defaultBase": "master"
}
Loading

0 comments on commit 2dda96a

Please sign in to comment.