Skip to content

Commit

Permalink
refactor: replace 'snarkyjs' with 'o1js' across multiple files
Browse files Browse the repository at this point in the history
This change is done to reflect the library name change from 'snarkyjs' to 'o1js'. All instances of 'snarkyjs' in the code, comments, and configuration files have been replaced with 'o1js'.
  • Loading branch information
MartinMinkov committed Sep 5, 2023
1 parent 44e6796 commit 8e010c4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ module.exports = {
node: true,
jest: true,
},
extends: ['eslint:recommended', 'plugin:snarkyjs/recommended'],
extends: ['eslint:recommended', 'plugin:o1js/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
},
plugins: ['@typescript-eslint', 'snarkyjs'],
plugins: ['@typescript-eslint', 'o1js'],
rules: {},
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module.exports = (request, options) => {
return options.defaultResolver(request, {
...options,
packageFilter: (pkg) => {
// When importing snarkyjs, we specify the Node ESM import as Jest by default imports the web version
if (pkg.name === 'snarkyjs') {
// When importing o1js, we specify the Node ESM import as Jest by default imports the web version
if (pkg.name === 'o1js') {
return {
...pkg,
main: pkg.exports.node.import,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export default {
},
resolver: '<rootDir>/jest-resolver.cjs',
transformIgnorePatterns: [
'<rootDir>/node_modules/(?!snarkyjs/node_modules/tslib)',
'<rootDir>/node_modules/(?!o1js/node_modules/tslib)',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ const nextConfig = {
webpack(config) {
config.resolve.alias = {
...config.resolve.alias,
snarkyjs: require('path').resolve('node_modules/o1js'),
o1js: require('path').resolve('node_modules/o1js'),
};
config.experiments = { ...config.experiments, topLevelAwait: true };
config.optimization.minimizer = [];
return config;
},

// To enable SnarkyJS for the web, we must set the COOP and COEP headers.
// To enable o1js for the web, we must set the COOP and COEP headers.
// See here for more information: https://docs.minaprotocol.com/zkapps/how-to-write-a-zkapp-ui#enabling-coop-and-coep-headers
async headers() {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ export default function Home() {
// -------------------------------------------------------
// Create UI elements

let setupText = state.hasBeenSetup
? 'SnarkyJS Ready'
: 'Setting up SnarkyJS...';
let setupText = state.hasBeenSetup ? 'o1js Ready' : 'Setting up o1js...';
let setup = <div> {setupText} </div>;

let accountDoesNotExist;
Expand Down

0 comments on commit 8e010c4

Please sign in to comment.