Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4 Add package builder #6

Merged
merged 6 commits into from
Jan 21, 2022
Merged

#4 Add package builder #6

merged 6 commits into from
Jan 21, 2022

Conversation

thekingofcity
Copy link
Member

This requires #5 to be merged.

Currently, I update id for every city name like shanghai to CityCode.Shanghai in city-config.ts. This is a hardcoded replace. Since shanghai is still valid as long as we have enum CityCode, I'm wondering about this replacement process.

json:
    {
        "id": "shanghai",
        "country": "CN",
        "name": {
            "en": "Shanghai",
            "zh": "上海"
        }
    },

ts option1:
  {
    id: CityCode.Shanghai,
    country: 'CN',
    name: { en: 'Shanghai', zh: '上海' }
  },

ts option2:
  {
    id: 'shanghai',
    country: 'CN',
    name: { en: 'Shanghai', zh: '上海' }
  },

$ node --loader ts-node/esm .\builder\build.ts

A successful build will be

\RMG-PALETTE\BUILDER
│  build.ts
│  city-config.ts
│  constants.ts
│  
└─palettes
        baku.ts
        barcelona.ts
        beijing.ts
        cairo.ts
        changsha.ts
        chengdu.ts
        chongqing.ts
        dalian.ts
        delhi.ts
        dongguan.ts
        dortmund.ts
        edinburgh.ts
        foshan.ts
        glasgow.ts
        guangzhou.ts
        hangzhou.ts
        harbin.ts
        hongkong.ts
        istanbul.ts
        kansai.ts
        kaohsiung.ts
        klangvalley.ts
        london.ts
        macao.ts
        madrid.ts
        nanjing.ts
        newtaipei.ts
        osaka.ts
        oslo.ts
        other.ts
        paris.ts
        qingdao.ts
        sanfrancisco.ts
        sanktpeterburg.ts
        santiago.ts
        saopaulo.ts
        seoul.ts
        shanghai.ts
        shenzhen.ts
        singapore.ts
        stockholm.ts
        suzhou.ts
        taipei.ts
        tehran.ts
        tianjin.ts
        tokyo.ts
        toronto.ts
        tyneandwear.ts
        wuxi.ts
        xiamen.ts
        xian.ts

@thekingofcity thekingofcity merged commit 3a06641 into master Jan 21, 2022
@thekingofcity thekingofcity linked an issue Jan 21, 2022 that may be closed by this pull request
@wongchito wongchito deleted the #4-package-builder branch February 18, 2023 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add package builder
2 participants